diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote')
4 files changed, 35 insertions, 14 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java index 0e9678980..7d77a989d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AccountSettingsActivity.java @@ -27,6 +27,7 @@ import android.view.View; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.ui.BaseActivity; import org.sufficientlysecure.keychain.ui.util.ActionBarHelper; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.remote.AccountSettings; @@ -35,7 +36,7 @@ import org.sufficientlysecure.keychain.operations.results.OperationResult.LogTyp import org.sufficientlysecure.keychain.operations.results.SingletonResult; import org.sufficientlysecure.keychain.util.Log; -public class AccountSettingsActivity extends ActionBarActivity { +public class AccountSettingsActivity extends BaseActivity { private Uri mAccountUri; private AccountSettingsFragment mAccountSettingsFragment; @@ -55,7 +56,6 @@ public class AccountSettingsActivity extends ActionBarActivity { } }); - setContentView(R.layout.api_account_settings_activity); mAccountSettingsFragment = (AccountSettingsFragment) getSupportFragmentManager().findFragmentById( R.id.api_account_settings_fragment); @@ -73,6 +73,11 @@ public class AccountSettingsActivity extends ActionBarActivity { } @Override + protected void initLayout() { + setContentView(R.layout.api_account_settings_activity); + } + + @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.api_account_settings, menu); 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 56e3b22e2..d84a03698 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 @@ -33,9 +33,10 @@ import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.remote.AppSettings; import org.sufficientlysecure.keychain.operations.results.OperationResult; +import org.sufficientlysecure.keychain.ui.BaseActivity; import org.sufficientlysecure.keychain.util.Log; -public class AppSettingsActivity extends ActionBarActivity { +public class AppSettingsActivity extends BaseActivity { private Uri mAppUri; private AppSettingsFragment mSettingsFragment; @@ -49,12 +50,11 @@ public class AppSettingsActivity extends ActionBarActivity { super.onCreate(savedInstanceState); // let the actionbar look like Android's contact app - ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setIcon(android.R.color.transparent); - actionBar.setHomeButtonEnabled(true); +// ActionBar actionBar = getSupportActionBar(); +// actionBar.setDisplayHomeAsUpEnabled(true); +// actionBar.setIcon(android.R.color.transparent); +// actionBar.setHomeButtonEnabled(true); - setContentView(R.layout.api_app_settings_activity); mSettingsFragment = (AppSettingsFragment) getSupportFragmentManager().findFragmentById( R.id.api_app_settings_fragment); @@ -72,6 +72,11 @@ public class AppSettingsActivity extends ActionBarActivity { } @Override + protected void initLayout() { + setContentView(R.layout.api_app_settings_activity); + } + + @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); getMenuInflater().inflate(R.menu.api_app_settings, menu); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppsListActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppsListActivity.java index ba27b22f2..079b3065e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppsListActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/AppsListActivity.java @@ -32,8 +32,8 @@ public class AppsListActivity extends DrawerActivity { } @Override - protected int getLayoutResource() { - return R.layout.api_apps_list_activity; + protected void initLayout() { + setContentView(R.layout.api_apps_list_activity); } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/RemoteServiceActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/RemoteServiceActivity.java index d7b723eb0..a9a7c75f5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/RemoteServiceActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/remote/ui/RemoteServiceActivity.java @@ -39,6 +39,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.remote.AccountSettings; import org.sufficientlysecure.keychain.remote.AppSettings; +import org.sufficientlysecure.keychain.ui.BaseActivity; import org.sufficientlysecure.keychain.ui.SelectPublicKeyFragment; import org.sufficientlysecure.keychain.ui.util.ActionBarHelper; import org.sufficientlysecure.keychain.ui.util.Notify; @@ -46,7 +47,7 @@ import org.sufficientlysecure.keychain.util.Log; import java.util.ArrayList; -public class RemoteServiceActivity extends ActionBarActivity { +public class RemoteServiceActivity extends BaseActivity { public static final String ACTION_REGISTER = Constants.INTENT_PREFIX + "API_ACTIVITY_REGISTER"; public static final String ACTION_CREATE_ACCOUNT = Constants.INTENT_PREFIX @@ -96,6 +97,11 @@ public class RemoteServiceActivity extends ActionBarActivity { handleActions(getIntent(), savedInstanceState); } + @Override + protected void initLayout() { + // done in handleActions() + } + protected void handleActions(Intent intent, Bundle savedInstanceState) { String action = intent.getAction(); @@ -108,6 +114,7 @@ public class RemoteServiceActivity extends ActionBarActivity { Log.d(Constants.TAG, "ACTION_REGISTER packageName: " + packageName); setContentView(R.layout.api_remote_register_app); + initToolbar(); mAppSettingsFragment = (AppSettingsFragment) getSupportFragmentManager().findFragmentById( R.id.api_app_settings_fragment); @@ -145,6 +152,7 @@ public class RemoteServiceActivity extends ActionBarActivity { final String accName = extras.getString(EXTRA_ACC_NAME); setContentView(R.layout.api_remote_create_account); + initToolbar(); mAccSettingsFragment = (AccountSettingsFragment) getSupportFragmentManager().findFragmentById( R.id.api_account_settings_fragment); @@ -248,6 +256,9 @@ public class RemoteServiceActivity extends ActionBarActivity { } } + setContentView(R.layout.api_remote_select_pub_keys); + initToolbar(); + // Inflate a "Done"/"Cancel" custom action bar view ActionBarHelper.setTwoButtonView(getSupportActionBar(), R.string.btn_okay, R.drawable.ic_action_done, @@ -272,7 +283,6 @@ public class RemoteServiceActivity extends ActionBarActivity { } ); - setContentView(R.layout.api_remote_select_pub_keys); // set text on view TextView textView = (TextView) findViewById(R.id.api_select_pub_keys_text); @@ -303,6 +313,9 @@ public class RemoteServiceActivity extends ActionBarActivity { Spannable redErrorMessage = new SpannableString(errorMessage); redErrorMessage.setSpan(new ForegroundColorSpan(Color.RED), 0, errorMessage.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + setContentView(R.layout.api_remote_error_message); + initToolbar(); + // Inflate a "Done" custom action bar view ActionBarHelper.setOneButtonView(getSupportActionBar(), R.string.btn_okay, R.drawable.ic_action_done, @@ -316,8 +329,6 @@ public class RemoteServiceActivity extends ActionBarActivity { } ); - setContentView(R.layout.api_remote_error_message); - // set text on view TextView textView = (TextView) findViewById(R.id.api_app_error_message_text); textView.setText(redErrorMessage); |