Merge pull request #1630 from mcginty/remove-keys-list

remove ReviewIdentitiesActivity
pull/1/head
Moxie Marlinspike 10 years ago
commit 358c923891

@ -172,11 +172,7 @@
android:label="@string/AndroidManifest__verify_identity"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
<activity android:name=".ReviewIdentitiesActivity"
android:label="@string/AndroidManifest__manage_identity_keys"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
<activity android:name=".ReceiveKeyActivity"
<activity android:name=".ReceiveKeyActivity"
android:label="@string/AndroidManifest__complete_key_exchange"
android:theme="@style/TextSecure.Light.Dialog"
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment android:id="@+id/fragment_content"
android:name="org.thoughtcrime.securesms.ReviewIdentitiesFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
android:scrollbarStyle="insideOverlay"
android:fadingEdgeLength="16dip" />
<TextView android:id="@id/android:empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/review_identities__you_don_t_currently_have_any_identity_keys_in_your_trust_database"
android:textAppearance="?android:attr/textAppearanceMedium"
android:padding="20dip" />
</LinearLayout>

@ -128,24 +128,20 @@
<string-array name="navigation_drawer_text">
<item>@string/arrays__import_export</item>
<item>@string/arrays__my_identity_key</item>
<item>@string/arrays__contact_keys</item>
</string-array>
<string-array name="navigation_drawer_values" translatable="false">
<item>import_export</item>
<item>my_identity_key</item>
<item>contact_identity_keys</item>
</string-array>
<string-array name="navigation_drawer_icons_light">
<item>@drawable/import_export_light</item>
<item>@drawable/my_identity_light</item>
<item>@drawable/contacts_identities_light</item>
</string-array>
<string-array name="navigation_drawer_icons_dark">
<item>@drawable/import_export_dark</item>
<item>@drawable/my_identity_dark</item>
<item>@drawable/contacts_identities_dark</item>
</string-array>
</resources>

@ -674,7 +674,6 @@
<!-- arrays.xml -->
<string name="arrays__import_export">Import / Export</string>
<string name="arrays__my_identity_key">My identity key</string>
<string name="arrays__contact_keys">Contact keys</string>
<!-- preferences.xml -->
<string name="preferences__general">General</string>

@ -128,9 +128,6 @@ public class ConversationListActivity extends PassphraseRequiredSherlockFragment
} else if (selected.equals("my_identity_key")) {
intent = new Intent(this, ViewLocalIdentityActivity.class);
intent.putExtra("master_secret", masterSecret);
} else if (selected.equals("contact_identity_keys")) {
intent = new Intent(this, ReviewIdentitiesActivity.class);
intent.putExtra("master_secret", masterSecret);
} else {
return;
}

@ -1,57 +0,0 @@
/**
* Copyright (C) 2011 Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.thoughtcrime.securesms;
import android.os.Bundle;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;
import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.DynamicTheme;
public class ReviewIdentitiesActivity extends SherlockFragmentActivity {
private final DynamicTheme dynamicTheme = new DynamicTheme();
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
@Override
public void onCreate(Bundle bundle) {
dynamicTheme.onCreate(this);
dynamicLanguage.onCreate(this);
super.onCreate(bundle);
setContentView(R.layout.review_identities);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
@Override
public void onResume() {
super.onResume();
dynamicTheme.onResume(this);
dynamicLanguage.onResume(this);
getSupportActionBar().setTitle(R.string.AndroidManifest__manage_identity_keys);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: finish(); return true;
}
return false;
}
}

@ -1,92 +0,0 @@
package org.thoughtcrime.securesms;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.ListView;
import com.actionbarsherlock.app.SherlockListFragment;
import org.whispersystems.textsecure.crypto.MasterSecret;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.IdentityDatabase;
import org.thoughtcrime.securesms.database.loaders.IdentityLoader;
public class ReviewIdentitiesFragment extends SherlockListFragment
implements LoaderManager.LoaderCallbacks<Cursor>
{
private MasterSecret masterSecret;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
return inflater.inflate(R.layout.review_identities_fragment, container, false);
}
@Override
public void onActivityCreated(Bundle bundle) {
super.onActivityCreated(bundle);
this.masterSecret = getSherlockActivity().getIntent().getParcelableExtra("master_secret");
initializeListAdapter();
getLoaderManager().initLoader(0, null, this);
}
@Override
public void onListItemClick(ListView listView, View view, int position, long id) {
Intent viewIntent = new Intent(getActivity(), ViewIdentityActivity.class);
viewIntent.putExtra("identity_key", ((IdentityKeyView)view).getIdentityKey());
viewIntent.putExtra("title", ((IdentityKeyView)view).getRecipient().toShortString() + " " +
getString(R.string.ViewIdentityActivity_identity_fingerprint));
startActivity(viewIntent);
}
private void initializeListAdapter() {
this.setListAdapter(new IdentitiesListAdapter(getActivity(), null, masterSecret));
getLoaderManager().restartLoader(0, null, this);
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
return new IdentityLoader(getActivity());
}
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
((CursorAdapter)getListAdapter()).changeCursor(cursor);
}
@Override
public void onLoaderReset(Loader<Cursor> loader) {
((CursorAdapter)getListAdapter()).changeCursor(null);
}
private class IdentitiesListAdapter extends CursorAdapter {
private final MasterSecret masterSecret;
private final LayoutInflater inflater;
public IdentitiesListAdapter(Context context, Cursor cursor, MasterSecret masterSecret) {
super(context, cursor);
this.masterSecret = masterSecret;
this.inflater = LayoutInflater.from(context);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
IdentityDatabase.Reader reader = DatabaseFactory.getIdentityDatabase(context)
.readerFor(masterSecret, cursor);
((IdentityKeyView)view).set(reader.getCurrent());
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
return inflater.inflate(R.layout.identity_key_view, parent, false);
}
}
}
Loading…
Cancel
Save