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
8e10be53
Commit
8e10be53
authored
Jul 30, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New AccountViewer with menu option item to edit account user info (vCard).
parent
73bc5380
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
88 additions
and
4 deletions
+88
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+11
-0
AccountViewer.java
app/src/main/java/com/xabber/android/ui/AccountViewer.java
+59
-0
GroupedContactAdapter.java
.../com/xabber/android/ui/adapter/GroupedContactAdapter.java
+2
-2
ContextMenuHelper.java
.../java/com/xabber/android/ui/helper/ContextMenuHelper.java
+2
-2
account_viewer.xml
app/src/main/res/menu/account_viewer.xml
+10
-0
contact_editor.xml
app/src/main/res/values/contact_editor.xml
+3
-0
contact_viewer.xml
app/src/main/res/values/contact_viewer.xml
+1
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
8e10be53
...
@@ -244,6 +244,17 @@
...
@@ -244,6 +244,17 @@
android:name=
"android.support.PARENT_ACTIVITY"
android:name=
"android.support.PARENT_ACTIVITY"
android:value=
"com.xabber.android.ui.ChatViewer"
/>
android:value=
"com.xabber.android.ui.ChatViewer"
/>
</activity>
</activity>
<activity
android:name=
".ui.AccountViewer"
android:parentActivityName=
".ui.ContactList"
>
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name=
"android.support.PARENT_ACTIVITY"
android:value=
"com.xabber.android.ui.ContactList"
/>
</activity>
<activity
<activity
android:name=
".ui.FingerprintViewer"
android:name=
".ui.FingerprintViewer"
android:label=
"@string/otr_verify_fingerprint"
android:label=
"@string/otr_verify_fingerprint"
...
...
app/src/main/java/com/xabber/android/ui/AccountViewer.java
0 → 100644
View file @
8e10be53
package
com
.
xabber
.
android
.
ui
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.support.v7.widget.Toolbar
;
import
android.view.Menu
;
import
android.view.MenuItem
;
import
com.xabber.android.R
;
import
com.xabber.android.data.intent.EntityIntentBuilder
;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.android.data.roster.RosterContact
;
import
com.xabber.android.data.roster.RosterManager
;
public
class
AccountViewer
extends
ContactViewer
implements
Toolbar
.
OnMenuItemClickListener
{
public
static
final
int
ACCOUNT_VIEWER_MENU
=
R
.
menu
.
account_viewer
;
public
static
Intent
createIntent
(
Context
context
,
String
account
)
{
return
new
EntityIntentBuilder
(
context
,
AccountViewer
.
class
)
.
setAccount
(
account
).
setUser
(
GroupManager
.
IS_ACCOUNT
).
build
();
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
Toolbar
toolbar
=
contactTitleExpandableToolbarInflater
.
getToolbar
();
toolbar
.
inflateMenu
(
ACCOUNT_VIEWER_MENU
);
toolbar
.
setOnMenuItemClickListener
(
this
);
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
RosterContact
rosterContact
=
RosterManager
.
getInstance
().
getRosterContact
(
getAccount
(),
getBareAddress
());
if
(
rosterContact
!=
null
)
{
getMenuInflater
().
inflate
(
ACCOUNT_VIEWER_MENU
,
menu
);
}
return
true
;
}
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
return
onOptionsItemSelected
(
item
);
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_edit_account_user_info
:
return
true
;
default
:
return
super
.
onOptionsItemSelected
(
item
);
}
}
}
app/src/main/java/com/xabber/android/ui/adapter/GroupedContactAdapter.java
View file @
8e10be53
...
@@ -37,7 +37,7 @@ import com.xabber.android.data.roster.AbstractContact;
...
@@ -37,7 +37,7 @@ import com.xabber.android.data.roster.AbstractContact;
import
com.xabber.android.data.roster.Group
;
import
com.xabber.android.data.roster.Group
;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.android.data.roster.ShowOfflineMode
;
import
com.xabber.android.data.roster.ShowOfflineMode
;
import
com.xabber.android.ui.
Contac
tViewer
;
import
com.xabber.android.ui.
Accoun
tViewer
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -277,7 +277,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
...
@@ -277,7 +277,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
viewHolder
.
avatar
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
viewHolder
.
avatar
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
activity
.
startActivity
(
ContactViewer
.
createIntent
(
activity
,
account
,
GroupManager
.
IS_ACCOUNT
));
activity
.
startActivity
(
AccountViewer
.
createIntent
(
activity
,
account
));
}
}
});
});
...
...
app/src/main/java/com/xabber/android/ui/helper/ContextMenuHelper.java
View file @
8e10be53
...
@@ -38,11 +38,11 @@ import com.xabber.android.data.roster.AbstractContact;
...
@@ -38,11 +38,11 @@ import com.xabber.android.data.roster.AbstractContact;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.android.data.roster.GroupManager
;
import
com.xabber.android.data.roster.PresenceManager
;
import
com.xabber.android.data.roster.PresenceManager
;
import
com.xabber.android.data.roster.ShowOfflineMode
;
import
com.xabber.android.data.roster.ShowOfflineMode
;
import
com.xabber.android.ui.AccountViewer
;
import
com.xabber.android.ui.ChatViewer
;
import
com.xabber.android.ui.ChatViewer
;
import
com.xabber.android.ui.ConferenceAdd
;
import
com.xabber.android.ui.ConferenceAdd
;
import
com.xabber.android.ui.ContactAdd
;
import
com.xabber.android.ui.ContactAdd
;
import
com.xabber.android.ui.ContactEditor
;
import
com.xabber.android.ui.ContactEditor
;
import
com.xabber.android.ui.ContactViewer
;
import
com.xabber.android.ui.GroupEditor
;
import
com.xabber.android.ui.GroupEditor
;
import
com.xabber.android.ui.StatusEditor
;
import
com.xabber.android.ui.StatusEditor
;
import
com.xabber.android.ui.adapter.UpdatableAdapter
;
import
com.xabber.android.ui.adapter.UpdatableAdapter
;
...
@@ -329,7 +329,7 @@ public class ContextMenuHelper {
...
@@ -329,7 +329,7 @@ public class ContextMenuHelper {
new
MenuItem
.
OnMenuItemClickListener
()
{
new
MenuItem
.
OnMenuItemClickListener
()
{
@Override
@Override
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
public
boolean
onMenuItemClick
(
MenuItem
item
)
{
activity
.
startActivity
(
ContactViewer
.
createIntent
(
activity
,
account
,
GroupManager
.
IS_ACCOUNT
));
activity
.
startActivity
(
AccountViewer
.
createIntent
(
activity
,
account
));
return
true
;
return
true
;
}
}
});
});
...
...
app/src/main/res/menu/account_viewer.xml
0 → 100644
View file @
8e10be53
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<item
android:id=
"@+id/action_edit_account_user_info"
android:title=
"@string/edit_account_user_info"
app:showAsAction=
"never"
android:orderInCategory=
"100"
/>
</menu>
\ No newline at end of file
app/src/main/res/values/contact_editor.xml
View file @
8e10be53
...
@@ -13,4 +13,7 @@
...
@@ -13,4 +13,7 @@
<string
name=
"add_new_group"
>
Add new group…
</string>
<string
name=
"add_new_group"
>
Add new group…
</string>
<string
name=
"accept_contact"
>
Authorize
</string>
<string
name=
"accept_contact"
>
Authorize
</string>
<string
name=
"decline_contact"
>
Discard
</string>
<string
name=
"decline_contact"
>
Discard
</string>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/contact_viewer.xml
View file @
8e10be53
...
@@ -48,4 +48,5 @@
...
@@ -48,4 +48,5 @@
<string
name=
"edit_alias"
>
Edit alias
</string>
<string
name=
"edit_alias"
>
Edit alias
</string>
<string
name=
"edit_contact_groups"
>
Edit groups
</string>
<string
name=
"edit_contact_groups"
>
Edit groups
</string>
<string
name=
"remove_contact"
>
Remove contact
</string>
<string
name=
"remove_contact"
>
Remove contact
</string>
<string
name=
"edit_account_user_info"
>
Edit user info
</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