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
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getMenuInflater().inflate(R.menu.delete_status_message, menu);
getMenuInflater().inflate(R.menu.status, menu);
return true;
......@@ -162,9 +162,13 @@ public class StatusEditor extends ManagedListActivity implements
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case R.id.action_delete_status_message:
AccountManager.getInstance().clearSavedStatuses();
adapter.onChange();
case R.id.action_change_status:
changeStatus();
return true;
case R.id.action_delete_status_message:
AccountManager.getInstance().clearSavedStatuses();
adapter.onChange();
return true;
}
return false;
......@@ -212,18 +216,22 @@ public class StatusEditor extends ManagedListActivity implements
public void onClick(View v) {
switch (v.getId()) {
case R.id.ok:
StatusMode statusMode = (StatusMode) statusModeView
.getSelectedItem();
String statusText = statusTextView.getText().toString();
setStatus(statusMode, statusText);
finish();
changeStatus();
break;
default:
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,
long id) {
SavedStatus savedStatus = (SavedStatus) parent.getAdapter().getItem(
......
<?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_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"
android:title="@string/clear_statuses"
app:showAsAction="ifRoom"
app:showAsAction="never"
android:icon="@drawable/ic_delete_white_24dp"
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