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
f11c900f
Commit
f11c900f
authored
Jan 21, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Options menu for StatusEditor rewritten using xml resource. Icon added.
parent
959004a6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
25 deletions
+32
-25
StatusEditor.java
app/src/main/java/com/xabber/android/ui/StatusEditor.java
+22
-25
ic_delete_white_24dp.png
app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png
+0
-0
ic_delete_white_24dp.png
app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png
+0
-0
ic_delete_white_24dp.png
app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png
+0
-0
ic_delete_white_24dp.png
app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png
+0
-0
ic_delete_white_24dp.png
app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png
+0
-0
delete_status_message.xml
app/src/main/res/menu/delete_status_message.xml
+10
-0
No files found.
app/src/main/java/com/xabber/android/ui/StatusEditor.java
View file @
f11c900f
...
...
@@ -26,7 +26,6 @@ import android.view.View;
import
android.widget.AdapterView
;
import
android.widget.AdapterView.AdapterContextMenuInfo
;
import
android.widget.AdapterView.OnItemClickListener
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.ListView
;
import
android.widget.Spinner
;
...
...
@@ -49,9 +48,7 @@ public class StatusEditor extends ManagedListActivity implements
private
static
final
String
SAVED_TEXT
=
"com.xabber.android.ui.StatusEditor.SAVED_TEXT"
;
private
static
final
String
SAVED_MODE
=
"com.xabber.android.ui.StatusEditor.SAVED_MODE"
;
static
final
public
int
OPTION_MENU_CLEAR_STATUSES_ID
=
1
;
static
final
public
int
CONTEXT_MENU_SELECT_STATUS_ID
=
10
;
static
final
public
int
CONTEXT_MENU_SELECT_STATUS_ID
=
10
;
static
final
public
int
CONTEXT_MENU_EDIT_STATUS_ID
=
11
;
static
final
public
int
CONTEXT_MENU_REMOVE_STATUS_ID
=
12
;
...
...
@@ -95,7 +92,7 @@ public class StatusEditor extends ManagedListActivity implements
statusTextView
=
(
EditText
)
header
.
findViewById
(
R
.
id
.
status_text
);
statusModeView
=
(
Spinner
)
header
.
findViewById
(
R
.
id
.
status_mode
);
statusModeView
.
setAdapter
(
new
StatusModeAdapter
(
this
));
((
Button
)
findViewById
(
R
.
id
.
ok
)
).
setOnClickListener
(
this
);
findViewById
(
R
.
id
.
ok
).
setOnClickListener
(
this
);
StatusMode
statusMode
;
String
statusText
;
...
...
@@ -152,26 +149,26 @@ public class StatusEditor extends ManagedListActivity implements
adapter
.
onChange
();
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
super
.
onCreateOptionsMenu
(
menu
);
menu
.
add
(
0
,
OPTION_MENU_CLEAR_STATUSES_ID
,
0
,
getResources
().
getText
(
R
.
string
.
clear_statuses
)).
setIcon
(
android
.
R
.
drawable
.
ic_menu_close_clear_cancel
);
return
true
;
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
super
.
onOptionsItemSelected
(
item
);
switch
(
item
.
getItemId
())
{
case
OPTION_MENU_CLEAR_STATUSES_ID
:
AccountManager
.
getInstance
().
clearSavedStatuses
();
adapter
.
onChange
();
return
true
;
}
return
false
;
}
@Override
public
boolean
onCreateOptionsMenu
(
Menu
menu
)
{
super
.
onCreateOptionsMenu
(
menu
);
getMenuInflater
().
inflate
(
R
.
menu
.
delete_status_message
,
menu
);
return
true
;
}
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
super
.
onOptionsItemSelected
(
item
);
switch
(
item
.
getItemId
())
{
case
R
.
id
.
action_delete_status_message
:
AccountManager
.
getInstance
().
clearSavedStatuses
();
adapter
.
onChange
();
return
true
;
}
return
false
;
}
@Override
public
void
onCreateContextMenu
(
ContextMenu
menu
,
View
v
,
...
...
app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png
0 → 100644
View file @
f11c900f
246 Bytes
app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png
0 → 100644
View file @
f11c900f
197 Bytes
app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png
0 → 100644
View file @
f11c900f
270 Bytes
app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png
0 → 100644
View file @
f11c900f
338 Bytes
app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png
0 → 100644
View file @
f11c900f
397 Bytes
app/src/main/res/menu/delete_status_message.xml
0 → 100644
View file @
f11c900f
<?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_delete_status_message"
android:title=
"@string/clear_statuses"
app:showAsAction=
"ifRoom"
android:icon=
"@drawable/ic_delete_white_24dp"
android:orderInCategory=
"100"
/>
</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