diff options
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui')
3 files changed, 1 insertions, 128 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/CryptoConsumersActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/CryptoConsumersActivity.java deleted file mode 100644 index 59eaa063f..000000000 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/CryptoConsumersActivity.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.sufficientlysecure.keychain.ui; - -import org.sufficientlysecure.keychain.R; - -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.view.MenuItem; - -import android.content.Intent; -import android.os.Bundle; - -public class CryptoConsumersActivity extends SherlockFragmentActivity { - private ActionBar mActionBar; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - mActionBar = getSupportActionBar(); - - setContentView(R.layout.crypto_consumers_activity); - - mActionBar.setDisplayShowTitleEnabled(true); - mActionBar.setDisplayHomeAsUpEnabled(true); - } - - /** - * Menu Options - */ - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - // app icon in Action Bar clicked; go home - Intent intent = new Intent(this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - return true; - default: - return super.onOptionsItemSelected(item); - } - } -} diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/CryptoConsumersFragment.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/CryptoConsumersFragment.java deleted file mode 100644 index 8ecc5ced1..000000000 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/CryptoConsumersFragment.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.sufficientlysecure.keychain.ui; - -import org.sufficientlysecure.keychain.provider.KeychainContract.CryptoConsumers; -import org.sufficientlysecure.keychain.util.Log; - -import com.actionbarsherlock.app.SherlockListFragment; -import android.database.Cursor; -import android.net.Uri; -import android.os.Bundle; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.CursorLoader; -import android.support.v4.content.Loader; -import android.support.v4.widget.SimpleCursorAdapter; - -import android.view.View; -import android.widget.ListView; - -public class CryptoConsumersFragment extends SherlockListFragment implements - LoaderManager.LoaderCallbacks<Cursor> { - - // This is the Adapter being used to display the list's data. - SimpleCursorAdapter mAdapter; - - // If non-null, this is the current filter the user has provided. - String mCurFilter; - - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - - // Give some text to display if there is no data. In a real - // application this would come from a resource. - setEmptyText("TODO no crypto consumers"); - - // We have a menu item to show in action bar. - setHasOptionsMenu(true); - - // Create an empty adapter we will use to display the loaded data. - mAdapter = new SimpleCursorAdapter(getActivity(), android.R.layout.simple_list_item_2, - null, new String[] { CryptoConsumers.PACKAGE_NAME, CryptoConsumers.PACKAGE_NAME }, - new int[] { android.R.id.text1, android.R.id.text2 }, 0); - setListAdapter(mAdapter); - - // Prepare the loader. Either re-connect with an existing one, - // or start a new one. - getLoaderManager().initLoader(0, null, this); - } - - @Override - public void onListItemClick(ListView l, View v, int position, long id) { - // Insert desired behavior here. - Log.i("FragmentComplexList", "Item clicked: " + id); - } - - // These are the Contacts rows that we will retrieve. - static final String[] CONSUMERS_SUMMARY_PROJECTION = new String[] { CryptoConsumers._ID, - CryptoConsumers.PACKAGE_NAME }; - - public Loader<Cursor> onCreateLoader(int id, Bundle args) { - // This is called when a new Loader needs to be created. This - // sample only has one Loader, so we don't care about the ID. - // First, pick the base URI to use depending on whether we are - // currently filtering. - Uri baseUri = CryptoConsumers.CONTENT_URI; - - // Now create and return a CursorLoader that will take care of - // creating a Cursor for the data being displayed. - return new CursorLoader(getActivity(), baseUri, CONSUMERS_SUMMARY_PROJECTION, null, null, - CryptoConsumers.PACKAGE_NAME + " COLLATE LOCALIZED ASC"); - } - - public void onLoadFinished(Loader<Cursor> loader, Cursor data) { - // Swap the new cursor in. (The framework will take care of closing the - // old cursor once we return.) - mAdapter.swapCursor(data); - } - - public void onLoaderReset(Loader<Cursor> loader) { - // This is called when the last Cursor provided to onLoadFinished() - // above is about to be closed. We need to make sure we are no - // longer using it. - mAdapter.swapCursor(null); - } - -}
\ No newline at end of file diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/MainActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/MainActivity.java index a108b3db4..434db7a29 100644 --- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/MainActivity.java +++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/MainActivity.java @@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.remote_api.CryptoConsumersActivity; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockActivity; |