diff options
author | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-06-16 14:36:18 +0530 |
---|---|---|
committer | Adithya Abraham Philip <adithyaphilip@gmail.com> | 2015-07-03 20:46:15 +0530 |
commit | 2402c6d3c72b19b8eded017ff3fbeb83c30ae0a8 (patch) | |
tree | 3b6e9eb10f21be97e94582616e309c230ae5f327 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | f6d0f88ac973328b3b7a9d426214beb76efefb3f (diff) | |
download | open-keychain-2402c6d3c72b19b8eded017ff3fbeb83c30ae0a8.tar.gz open-keychain-2402c6d3c72b19b8eded017ff3fbeb83c30ae0a8.tar.bz2 open-keychain-2402c6d3c72b19b8eded017ff3fbeb83c30ae0a8.zip |
ensuring code style is preserved
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
11 files changed, 49 insertions, 44 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportFragment.java index 4d85255ca..39dea6f0d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateYubiKeyImportFragment.java @@ -131,7 +131,7 @@ public class CreateYubiKeyImportFragment } }; - if(OrbotHelper.isOrbotInRequiredState(R.string.orbot_ignore_tor, ignoreTor, proxyPrefs, + if (OrbotHelper.isOrbotInRequiredState(R.string.orbot_ignore_tor, ignoreTor, proxyPrefs, getActivity())) { importKey(proxyPrefs.parcelableProxy); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java index b61e94c6d..e2b90056d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysActivity.java @@ -46,7 +46,6 @@ import org.sufficientlysecure.keychain.util.Preferences; import org.sufficientlysecure.keychain.util.orbot.OrbotHelper; import java.io.IOException; -import java.net.Proxy; import java.util.ArrayList; public class ImportKeysActivity extends BaseNfcActivity @@ -322,7 +321,8 @@ public class ImportKeysActivity extends BaseNfcActivity * specified in user preferences */ - private void startCloudFragment(Bundle savedInstanceState, String query, boolean disableQueryEdit, String keyserver) { + private void startCloudFragment(Bundle savedInstanceState, String query, boolean disableQueryEdit, String + keyserver) { // However, if we're being restored from a previous state, // then we don't need to do anything and should return or else // we could end up with overlapping fragments. diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 76ae147a2..da181711e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -51,6 +51,8 @@ import android.widget.TextView; import com.getbase.floatingactionbutton.FloatingActionButton; import com.getbase.floatingactionbutton.FloatingActionsMenu; +import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter; +import se.emilsjolander.stickylistheaders.StickyListHeadersListView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; @@ -81,10 +83,8 @@ import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; -import org.sufficientlysecure.keychain.util.orbot.OrbotHelper; -import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter; -import se.emilsjolander.stickylistheaders.StickyListHeadersListView; - +/** + * Public key list with sticky list headers. It does _not_ exte /** * Public key list with sticky list headers. It does _not_ extend ListFragment because it uses * StickyListHeaders library which does not extend upon ListView. @@ -472,15 +472,13 @@ public class KeyListFragment extends LoaderFragment return true; case R.id.menu_key_list_export: - mExportHelper.showExportKeysDialog(null, Constants.Path.APP_DIR_FILE, true); + ); return true; - case R.id.menu_key_list_update_all_keys: - updateAllKeys(); - return true; + case R.id.menu_key_list_debug +_cons return true; - case R.id.menu_key_list_debug_cons: - consolidate(); + consolidate(case R.id.menu_key_list_debug_cons:); return true; case R.id.menu_key_list_debug_read: diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java index 6605995eb..1b8d71d23 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SettingsActivity.java @@ -245,7 +245,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { } public Preference automaticallyFindPreference(String key) { - if(mFragment != null) { + if (mFragment != null) { return mFragment.findPreference(key); } else { return mActivity.findPreference(key); @@ -259,8 +259,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { Preferences.setPreferenceManagerFileAndMode(mFragment.getPreferenceManager()); // Load the preferences from an XML resource mFragment.addPreferencesFromResource(R.xml.proxy_prefs); - } - else { + } else { Preferences.setPreferenceManagerFileAndMode(mActivity.getPreferenceManager()); // Load the preferences from an XML resource mActivity.addPreferencesFromResource(R.xml.proxy_prefs); @@ -285,7 +284,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Activity activity = mFragment != null ? mFragment.getActivity() : mActivity; - if ((Boolean)newValue) { + if ((Boolean) newValue) { boolean installed = OrbotHelper.isOrbotInstalled(activity); if (!installed) { Log.d(Constants.TAG, "Prompting to install Tor"); @@ -298,8 +297,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { // let the enable tor box be checked return true; } - } - else { + } else { // we're unchecking Tor, so enable other proxy enableNormalProxyPrefs(); return true; @@ -350,7 +348,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { Activity activity = mFragment != null ? mFragment.getActivity() : mActivity; try { int port = Integer.parseInt((String) newValue); - if(port < 0 || port > 65535) { + if (port < 0 || port > 65535) { Notify.create( activity, R.string.pref_proxy_port_err_invalid, diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index da00748e4..ce8935bce 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -53,7 +53,6 @@ import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.getbase.floatingactionbutton.FloatingActionButton; -import edu.cmu.cylab.starslinger.exchange.ExchangeActivity; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.keyimport.ParcelableKeyRing; @@ -81,6 +80,13 @@ import org.sufficientlysecure.keychain.ui.util.Notify; import org.sufficientlysecure.keychain.ui.util.Notify.ActionListener; import org.sufficientlysecure.keychain.ui.util.Notify.Style; import org.sufficientlysecure.keychain.ui.util.QrCodeUtils; +import org.sufficientlysecure.keychain.util.ContactHelper; +import org.sufficientlysecure.keychain.util.ExportHelper; +import org.sufficientlysecure.keychain.util.Log; +import org.sufficientlysecure.keychain.util.NfcHelper; +import org.sufficientlysecure.keychain.util.ParcelableProxy; +import org.sufficientlysecure.keychain.util.Preferences; +import org.sufficientlysecure.keychain.util.orbot.OrbotHelper; import java.io.IOException; import java.util.ArrayList; @@ -460,11 +466,11 @@ public class ViewKeyActivity extends BaseNfcActivity implements HashMap<String, Object> data = providerHelper.getGenericData( baseUri, - new String[] {KeychainContract.Keys.MASTER_KEY_ID, KeychainContract.KeyRings.HAS_SECRET}, - new int[] {ProviderHelper.FIELD_TYPE_INTEGER, ProviderHelper.FIELD_TYPE_INTEGER}); + new String[]{KeychainContract.Keys.MASTER_KEY_ID, KeychainContract.KeyRings.HAS_SECRET}, + new int[]{ProviderHelper.FIELD_TYPE_INTEGER, ProviderHelper.FIELD_TYPE_INTEGER}); exportHelper.showExportKeysDialog( - new long[] {(Long) data.get(KeychainContract.KeyRings.MASTER_KEY_ID)}, + new long[]{(Long) data.get(KeychainContract.KeyRings.MASTER_KEY_ID)}, Constants.Path.APP_DIR_FILE, ((Long) data.get(KeychainContract.KeyRings.HAS_SECRET) != 0) ); } catch (ProviderHelper.NotFoundException e) { @@ -488,7 +494,7 @@ public class ViewKeyActivity extends BaseNfcActivity implements // Create a new Messenger for the communication back Messenger messenger = new Messenger(returnHandler); DeleteKeyDialogFragment deleteKeyDialog = DeleteKeyDialogFragment.newInstance(messenger, - new long[] {mMasterKeyId}); + new long[]{mMasterKeyId}); deleteKeyDialog.show(getSupportFragmentManager(), "deleteKeyDialog"); } @@ -632,7 +638,7 @@ public class ViewKeyActivity extends BaseNfcActivity implements long keyId = new ProviderHelper(this) .getCachedPublicKeyRing(dataUri) .extractOrGetMasterKeyId(); - long[] encryptionKeyIds = new long[] {keyId}; + long[] encryptionKeyIds = new long[]{keyId}; Intent intent; if (text) { intent = new Intent(this, EncryptTextActivity.class); @@ -738,7 +744,7 @@ public class ViewKeyActivity extends BaseNfcActivity implements // These are the rows that we will retrieve. - static final String[] PROJECTION = new String[] { + static final String[] PROJECTION = new String[]{ KeychainContract.KeyRings._ID, KeychainContract.KeyRings.MASTER_KEY_ID, KeychainContract.KeyRings.USER_ID, @@ -826,7 +832,8 @@ public class ViewKeyActivity extends BaseNfcActivity implements AsyncTask<Long, Void, Bitmap> photoTask = new AsyncTask<Long, Void, Bitmap>() { protected Bitmap doInBackground(Long... mMasterKeyId) { - return ContactHelper.loadPhotoByMasterKeyId(getContentResolver(), mMasterKeyId[0], true); + return ContactHelper.loadPhotoByMasterKeyId(getContentResolver(), + mMasterKeyId[0], true); } protected void onPostExecute(Bitmap photo) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java index 32e8b4fc1..f6b580b01 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyTrustFragment.java @@ -55,7 +55,6 @@ import org.sufficientlysecure.keychain.util.ParcelableProxy; import org.sufficientlysecure.keychain.util.Preferences; import org.sufficientlysecure.keychain.util.orbot.OrbotHelper; -import java.net.Proxy; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; @@ -201,7 +200,8 @@ public class ViewKeyTrustFragment extends LoaderFragment implements mStartSearch.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - final Preferences.ProxyPrefs proxyPrefs = Preferences.getPreferences(getActivity()).getProxyPrefs(); + final Preferences.ProxyPrefs proxyPrefs = Preferences.getPreferences(getActivity()) + .getProxyPrefs(); Runnable ignoreTor = new Runnable() { @Override diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListCloudLoader.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListCloudLoader.java index a4f8f22e0..c7f69207c 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListCloudLoader.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysListCloudLoader.java @@ -30,7 +30,6 @@ import org.sufficientlysecure.keychain.util.Log; import org.sufficientlysecure.keychain.util.ParcelableProxy; import org.sufficientlysecure.keychain.util.Preferences; -import java.net.Proxy; import java.util.ArrayList; public class ImportKeysListCloudLoader diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddEditKeyserverDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddEditKeyserverDialogFragment.java index 056d82fd3..e5ab3a228 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddEditKeyserverDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddEditKeyserverDialogFragment.java @@ -59,14 +59,13 @@ import org.sufficientlysecure.keychain.util.TlsHelper; import java.io.IOException; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.Proxy; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import javax.net.ssl.HttpsURLConnection; import java.io.IOException; -import java.net.*; -import javax.net.ssl.HttpsURLConnection; public class AddEditKeyserverDialogFragment extends DialogFragment implements OnEditorActionListener { private static final String ARG_MESSENGER = "arg_messenger"; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/InstallDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/InstallDialogFragment.java index 01ff4715d..7b3f9ad28 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/InstallDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/InstallDialogFragment.java @@ -48,15 +48,16 @@ public class InstallDialogFragment extends DialogFragment { * Creates a dialog which prompts the user to install an application. Consists of two default buttons ("Install" * and "Cancel") and an optional third button. Callbacks are provided only for the middle button, if set. * - * @param messenger required only for callback from middle button if it has been set + * @param messenger required only for callback from middle button if it has been set * @param title - * @param message content of dialog + * @param message content of dialog * @param packageToInstall package name of application to install - * @param middleButton if not null, adds a third button to the app with a call back + * @param middleButton if not null, adds a third button to the app with a call back * @return The dialog to display */ public static InstallDialogFragment newInstance(Messenger messenger, int title, int message, - String packageToInstall, int middleButton, boolean useMiddleButton) { + String packageToInstall, int middleButton, boolean + useMiddleButton) { InstallDialogFragment frag = new InstallDialogFragment(); Bundle args = new Bundle(); args.putParcelable(ARG_MESSENGER, messenger); @@ -125,7 +126,7 @@ public class InstallDialogFragment extends DialogFragment { @Override public void onClick(DialogInterface dialog, int which) { Message msg = new Message(); - msg.what=MESSAGE_MIDDLE_CLICKED; + msg.what = MESSAGE_MIDDLE_CLICKED; try { messenger.send(msg); } catch (RemoteException e) { diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/OrbotStartDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/OrbotStartDialogFragment.java index e9092b14a..4736eddca 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/OrbotStartDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/OrbotStartDialogFragment.java @@ -25,6 +25,7 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.support.v4.app.DialogFragment; + import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.util.Log; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PreferenceInstallDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PreferenceInstallDialogFragment.java index 8236ff9d7..b9b4da83a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PreferenceInstallDialogFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/PreferenceInstallDialogFragment.java @@ -27,6 +27,7 @@ import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.app.DialogFragment; + import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.util.Log; @@ -47,15 +48,16 @@ public class PreferenceInstallDialogFragment extends DialogFragment { * Creates a dialog which prompts the user to install an application. Consists of two default buttons ("Install" * and "Cancel") and an optional third button. Callbacks are provided only for the middle button, if set. * - * @param messenger required only for callback from middle button if it has been set + * @param messenger required only for callback from middle button if it has been set * @param title - * @param message content of dialog + * @param message content of dialog * @param packageToInstall package name of application to install - * @param middleButton if not null, adds a third button to the app with a call back + * @param middleButton if not null, adds a third button to the app with a call back * @return The dialog to display */ public static PreferenceInstallDialogFragment newInstance(Messenger messenger, int title, int message, - String packageToInstall, int middleButton, boolean useMiddleButton) { + String packageToInstall, int middleButton, boolean + useMiddleButton) { PreferenceInstallDialogFragment frag = new PreferenceInstallDialogFragment(); Bundle args = new Bundle(); args.putParcelable(ARG_MESSENGER, messenger); @@ -80,7 +82,7 @@ public class PreferenceInstallDialogFragment extends DialogFragment { * @return */ public static PreferenceInstallDialogFragment newInstance(int title, int message, - String packageToInstall) { + String packageToInstall) { return newInstance(null, title, message, packageToInstall, -1, false); } @@ -125,7 +127,7 @@ public class PreferenceInstallDialogFragment extends DialogFragment { @Override public void onClick(DialogInterface dialog, int which) { Message msg = new Message(); - msg.what=MESSAGE_MIDDLE_CLICKED; + msg.what = MESSAGE_MIDDLE_CLICKED; try { messenger.send(msg); } catch (RemoteException e) { |