Commit 6a497074 authored by Grigory Fedorov's avatar Grigory Fedorov

StatusEditor menu changed - change status option added, with icon.

parent f4ebed12
...@@ -152,7 +152,7 @@ public class StatusEditor extends ManagedListActivity implements ...@@ -152,7 +152,7 @@ public class StatusEditor extends ManagedListActivity implements
@Override @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu); super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.delete_status_message, menu); getMenuInflater().inflate(R.menu.status, menu);
return true; return true;
...@@ -162,9 +162,13 @@ public class StatusEditor extends ManagedListActivity implements ...@@ -162,9 +162,13 @@ public class StatusEditor extends ManagedListActivity implements
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item); super.onOptionsItemSelected(item);
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.action_delete_status_message: case R.id.action_change_status:
AccountManager.getInstance().clearSavedStatuses(); changeStatus();
adapter.onChange(); return true;
case R.id.action_delete_status_message:
AccountManager.getInstance().clearSavedStatuses();
adapter.onChange();
return true; return true;
} }
return false; return false;
...@@ -212,18 +216,22 @@ public class StatusEditor extends ManagedListActivity implements ...@@ -212,18 +216,22 @@ public class StatusEditor extends ManagedListActivity implements
public void onClick(View v) { public void onClick(View v) {
switch (v.getId()) { switch (v.getId()) {
case R.id.ok: case R.id.ok:
StatusMode statusMode = (StatusMode) statusModeView changeStatus();
.getSelectedItem();
String statusText = statusTextView.getText().toString();
setStatus(statusMode, statusText);
finish();
break; break;
default: default:
break; break;
} }
} }
@Override private void changeStatus() {
StatusMode statusMode = (StatusMode) statusModeView
.getSelectedItem();
String statusText = statusTextView.getText().toString();
setStatus(statusMode, statusText);
finish();
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, public void onItemClick(AdapterView<?> parent, View view, int position,
long id) { long id) {
SavedStatus savedStatus = (SavedStatus) parent.getAdapter().getItem( SavedStatus savedStatus = (SavedStatus) parent.getAdapter().getItem(
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_change_status"
android:title="@string/status_editor"
app:showAsAction="ifRoom"
android:icon="@drawable/ic_done_white_24dp"
android:orderInCategory="90"
/>
<item android:id="@+id/action_delete_status_message" <item android:id="@+id/action_delete_status_message"
android:title="@string/clear_statuses" android:title="@string/clear_statuses"
app:showAsAction="ifRoom" app:showAsAction="never"
android:icon="@drawable/ic_delete_white_24dp" android:icon="@drawable/ic_delete_white_24dp"
android:orderInCategory="100" android:orderInCategory="100"
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment