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
988aa750
Commit
988aa750
authored
Aug 04, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AccountInfoEditor: toolbar changed during vCard saving - title changed and menu option disabled.
parent
b3c980be
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
AccountInfoEditor.java
...rc/main/java/com/xabber/android/ui/AccountInfoEditor.java
+15
-2
AccountInfoEditorFragment.java
...java/com/xabber/android/ui/AccountInfoEditorFragment.java
+21
-0
contact_viewer.xml
app/src/main/res/values/contact_viewer.xml
+1
-0
No files found.
app/src/main/java/com/xabber/android/ui/AccountInfoEditor.java
View file @
988aa750
...
@@ -17,10 +17,11 @@ import com.xabber.android.data.intent.EntityIntentBuilder;
...
@@ -17,10 +17,11 @@ import com.xabber.android.data.intent.EntityIntentBuilder;
import
com.xabber.android.ui.helper.BarPainter
;
import
com.xabber.android.ui.helper.BarPainter
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
com.xabber.android.ui.helper.ManagedActivity
;
public
class
AccountInfoEditor
extends
ManagedActivity
implements
Toolbar
.
OnMenuItemClickListener
{
public
class
AccountInfoEditor
extends
ManagedActivity
implements
Toolbar
.
OnMenuItemClickListener
,
AccountInfoEditorFragment
.
Lister
{
public
static
final
String
ARG_VCARD
=
"com.xabber.android.ui.AccountInfoEditor.ARG_VCARD"
;
public
static
final
String
ARG_VCARD
=
"com.xabber.android.ui.AccountInfoEditor.ARG_VCARD"
;
public
static
final
int
SAVE_MENU
=
R
.
menu
.
save
;
public
static
final
int
SAVE_MENU
=
R
.
menu
.
save
;
private
Toolbar
toolbar
;
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
vCard
)
{
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
vCard
)
{
...
@@ -50,7 +51,7 @@ public class AccountInfoEditor extends ManagedActivity implements Toolbar.OnMenu
...
@@ -50,7 +51,7 @@ public class AccountInfoEditor extends ManagedActivity implements Toolbar.OnMenu
finish
();
finish
();
}
}
Toolbar
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
=
(
Toolbar
)
findViewById
(
R
.
id
.
toolbar_default
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_clear_white_24dp
);
toolbar
.
setNavigationOnClickListener
(
new
View
.
OnClickListener
()
{
toolbar
.
setNavigationOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
@@ -104,4 +105,16 @@ public class AccountInfoEditor extends ManagedActivity implements Toolbar.OnMenu
...
@@ -104,4 +105,16 @@ public class AccountInfoEditor extends ManagedActivity implements Toolbar.OnMenu
getFragmentManager
().
findFragmentById
(
R
.
id
.
fragment_container
).
onActivityResult
(
requestCode
,
getFragmentManager
().
findFragmentById
(
R
.
id
.
fragment_container
).
onActivityResult
(
requestCode
,
resultCode
,
data
);
resultCode
,
data
);
}
}
@Override
public
void
onVCardSavingStarted
()
{
toolbar
.
setTitle
(
R
.
string
.
saving
);
toolbar
.
getMenu
().
findItem
(
R
.
id
.
action_save
).
setEnabled
(
false
);
}
@Override
public
void
onVCardSavingFinished
()
{
toolbar
.
setTitle
(
R
.
string
.
edit_account_user_info
);
toolbar
.
getMenu
().
findItem
(
R
.
id
.
action_save
).
setEnabled
(
true
);
}
}
}
app/src/main/java/com/xabber/android/ui/AccountInfoEditorFragment.java
View file @
988aa750
...
@@ -69,6 +69,13 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
...
@@ -69,6 +69,13 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
private
LinearLayout
fields
;
private
LinearLayout
fields
;
private
TextView
avatarSize
;
private
TextView
avatarSize
;
private
Lister
lister
;
interface
Lister
{
void
onVCardSavingStarted
();
void
onVCardSavingFinished
();
}
public
static
AccountInfoEditorFragment
newInstance
(
String
account
,
String
vCard
)
{
public
static
AccountInfoEditorFragment
newInstance
(
String
account
,
String
vCard
)
{
AccountInfoEditorFragment
fragment
=
new
AccountInfoEditorFragment
();
AccountInfoEditorFragment
fragment
=
new
AccountInfoEditorFragment
();
...
@@ -82,6 +89,12 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
...
@@ -82,6 +89,12 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
public
AccountInfoEditorFragment
()
{
public
AccountInfoEditorFragment
()
{
}
}
@Override
public
void
onAttach
(
Activity
activity
)
{
super
.
onAttach
(
activity
);
lister
=
(
Lister
)
activity
;
}
@Override
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -165,6 +178,12 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
...
@@ -165,6 +178,12 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
Application
.
getInstance
().
removeUIListener
(
OnVCardSaveListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnVCardSaveListener
.
class
,
this
);
}
}
@Override
public
void
onDetach
()
{
super
.
onDetach
();
lister
=
null
;
}
private
void
setFieldsFromVCard
()
{
private
void
setFieldsFromVCard
()
{
formattedName
.
setText
(
vCard
.
getField
(
VCardProperty
.
FN
.
name
()));
formattedName
.
setText
(
vCard
.
getField
(
VCardProperty
.
FN
.
name
()));
prefixName
.
setText
(
vCard
.
getPrefix
());
prefixName
.
setText
(
vCard
.
getPrefix
());
...
@@ -308,11 +327,13 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
...
@@ -308,11 +327,13 @@ public class AccountInfoEditorFragment extends Fragment implements OnVCardSaveLi
public
void
enableProgressMode
()
{
public
void
enableProgressMode
()
{
setEnabledRecursive
(
false
,
fields
);
setEnabledRecursive
(
false
,
fields
);
progressBar
.
setVisibility
(
View
.
VISIBLE
);
progressBar
.
setVisibility
(
View
.
VISIBLE
);
lister
.
onVCardSavingStarted
();
}
}
public
void
disableProgressMode
()
{
public
void
disableProgressMode
()
{
progressBar
.
setVisibility
(
View
.
GONE
);
progressBar
.
setVisibility
(
View
.
GONE
);
setEnabledRecursive
(
true
,
fields
);
setEnabledRecursive
(
true
,
fields
);
lister
.
onVCardSavingFinished
();
}
}
private
void
setEnabledRecursive
(
boolean
enabled
,
ViewGroup
viewGroup
){
private
void
setEnabledRecursive
(
boolean
enabled
,
ViewGroup
viewGroup
){
...
...
app/src/main/res/values/contact_viewer.xml
View file @
988aa750
...
@@ -53,4 +53,5 @@
...
@@ -53,4 +53,5 @@
<string
name=
"account_user_info_save_success"
>
Account user info saved successfully
</string>
<string
name=
"account_user_info_save_success"
>
Account user info saved successfully
</string>
<string
name=
"account_user_info_save_fail"
>
Could not save account user info
</string>
<string
name=
"account_user_info_save_fail"
>
Could not save account user info
</string>
<string
name=
"account_user_info_save_started"
>
Saving account user info…
</string>
<string
name=
"account_user_info_save_started"
>
Saving account user info…
</string>
<string
name=
"saving"
>
Saving…
</string>
</resources>
</resources>
\ No newline at end of file
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