diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java | 31 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BaseActivity.java | 8 |
2 files changed, 28 insertions, 11 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java index 8f822a338..38e971f2b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppSettingsActivity.java @@ -17,6 +17,7 @@ package org.sufficientlysecure.keychain.remote.ui; +import android.app.Activity; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; @@ -59,9 +60,10 @@ public class AppSettingsActivity extends BaseActivity { new View.OnClickListener() { @Override public void onClick(View v) { - finish(); + cancel(); } }); + setTitle(null); mSettingsFragment = (AppSettingsHeaderFragment) getSupportFragmentManager().findFragmentById( R.id.api_app_settings_fragment); @@ -80,6 +82,13 @@ public class AppSettingsActivity extends BaseActivity { private void save() { mAllowedKeysFragment.saveAllowedKeys(); + setResult(Activity.RESULT_OK); + finish(); + } + + private void cancel() { + setResult(Activity.RESULT_CANCELED); + finish(); } @Override @@ -127,16 +136,16 @@ public class AppSettingsActivity extends BaseActivity { mAppSettings = new ProviderHelper(this).getApiAppSettings(appUri); mSettingsFragment.setAppSettings(mAppSettings); - String appName; - PackageManager pm = getPackageManager(); - try { - ApplicationInfo ai = pm.getApplicationInfo(mAppSettings.getPackageName(), 0); - appName = (String) pm.getApplicationLabel(ai); - } catch (PackageManager.NameNotFoundException e) { - // fallback - appName = mAppSettings.getPackageName(); - } - setTitle(appName); +// String appName; +// PackageManager pm = getPackageManager(); +// try { +// ApplicationInfo ai = pm.getApplicationInfo(mAppSettings.getPackageName(), 0); +// appName = (String) pm.getApplicationLabel(ai); +// } catch (PackageManager.NameNotFoundException e) { +// // fallback +// appName = mAppSettings.getPackageName(); +// } +// setTitle(appName); Uri accountsUri = appUri.buildUpon().appendPath(KeychainContract.PATH_ACCOUNTS).build(); Log.d(Constants.TAG, "accountsUri: " + accountsUri); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BaseActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BaseActivity.java index 7423e6828..7037b5536 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BaseActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/BaseActivity.java @@ -26,6 +26,7 @@ import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.LinearLayout; import android.widget.TextView; import org.sufficientlysecure.keychain.R; @@ -126,5 +127,12 @@ public abstract class BaseActivity extends ActionBarActivity { ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); } +// public void add() { +// LayoutInflater inflater = LayoutInflater.from(mToolbar.getContext()); +// View view = inflater.inflate(R.layout.api_app_settings_fragment, null); +// Toolbar.LayoutParams layoutParams = new Toolbar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); +//// layoutParams.gravity = Gravity.BOTTOM; +// mToolbar.addView(view, layoutParams); +// } } |