Clean up key/identity verification Activites.
1) Get ride of the crazy button situation. 2) Actionbar-ify and abstract out the common actions. 3) Switch to full activities from dialog themes.pull/1/head
parent
8e3b08ebda
commit
78998d0c93
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 1010 B |
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:title="Compare"
|
||||
android:id="@+id/menu_barcode"
|
||||
android:icon="@drawable/ic_menu_barcode"
|
||||
android:showAsAction="ifRoom">
|
||||
|
||||
<menu>
|
||||
<item android:title="Scan to compare"
|
||||
android:id="@+id/menu_scan"/>
|
||||
|
||||
<item android:title="Get scanned to compare"
|
||||
android:id="@+id/menu_get_scanned"/>
|
||||
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
</menu>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:title="Verified"
|
||||
android:id="@+id/menu_session_verified"
|
||||
android:icon="@drawable/ic_menu_done_holo_dark"
|
||||
android:showAsAction="ifRoom" />
|
||||
</menu>
|
@ -0,0 +1,40 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.actionbarsherlock.view.Menu;
|
||||
import com.actionbarsherlock.view.MenuInflater;
|
||||
import com.actionbarsherlock.view.MenuItem;
|
||||
|
||||
public abstract class KeyVerifyingActivity extends KeyScanningActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
|
||||
MenuInflater inflater = this.getSupportMenuInflater();
|
||||
inflater.inflate(R.menu.verify_keys, menu);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
super.onOptionsItemSelected(item);
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.menu_session_verified: handleVerified(); return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected abstract void handleVerified();
|
||||
|
||||
}
|
Loading…
Reference in New Issue