rename crypto consumers to api apps

This commit is contained in:
Dominik Schürmann
2013-09-05 00:02:48 +02:00
parent fcec7e830c
commit 9a737c7318
11 changed files with 122 additions and 77 deletions

View File

@@ -134,22 +134,26 @@ public class ServiceActivity extends SherlockFragmentActivity {
final String packageName = extras.getString(EXTRA_PACKAGE_NAME);
setContentView(R.layout.api_app_settings_activity);
LinearLayout layoutRegister = (LinearLayout) findViewById(R.id.register_crypto_consumer_register_layout);
LinearLayout layoutEdit = (LinearLayout) findViewById(R.id.register_crypto_consumer_edit_layout);
//TODO: handle if app is already registered
// LinearLayout layoutRegister = (LinearLayout)
// findViewById(R.id.register_crypto_consumer_register_layout);
// LinearLayout layoutEdit = (LinearLayout)
// findViewById(R.id.register_crypto_consumer_edit_layout);
//
// // if already registered show edit buttons
// ArrayList<String> allowedPkgs = ProviderHelper.getCryptoConsumers(this);
// if (allowedPkgs.contains(packageName)) {
// Log.d(Constants.TAG, "Package is allowed! packageName: " + packageName);
// layoutRegister.setVisibility(View.GONE);
// layoutEdit.setVisibility(View.VISIBLE);
// } else {
// layoutRegister.setVisibility(View.VISIBLE);
// layoutEdit.setVisibility(View.GONE);
// }
// if already registered show edit buttons
ArrayList<String> allowedPkgs = ProviderHelper.getCryptoConsumers(this);
if (allowedPkgs.contains(packageName)) {
Log.d(Constants.TAG, "Package is allowed! packageName: " + packageName);
layoutRegister.setVisibility(View.GONE);
layoutEdit.setVisibility(View.VISIBLE);
} else {
layoutRegister.setVisibility(View.VISIBLE);
layoutEdit.setVisibility(View.GONE);
}
Button allowButton = (Button) findViewById(R.id.register_crypto_consumer_allow);
Button disallowButton = (Button) findViewById(R.id.register_crypto_consumer_disallow);
Button allowButton = (Button) findViewById(R.id.api_register_allow);
Button disallowButton = (Button) findViewById(R.id.api_register_disallow);
allowButton.setOnClickListener(new OnClickListener() {