mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Clean up identity key view activity
This commit is contained in:
parent
95eb62190a
commit
8c1ca6c9e0
@ -118,7 +118,6 @@
|
|||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".ViewIdentityActivity"
|
<activity android:name=".ViewIdentityActivity"
|
||||||
android:theme="@style/Theme.Sherlock.Light.Dialog"
|
|
||||||
android:label="@string/AndroidManifest__public_identity_key"
|
android:label="@string/AndroidManifest__public_identity_key"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
@ -135,12 +134,6 @@
|
|||||||
android:label="@string/AndroidManifest__verify_identity"
|
android:label="@string/AndroidManifest__verify_identity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".SaveIdentityActivity"
|
|
||||||
android:theme="@style/Theme.Sherlock.Light.Dialog"
|
|
||||||
android:label="@string/AndroidManifest__save_identity"
|
|
||||||
android:windowSoftInputMode="stateVisible"
|
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
|
||||||
|
|
||||||
<activity android:name=".ReviewIdentitiesActivity"
|
<activity android:name=".ReviewIdentitiesActivity"
|
||||||
android:label="@string/AndroidManifest__manage_identity_keys"
|
android:label="@string/AndroidManifest__manage_identity_keys"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
@ -153,11 +146,6 @@
|
|||||||
<activity android:name=".ApplicationPreferencesActivity"
|
<activity android:name=".ApplicationPreferencesActivity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".VerifyImportedIdentityActivity"
|
|
||||||
android:theme="@style/Theme.Sherlock.Light.Dialog"
|
|
||||||
android:label="@string/AndroidManifest__verify_imported_identity"
|
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
|
||||||
|
|
||||||
<activity android:name=".RegistrationActivity"
|
<activity android:name=".RegistrationActivity"
|
||||||
android:windowSoftInputMode="stateUnchanged"
|
android:windowSoftInputMode="stateUnchanged"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
@ -1,51 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
|
<LinearLayout android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="16dip"
|
android:layout_marginLeft="16dip"
|
||||||
android:layout_marginRight="16dip">
|
android:layout_marginRight="16dip"
|
||||||
<TableLayout
|
android:layout_gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:shrinkColumns="1">
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
<TextView
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:text="@string/view_identity_activity__identity"
|
|
||||||
android:layout_marginRight="7dip" />
|
|
||||||
<TextView
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:id="@+id/identity_fingerprint"
|
android:id="@+id/identity_fingerprint"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:padding="3dip" />
|
android:padding="7dip" />
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
<LinearLayout android:orientation="horizontal"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_span="2">
|
|
||||||
|
|
||||||
<Button android:id="@+id/compare_button"
|
|
||||||
android:layout_margin="10dip"
|
|
||||||
android:padding="5dip"
|
|
||||||
android:layout_width="100dip"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/view_identity_activity__qr_code" />
|
|
||||||
|
|
||||||
<Button android:id="@+id/ok_button"
|
|
||||||
android:layout_margin="10dip"
|
|
||||||
android:padding="5dip"
|
|
||||||
android:layout_width="100dip"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@android:string/ok"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
</TableLayout>
|
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -35,6 +35,7 @@
|
|||||||
<string name="ApplicationPreferencesActivity_delete_all_old_messages_now">Delete all old messages now?</string>
|
<string name="ApplicationPreferencesActivity_delete_all_old_messages_now">Delete all old messages now?</string>
|
||||||
<string name="ApplicationPreferencesActivity_are_you_sure_you_would_like_to_immediately_trim_all_conversation_threads_to_the_s_most_recent_messages">Are you sure you would like to immediately trim all conversation threads to the %s most recent messages?</string>
|
<string name="ApplicationPreferencesActivity_are_you_sure_you_would_like_to_immediately_trim_all_conversation_threads_to_the_s_most_recent_messages">Are you sure you would like to immediately trim all conversation threads to the %s most recent messages?</string>
|
||||||
<string name="ApplicationPreferencesActivity_delete">Delete</string>
|
<string name="ApplicationPreferencesActivity_delete">Delete</string>
|
||||||
|
<string name="ApplicationPreferencesActivity_my">My</string>
|
||||||
|
|
||||||
<!-- AttachmentTypeSelectorAdapter -->
|
<!-- AttachmentTypeSelectorAdapter -->
|
||||||
|
|
||||||
@ -213,6 +214,7 @@
|
|||||||
<string name="ViewIdentityActivity_not_verified_exclamation">NOT Verified!</string>
|
<string name="ViewIdentityActivity_not_verified_exclamation">NOT Verified!</string>
|
||||||
<string name="ViewIdentityActivity_the_scanned_key_matches_exclamation">The scanned key matches!</string>
|
<string name="ViewIdentityActivity_the_scanned_key_matches_exclamation">The scanned key matches!</string>
|
||||||
<string name="ViewIdentityActivity_verified_exclamation">Verified!</string>
|
<string name="ViewIdentityActivity_verified_exclamation">Verified!</string>
|
||||||
|
<string name="ViewIdentityActivity_identity_fingerprint">Identity Fingerprint</string>
|
||||||
|
|
||||||
<!-- KeyExchangeInitiator -->
|
<!-- KeyExchangeInitiator -->
|
||||||
<string name="KeyExchangeInitiator_initiate_despite_existing_request_question">Initiate Despite Existing Request?</string>
|
<string name="KeyExchangeInitiator_initiate_despite_existing_request_question">Initiate Despite Existing Request?</string>
|
||||||
|
@ -118,7 +118,7 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
MemoryCleaner.clean((MasterSecret)getIntent().getParcelableExtra("master_secret"));
|
MemoryCleaner.clean((MasterSecret) getIntent().getParcelableExtra("master_secret"));
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
|
|||||||
preference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
preference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreferenceChange(Preference pref, Object newValue) {
|
public boolean onPreferenceChange(Preference pref, Object newValue) {
|
||||||
preference.setSummary(newValue == null ? "Not set" : ((String)newValue));
|
preference.setSummary(newValue == null ? "Not set" : ((String) newValue));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -218,6 +218,8 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredSherlockPr
|
|||||||
public boolean onPreferenceClick(Preference preference) {
|
public boolean onPreferenceClick(Preference preference) {
|
||||||
Intent viewIdentityIntent = new Intent(ApplicationPreferencesActivity.this, ViewIdentityActivity.class);
|
Intent viewIdentityIntent = new Intent(ApplicationPreferencesActivity.this, ViewIdentityActivity.class);
|
||||||
viewIdentityIntent.putExtra("identity_key", IdentityKeyUtil.getIdentityKey(ApplicationPreferencesActivity.this));
|
viewIdentityIntent.putExtra("identity_key", IdentityKeyUtil.getIdentityKey(ApplicationPreferencesActivity.this));
|
||||||
|
viewIdentityIntent.putExtra("title", getString(R.string.ApplicationPreferencesActivity_my) + " " +
|
||||||
|
getString(R.string.ViewIdentityActivity_identity_fingerprint));
|
||||||
startActivity(viewIdentityIntent);
|
startActivity(viewIdentityIntent);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -92,6 +92,10 @@ public class IdentityKeyView extends RelativeLayout
|
|||||||
return this.identityKey;
|
return this.identityKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Recipient getRecipient() {
|
||||||
|
return this.recipients.getPrimaryRecipient();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isBadgeEnabled() {
|
private boolean isBadgeEnabled() {
|
||||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
|
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,8 @@ public class ReviewIdentitiesFragment extends SherlockListFragment
|
|||||||
public void onListItemClick(ListView listView, View view, int position, long id) {
|
public void onListItemClick(ListView listView, View view, int position, long id) {
|
||||||
Intent viewIntent = new Intent(getActivity(), ViewIdentityActivity.class);
|
Intent viewIntent = new Intent(getActivity(), ViewIdentityActivity.class);
|
||||||
viewIntent.putExtra("identity_key", ((IdentityKeyView)view).getIdentityKey());
|
viewIntent.putExtra("identity_key", ((IdentityKeyView)view).getIdentityKey());
|
||||||
|
viewIntent.putExtra("title", ((IdentityKeyView)view).getRecipient().toShortString() + " " +
|
||||||
|
getString(R.string.ViewIdentityActivity_identity_fingerprint));
|
||||||
startActivity(viewIntent);
|
startActivity(viewIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
package org.thoughtcrime.securesms;
|
package org.thoughtcrime.securesms;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.crypto.IdentityKey;
|
import org.thoughtcrime.securesms.crypto.IdentityKey;
|
||||||
@ -31,17 +29,15 @@ import org.thoughtcrime.securesms.crypto.IdentityKey;
|
|||||||
public class ViewIdentityActivity extends KeyScanningActivity {
|
public class ViewIdentityActivity extends KeyScanningActivity {
|
||||||
|
|
||||||
private TextView identityFingerprint;
|
private TextView identityFingerprint;
|
||||||
private Button compareButton;
|
|
||||||
private Button okButton;
|
|
||||||
private IdentityKey identityKey;
|
private IdentityKey identityKey;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle state) {
|
public void onCreate(Bundle state) {
|
||||||
super.onCreate(state);
|
super.onCreate(state);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
setContentView(R.layout.view_identity_activity);
|
setContentView(R.layout.view_identity_activity);
|
||||||
|
|
||||||
initializeResources();
|
initializeResources();
|
||||||
initializeListeners();
|
|
||||||
initializeFingerprint();
|
initializeFingerprint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,27 +49,13 @@ public class ViewIdentityActivity extends KeyScanningActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeListeners() {
|
|
||||||
this.okButton.setOnClickListener(new OkButtonListener());
|
|
||||||
this.compareButton.setOnClickListener(new CompareListener());
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initializeResources() {
|
private void initializeResources() {
|
||||||
this.identityKey = (IdentityKey)getIntent().getParcelableExtra("identity_key");
|
this.identityKey = (IdentityKey)getIntent().getParcelableExtra("identity_key");
|
||||||
this.identityFingerprint = (TextView)findViewById(R.id.identity_fingerprint);
|
this.identityFingerprint = (TextView)findViewById(R.id.identity_fingerprint);
|
||||||
this.okButton = (Button)findViewById(R.id.ok_button);
|
String title = getIntent().getStringExtra("title");
|
||||||
this.compareButton = (Button)findViewById(R.id.compare_button);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class CompareListener implements View.OnClickListener {
|
if (title != null) {
|
||||||
public void onClick(View v) {
|
getSupportActionBar().setTitle(getIntent().getStringExtra("title"));
|
||||||
initiateDisplay();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class OkButtonListener implements View.OnClickListener {
|
|
||||||
public void onClick(View v) {
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user