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
9a91549a
Commit
9a91549a
authored
Mar 18, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ContactViewer: options menu with edit contact option.
parent
07aa56b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
ContactViewer.java
app/src/main/java/com/xabber/android/ui/ContactViewer.java
+23
-0
edit_contact.xml
app/src/main/res/menu/edit_contact.xml
+10
-0
No files found.
app/src/main/java/com/xabber/android/ui/ContactViewer.java
View file @
9a91549a
...
...
@@ -18,6 +18,9 @@ import android.content.Context;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.view.Menu
;
import
android.view.MenuInflater
;
import
android.view.MenuItem
;
import
android.view.View
;
import
com.xabber.android.data.Application
;
...
...
@@ -220,6 +223,26 @@ public class ContactViewer extends ManagedActivity implements
contactViewerFragment
.
updateVCard
(
vCard
);
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
MenuInflater
inflater
=
getMenuInflater
();
inflater
.
inflate
(
R
.
menu
.
edit_contact
,
menu
);
return
true
;
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_edit_contact
:
startActivity
(
ContactEditor
.
createIntent
(
this
,
account
,
bareAddress
));
return
true
;
default
:
return
super
.
onOptionsItemSelected
(
item
);
}
}
private
ContactViewerFragment
getFragment
()
{
return
(
ContactViewerFragment
)
getFragmentManager
()
.
findFragmentById
(
R
.
id
.
scrollable_container
);
...
...
app/src/main/res/menu/edit_contact.xml
0 → 100644
View file @
9a91549a
<?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_contact"
android:title=
"@string/contact_editor"
app:showAsAction=
"always"
android:orderInCategory=
"100"
android:icon=
"@drawable/ic_create_white_24dp"
/>
</menu>
\ 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