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,6 +162,10 @@ public class StatusEditor extends ManagedListActivity implements ...@@ -162,6 +162,10 @@ 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_change_status:
changeStatus();
return true;
case R.id.action_delete_status_message: case R.id.action_delete_status_message:
AccountManager.getInstance().clearSavedStatuses(); AccountManager.getInstance().clearSavedStatuses();
adapter.onChange(); adapter.onChange();
...@@ -212,15 +216,19 @@ public class StatusEditor extends ManagedListActivity implements ...@@ -212,15 +216,19 @@ 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:
changeStatus();
break;
default:
break;
}
}
private void changeStatus() {
StatusMode statusMode = (StatusMode) statusModeView StatusMode statusMode = (StatusMode) statusModeView
.getSelectedItem(); .getSelectedItem();
String statusText = statusTextView.getText().toString(); String statusText = statusTextView.getText().toString();
setStatus(statusMode, statusText); setStatus(statusMode, statusText);
finish(); finish();
break;
default:
break;
}
} }
@Override @Override
......
<?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