Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xabber-android
Commits
34f27b68
Commit
34f27b68
authored
Apr 10, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ManagedDialog: layout changed, icon removed, toolbar used for title.
parent
87a771c7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
79 deletions
+27
-79
ManagedDialog.java
...main/java/com/xabber/android/ui/helper/ManagedDialog.java
+9
-6
dialog.xml
app/src/main/res/layout/dialog.xml
+18
-73
No files found.
app/src/main/java/com/xabber/android/ui/helper/ManagedDialog.java
View file @
34f27b68
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
package
com
.
xabber
.
android
.
ui
.
helper
;
package
com
.
xabber
.
android
.
ui
.
helper
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v7.widget.Toolbar
;
import
android.view.View
;
import
android.view.View
;
import
android.view.View.OnClickListener
;
import
android.view.View.OnClickListener
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.xabber.androiddev.R
;
import
com.xabber.androiddev.R
;
...
@@ -35,11 +35,13 @@ public abstract class ManagedDialog extends SingleActivity {
...
@@ -35,11 +35,13 @@ public abstract class ManagedDialog extends SingleActivity {
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
setTheme
(
android
.
R
.
style
.
Theme_Dialog
);
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
dialog
);
setContentView
(
R
.
layout
.
dialog
);
setSupportActionBar
((
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
));
getSupportActionBar
().
setDisplayHomeAsUpEnabled
(
false
);
findViewById
(
android
.
R
.
id
.
button1
).
setOnClickListener
(
findViewById
(
android
.
R
.
id
.
button1
).
setOnClickListener
(
new
OnClickListener
()
{
new
OnClickListener
()
{
@Override
@Override
...
@@ -64,11 +66,11 @@ public abstract class ManagedDialog extends SingleActivity {
...
@@ -64,11 +66,11 @@ public abstract class ManagedDialog extends SingleActivity {
}
}
public
void
setDialogTitle
(
CharSequence
title
)
{
public
void
setDialogTitle
(
CharSequence
title
)
{
((
TextView
)
findViewById
(
android
.
R
.
id
.
title
)).
setText
(
title
);
getSupportActionBar
().
setTitle
(
title
);
}
}
public
void
setDialogTitle
(
int
resid
)
{
public
void
setDialogTitle
(
int
resid
)
{
((
TextView
)
findViewById
(
android
.
R
.
id
.
title
)).
setText
(
resid
);
getSupportActionBar
().
setTitle
(
resid
);
}
}
public
void
setDialogMessage
(
CharSequence
title
)
{
public
void
setDialogMessage
(
CharSequence
title
)
{
...
@@ -81,9 +83,10 @@ public abstract class ManagedDialog extends SingleActivity {
...
@@ -81,9 +83,10 @@ public abstract class ManagedDialog extends SingleActivity {
public
void
setCustomView
(
View
view
,
boolean
hideContainer
)
{
public
void
setCustomView
(
View
view
,
boolean
hideContainer
)
{
((
ViewGroup
)
findViewById
(
android
.
R
.
id
.
custom
)).
addView
(
view
);
((
ViewGroup
)
findViewById
(
android
.
R
.
id
.
custom
)).
addView
(
view
);
if
(
hideContainer
)
if
(
hideContainer
)
{
findViewById
(
R
.
id
.
container
).
setVisibility
(
View
.
GONE
);
findViewById
(
R
.
id
.
container
).
setVisibility
(
View
.
GONE
);
}
}
}
/**
/**
* Click on first button.
* Click on first button.
...
...
app/src/main/res/layout/dialog.xml
View file @
34f27b68
...
@@ -16,65 +16,14 @@
...
@@ -16,65 +16,14 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingTop=
"9dip"
android:paddingBottom=
"3dip"
android:paddingLeft=
"3dip"
android:paddingRight=
"1dip"
>
>
<LinearLayout
<include
layout=
"@layout/toolbar_default"
/>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:minHeight=
"54dip"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:gravity=
"center_vertical"
android:layout_marginTop=
"6dip"
android:layout_marginBottom=
"9dip"
android:layout_marginLeft=
"10dip"
android:layout_marginRight=
"10dip"
>
<ImageView
android:id=
"@android:id/icon"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"top"
android:paddingTop=
"6dip"
android:paddingRight=
"10dip"
android:src=
"@android:drawable/ic_dialog_info"
/>
<TextView
android:id=
"@android:id/title"
style=
"?android:attr/textAppearanceLarge"
android:singleLine=
"true"
android:ellipsize=
"end"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"1dip"
android:visibility=
"gone"
android:scaleType=
"fitXY"
android:gravity=
"fill_horizontal"
android:src=
"@android:drawable/divider_horizontal_dark"
/>
</LinearLayout>
<ScrollView
<ScrollView
android:id=
"@+id/container"
android:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
0dp
"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:paddingTop=
"2dip"
android:paddingTop=
"2dip"
android:paddingBottom=
"12dip"
android:paddingBottom=
"12dip"
...
@@ -85,7 +34,7 @@
...
@@ -85,7 +34,7 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
android:layout_height=
"
wrap_cont
ent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<TextView
...
@@ -115,7 +64,6 @@
...
@@ -115,7 +64,6 @@
/>
/>
<LinearLayout
<LinearLayout
style=
"@android:style/ButtonBar"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
...
@@ -127,7 +75,6 @@
...
@@ -127,7 +75,6 @@
<Button
<Button
android:id=
"@android:id/button1"
android:id=
"@android:id/button1"
style=
"?android:attr/buttonStyle"
android:layout_width=
"0dip"
android:layout_width=
"0dip"
android:layout_gravity=
"left"
android:layout_gravity=
"left"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -138,7 +85,6 @@
...
@@ -138,7 +85,6 @@
<Button
<Button
android:id=
"@android:id/button3"
android:id=
"@android:id/button3"
style=
"?android:attr/buttonStyle"
android:layout_width=
"0dip"
android:layout_width=
"0dip"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
@@ -148,7 +94,6 @@
...
@@ -148,7 +94,6 @@
<Button
<Button
android:id=
"@android:id/button2"
android:id=
"@android:id/button2"
style=
"?android:attr/buttonStyle"
android:layout_width=
"0dip"
android:layout_width=
"0dip"
android:layout_gravity=
"right"
android:layout_gravity=
"right"
android:layout_weight=
"1"
android:layout_weight=
"1"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment