From a24b9c6c05e7cd0061450afdffd3932f4b23641a Mon Sep 17 00:00:00 2001 From: tonymanou Date: Thu, 28 Aug 2014 14:12:26 +0200 Subject: [PATCH 01/14] Changed settings dialog to an activity --- AndroidManifest.xml | 15 ++++++ src/biz/bokhorst/xprivacy/ActivityApp.java | 5 +- src/biz/bokhorst/xprivacy/ActivityMain.java | 3 +- .../bokhorst/xprivacy/ApplicationInfoEx.java | 2 +- src/biz/bokhorst/xprivacy/SettingsDialog.java | 54 +++++++++++-------- 5 files changed, 53 insertions(+), 26 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index af8a61800..fd9ad6cf0 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -121,6 +121,21 @@ + + + + + + + + + getXApplicationList(Context context, Progr return listApp; } - public List getApplicationName() { + public ArrayList getApplicationName() { return new ArrayList(mMapAppInfo.navigableKeySet()); } diff --git a/src/biz/bokhorst/xprivacy/SettingsDialog.java b/src/biz/bokhorst/xprivacy/SettingsDialog.java index 24067f6fa..9e1c7296b 100644 --- a/src/biz/bokhorst/xprivacy/SettingsDialog.java +++ b/src/biz/bokhorst/xprivacy/SettingsDialog.java @@ -9,17 +9,16 @@ import android.annotation.SuppressLint; import android.app.AlertDialog; -import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.location.Address; import android.location.Geocoder; import android.os.Build; +import android.os.Bundle; import android.os.Environment; import android.os.Process; import android.text.TextUtils; import android.view.View; -import android.view.Window; import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; @@ -28,20 +27,29 @@ import android.widget.TextView; import android.widget.Toast; -public class SettingsDialog { +public class SettingsDialog extends ActivityBase { - public static void edit(final ActivityBase context, ApplicationInfoEx appInfo) { + public static final String ACTION_SETTINGS = "biz.bokhorst.xprivacy.action.SETTINGS"; + public static final String cAppUid = "AppUid"; + public static final String cAppName = "AppName"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.settings); + setTitle(R.string.menu_settings); + + final Bundle extras = getIntent().getExtras(); final int userId = Util.getUserId(Process.myUid()); - final int uid = (appInfo == null ? userId : appInfo.getUid()); + final int uid; + + if (extras != null && extras.containsKey(cAppUid)) + uid = extras.getInt(cAppUid); + else + uid = userId; - // Build dialog - String themeName = PrivacyManager.getSetting(userId, PrivacyManager.cSettingTheme, ""); - int themeId = (themeName.equals("Dark") ? R.style.CustomTheme_Dialog : R.style.CustomTheme_Light_Dialog); - final Dialog dlgSettings = new Dialog(context, themeId); - dlgSettings.requestWindowFeature(Window.FEATURE_LEFT_ICON); - dlgSettings.setTitle(R.string.menu_settings); - dlgSettings.setContentView(R.layout.settings); - dlgSettings.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, context.getThemed(R.attr.icon_launcher)); + // XXX hack to avoid changing variable names right now + final ActivityBase context = this, dlgSettings = this; // Reference controls TextView tvAppName = (TextView) dlgSettings.findViewById(R.id.tvAppName); @@ -230,11 +238,15 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { }); // Display app name - if (appInfo == null) { + if (extras == null) { tvAppName.setVisibility(View.GONE); vwAppNameBorder.setVisibility(View.GONE); - } else - tvAppName.setText(TextUtils.join(", ", appInfo.getApplicationName())); + } else { + if (extras.containsKey(cAppName)) + tvAppName.setText(TextUtils.join(", ", extras.getIntegerArrayList(cAppName))); + else // Should never happen + tvAppName.setText("-"); + } // Get current values boolean usage = PrivacyManager.getSettingBool(-uid, PrivacyManager.cSettingUsage, true); @@ -453,7 +465,7 @@ public void onClick(DialogInterface dialog, int which) { context.recreate(); Toast.makeText(context, context.getString(R.string.msg_reboot), Toast.LENGTH_LONG) .show(); - dlgSettings.dismiss(); + dlgSettings.finish(); } }); alertDialogBuilder.setNegativeButton(context.getString(android.R.string.cancel), @@ -678,7 +690,7 @@ public void onClick(View view) { PrivacyManager.setSetting(uid, PrivacyManager.cSettingSSID, getValue(cbSSID, etSSID)); PrivacyManager.setSetting(uid, PrivacyManager.cSettingUa, getValue(null, etUa)); - dlgSettings.dismiss(); + dlgSettings.finish(); // Refresh view if (uid == userId) { @@ -697,13 +709,9 @@ public void onClick(View view) { btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - dlgSettings.dismiss(); + dlgSettings.finish(); } }); - - // Show dialog - dlgSettings.setCancelable(true); - dlgSettings.show(); } private static String getValue(CheckBox check, EditText edit) { From f39558bed45fac7e909fe778d8bc354dac6ef8e7 Mon Sep 17 00:00:00 2001 From: tonymanou Date: Thu, 28 Aug 2014 14:21:30 +0200 Subject: [PATCH 02/14] Renamed SettingsDialog to ActivitySettings --- AndroidManifest.xml | 2 +- src/biz/bokhorst/xprivacy/ActivityApp.java | 6 +++--- src/biz/bokhorst/xprivacy/ActivityMain.java | 8 ++++++-- .../{SettingsDialog.java => ActivitySettings.java} | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) rename src/biz/bokhorst/xprivacy/{SettingsDialog.java => ActivitySettings.java} (99%) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fd9ad6cf0..bd65e40cb 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -122,7 +122,7 @@ diff --git a/src/biz/bokhorst/xprivacy/ActivityApp.java b/src/biz/bokhorst/xprivacy/ActivityApp.java index 208cae295..2cc59b982 100644 --- a/src/biz/bokhorst/xprivacy/ActivityApp.java +++ b/src/biz/bokhorst/xprivacy/ActivityApp.java @@ -679,9 +679,9 @@ private void optionFetch() { } private void optionSettings() { - Intent intent = new Intent(ActivityApp.this, SettingsDialog.class); - intent.putExtra(SettingsDialog.cAppUid, mAppInfo.getUid()); - intent.putStringArrayListExtra(SettingsDialog.cAppName, mAppInfo.getApplicationName()); + Intent intent = new Intent(ActivityApp.this, ActivitySettings.class); + intent.putExtra(ActivitySettings.cAppUid, mAppInfo.getUid()); + intent.putStringArrayListExtra(ActivitySettings.cAppName, mAppInfo.getApplicationName()); startActivity(intent); } diff --git a/src/biz/bokhorst/xprivacy/ActivityMain.java b/src/biz/bokhorst/xprivacy/ActivityMain.java index 65dfe4958..4887670c1 100644 --- a/src/biz/bokhorst/xprivacy/ActivityMain.java +++ b/src/biz/bokhorst/xprivacy/ActivityMain.java @@ -597,8 +597,7 @@ public boolean onOptionsItemSelected(MenuItem item) { optionSwitchTheme(); return true; case R.id.menu_settings: - Intent intent = new Intent(this, SettingsDialog.class); - startActivity(intent); + optionSettings(); return true; case R.id.menu_dump: optionDump(); @@ -990,6 +989,11 @@ private void optionSwitchTheme() { this.recreate(); } + private void optionSettings() { + Intent intent = new Intent(this, ActivitySettings.class); + startActivity(intent); + } + private void optionDump() { try { PrivacyService.getClient().dump(0); diff --git a/src/biz/bokhorst/xprivacy/SettingsDialog.java b/src/biz/bokhorst/xprivacy/ActivitySettings.java similarity index 99% rename from src/biz/bokhorst/xprivacy/SettingsDialog.java rename to src/biz/bokhorst/xprivacy/ActivitySettings.java index 9e1c7296b..dee5ff204 100644 --- a/src/biz/bokhorst/xprivacy/SettingsDialog.java +++ b/src/biz/bokhorst/xprivacy/ActivitySettings.java @@ -27,7 +27,7 @@ import android.widget.TextView; import android.widget.Toast; -public class SettingsDialog extends ActivityBase { +public class ActivitySettings extends ActivityBase { public static final String ACTION_SETTINGS = "biz.bokhorst.xprivacy.action.SETTINGS"; public static final String cAppUid = "AppUid"; From 75267932e3f72d4751462237d1d4ee2feeb28b67 Mon Sep 17 00:00:00 2001 From: tonymanou Date: Thu, 28 Aug 2014 14:29:03 +0200 Subject: [PATCH 03/14] Removed hack and cleaned "this" references --- .../bokhorst/xprivacy/ActivitySettings.java | 171 +++++++++--------- 1 file changed, 84 insertions(+), 87 deletions(-) diff --git a/src/biz/bokhorst/xprivacy/ActivitySettings.java b/src/biz/bokhorst/xprivacy/ActivitySettings.java index dee5ff204..d3d6c4ff1 100644 --- a/src/biz/bokhorst/xprivacy/ActivitySettings.java +++ b/src/biz/bokhorst/xprivacy/ActivitySettings.java @@ -48,75 +48,72 @@ protected void onCreate(Bundle savedInstanceState) { else uid = userId; - // XXX hack to avoid changing variable names right now - final ActivityBase context = this, dlgSettings = this; - // Reference controls - TextView tvAppName = (TextView) dlgSettings.findViewById(R.id.tvAppName); - View vwAppNameBorder = (View) dlgSettings.findViewById(R.id.vwAppNameBorder); - - final CheckBox cbNotify = (CheckBox) dlgSettings.findViewById(R.id.cbNotify); - final CheckBox cbOnDemand = (CheckBox) dlgSettings.findViewById(R.id.cbOnDemand); - final CheckBox cbBlacklist = (CheckBox) dlgSettings.findViewById(R.id.cbBlacklist); - final CheckBox cbUsage = (CheckBox) dlgSettings.findViewById(R.id.cbUsage); - final CheckBox cbParameters = (CheckBox) dlgSettings.findViewById(R.id.cbParameters); - final CheckBox cbLog = (CheckBox) dlgSettings.findViewById(R.id.cbLog); - - final CheckBox cbExpert = (CheckBox) dlgSettings.findViewById(R.id.cbExpert); - final CheckBox cbSystem = (CheckBox) dlgSettings.findViewById(R.id.cbSystem); - final CheckBox cbExperimental = (CheckBox) dlgSettings.findViewById(R.id.cbExperimental); - final CheckBox cbHttps = (CheckBox) dlgSettings.findViewById(R.id.cbHttps); - final CheckBox cbAOSP = (CheckBox) dlgSettings.findViewById(R.id.cbAOSP); - final LinearLayout llConfidence = (LinearLayout) dlgSettings.findViewById(R.id.llConfidence); - final EditText etConfidence = (EditText) dlgSettings.findViewById(R.id.etConfidence); - final EditText etQuirks = (EditText) dlgSettings.findViewById(R.id.etQuirks); - final Button btnClearDb = (Button) dlgSettings.findViewById(R.id.btnClearDb); - - final CheckBox cbRandom = (CheckBox) dlgSettings.findViewById(R.id.cbRandom); - final Button btnRandom = (Button) dlgSettings.findViewById(R.id.btnRandom); - final Button btnClear = (Button) dlgSettings.findViewById(R.id.btnClear); - final Button btnFlush = (Button) dlgSettings.findViewById(R.id.btnFlush); - - final EditText etSerial = (EditText) dlgSettings.findViewById(R.id.etSerial); - final EditText etLat = (EditText) dlgSettings.findViewById(R.id.etLat); - final EditText etLon = (EditText) dlgSettings.findViewById(R.id.etLon); - final EditText etAlt = (EditText) dlgSettings.findViewById(R.id.etAlt); - final EditText etSearch = (EditText) dlgSettings.findViewById(R.id.etSearch); - final Button btnSearch = (Button) dlgSettings.findViewById(R.id.btnSearch); - final EditText etMac = (EditText) dlgSettings.findViewById(R.id.etMac); - final EditText etIP = (EditText) dlgSettings.findViewById(R.id.etIP); - final EditText etImei = (EditText) dlgSettings.findViewById(R.id.etImei); - final EditText etPhone = (EditText) dlgSettings.findViewById(R.id.etPhone); - final EditText etId = (EditText) dlgSettings.findViewById(R.id.etId); - final EditText etGsfId = (EditText) dlgSettings.findViewById(R.id.etGsfId); - final EditText etAdId = (EditText) dlgSettings.findViewById(R.id.etAdId); - final EditText etMcc = (EditText) dlgSettings.findViewById(R.id.etMcc); - final EditText etMnc = (EditText) dlgSettings.findViewById(R.id.etMnc); - final EditText etCountry = (EditText) dlgSettings.findViewById(R.id.etCountry); - final EditText etOperator = (EditText) dlgSettings.findViewById(R.id.etOperator); - final EditText etIccId = (EditText) dlgSettings.findViewById(R.id.etIccId); - final EditText etCid = (EditText) dlgSettings.findViewById(R.id.etCid); - final EditText etLac = (EditText) dlgSettings.findViewById(R.id.etLac); - final EditText etSubscriber = (EditText) dlgSettings.findViewById(R.id.etSubscriber); - final EditText etSSID = (EditText) dlgSettings.findViewById(R.id.etSSID); - final EditText etUa = (EditText) dlgSettings.findViewById(R.id.etUa); - - final CheckBox cbSerial = (CheckBox) dlgSettings.findViewById(R.id.cbSerial); - final CheckBox cbLat = (CheckBox) dlgSettings.findViewById(R.id.cbLat); - final CheckBox cbLon = (CheckBox) dlgSettings.findViewById(R.id.cbLon); - final CheckBox cbAlt = (CheckBox) dlgSettings.findViewById(R.id.cbAlt); - final CheckBox cbMac = (CheckBox) dlgSettings.findViewById(R.id.cbMac); - final CheckBox cbImei = (CheckBox) dlgSettings.findViewById(R.id.cbImei); - final CheckBox cbPhone = (CheckBox) dlgSettings.findViewById(R.id.cbPhone); - final CheckBox cbId = (CheckBox) dlgSettings.findViewById(R.id.cbId); - final CheckBox cbGsfId = (CheckBox) dlgSettings.findViewById(R.id.cbGsfId); - final CheckBox cbAdId = (CheckBox) dlgSettings.findViewById(R.id.cbAdId); - final CheckBox cbCountry = (CheckBox) dlgSettings.findViewById(R.id.cbCountry); - final CheckBox cbSubscriber = (CheckBox) dlgSettings.findViewById(R.id.cbSubscriber); - final CheckBox cbSSID = (CheckBox) dlgSettings.findViewById(R.id.cbSSID); - - Button btnOk = (Button) dlgSettings.findViewById(R.id.btnOk); - Button btnCancel = (Button) dlgSettings.findViewById(R.id.btnCancel); + TextView tvAppName = (TextView) findViewById(R.id.tvAppName); + View vwAppNameBorder = (View) findViewById(R.id.vwAppNameBorder); + + final CheckBox cbNotify = (CheckBox) findViewById(R.id.cbNotify); + final CheckBox cbOnDemand = (CheckBox) findViewById(R.id.cbOnDemand); + final CheckBox cbBlacklist = (CheckBox) findViewById(R.id.cbBlacklist); + final CheckBox cbUsage = (CheckBox) findViewById(R.id.cbUsage); + final CheckBox cbParameters = (CheckBox) findViewById(R.id.cbParameters); + final CheckBox cbLog = (CheckBox) findViewById(R.id.cbLog); + + final CheckBox cbExpert = (CheckBox) findViewById(R.id.cbExpert); + final CheckBox cbSystem = (CheckBox) findViewById(R.id.cbSystem); + final CheckBox cbExperimental = (CheckBox) findViewById(R.id.cbExperimental); + final CheckBox cbHttps = (CheckBox) findViewById(R.id.cbHttps); + final CheckBox cbAOSP = (CheckBox) findViewById(R.id.cbAOSP); + final LinearLayout llConfidence = (LinearLayout) findViewById(R.id.llConfidence); + final EditText etConfidence = (EditText) findViewById(R.id.etConfidence); + final EditText etQuirks = (EditText) findViewById(R.id.etQuirks); + final Button btnClearDb = (Button) findViewById(R.id.btnClearDb); + + final CheckBox cbRandom = (CheckBox) findViewById(R.id.cbRandom); + final Button btnRandom = (Button) findViewById(R.id.btnRandom); + final Button btnClear = (Button) findViewById(R.id.btnClear); + final Button btnFlush = (Button) findViewById(R.id.btnFlush); + + final EditText etSerial = (EditText) findViewById(R.id.etSerial); + final EditText etLat = (EditText) findViewById(R.id.etLat); + final EditText etLon = (EditText) findViewById(R.id.etLon); + final EditText etAlt = (EditText) findViewById(R.id.etAlt); + final EditText etSearch = (EditText) findViewById(R.id.etSearch); + final Button btnSearch = (Button) findViewById(R.id.btnSearch); + final EditText etMac = (EditText) findViewById(R.id.etMac); + final EditText etIP = (EditText) findViewById(R.id.etIP); + final EditText etImei = (EditText) findViewById(R.id.etImei); + final EditText etPhone = (EditText) findViewById(R.id.etPhone); + final EditText etId = (EditText) findViewById(R.id.etId); + final EditText etGsfId = (EditText) findViewById(R.id.etGsfId); + final EditText etAdId = (EditText) findViewById(R.id.etAdId); + final EditText etMcc = (EditText) findViewById(R.id.etMcc); + final EditText etMnc = (EditText) findViewById(R.id.etMnc); + final EditText etCountry = (EditText) findViewById(R.id.etCountry); + final EditText etOperator = (EditText) findViewById(R.id.etOperator); + final EditText etIccId = (EditText) findViewById(R.id.etIccId); + final EditText etCid = (EditText) findViewById(R.id.etCid); + final EditText etLac = (EditText) findViewById(R.id.etLac); + final EditText etSubscriber = (EditText) findViewById(R.id.etSubscriber); + final EditText etSSID = (EditText) findViewById(R.id.etSSID); + final EditText etUa = (EditText) findViewById(R.id.etUa); + + final CheckBox cbSerial = (CheckBox) findViewById(R.id.cbSerial); + final CheckBox cbLat = (CheckBox) findViewById(R.id.cbLat); + final CheckBox cbLon = (CheckBox) findViewById(R.id.cbLon); + final CheckBox cbAlt = (CheckBox) findViewById(R.id.cbAlt); + final CheckBox cbMac = (CheckBox) findViewById(R.id.cbMac); + final CheckBox cbImei = (CheckBox) findViewById(R.id.cbImei); + final CheckBox cbPhone = (CheckBox) findViewById(R.id.cbPhone); + final CheckBox cbId = (CheckBox) findViewById(R.id.cbId); + final CheckBox cbGsfId = (CheckBox) findViewById(R.id.cbGsfId); + final CheckBox cbAdId = (CheckBox) findViewById(R.id.cbAdId); + final CheckBox cbCountry = (CheckBox) findViewById(R.id.cbCountry); + final CheckBox cbSubscriber = (CheckBox) findViewById(R.id.cbSubscriber); + final CheckBox cbSSID = (CheckBox) findViewById(R.id.cbSSID); + + Button btnOk = (Button) findViewById(R.id.btnOk); + Button btnCancel = (Button) findViewById(R.id.btnCancel); final EditText[] edits = new EditText[] { etSerial, etLat, etLon, etAlt, etMac, etIP, etImei, etPhone, etId, etGsfId, etAdId, etMcc, etMnc, etCountry, etOperator, etIccId, etCid, etLac, etSubscriber, etSSID, etUa }; @@ -319,7 +316,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { // Global settings cbUsage.setChecked(usage); cbParameters.setChecked(parameters); - cbParameters.setEnabled(Util.hasProLicense(context) != null); + cbParameters.setEnabled(Util.hasProLicense(this) != null); if (userId == 0) cbLog.setChecked(log); else { @@ -452,23 +449,23 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { btnClearDb.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(ActivitySettings.this); alertDialogBuilder.setTitle(R.string.menu_clear_db); alertDialogBuilder.setMessage(R.string.msg_sure); - alertDialogBuilder.setIcon(context.getThemed(R.attr.icon_launcher)); - alertDialogBuilder.setPositiveButton(context.getString(android.R.string.ok), + alertDialogBuilder.setIcon(getThemed(R.attr.icon_launcher)); + alertDialogBuilder.setPositiveButton(getString(android.R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { PrivacyManager.clear(); - ((EditText) context.findViewById(R.id.etFilter)).setText(""); - context.recreate(); - Toast.makeText(context, context.getString(R.string.msg_reboot), Toast.LENGTH_LONG) + ((EditText) findViewById(R.id.etFilter)).setText(""); + recreate(); + Toast.makeText(ActivitySettings.this, getString(R.string.msg_reboot), Toast.LENGTH_LONG) .show(); - dlgSettings.finish(); + finish(); } }); - alertDialogBuilder.setNegativeButton(context.getString(android.R.string.cancel), + alertDialogBuilder.setNegativeButton(getString(android.R.string.cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -518,8 +515,8 @@ public void onClick(View view) { @Override public void onClick(View view) { Intent flushIntent = new Intent(UpdateService.cFlush); - context.startService(flushIntent); - Toast.makeText(context, context.getString(R.string.msg_done), Toast.LENGTH_LONG).show(); + startService(flushIntent); + Toast.makeText(ActivitySettings.this, getString(R.string.msg_done), Toast.LENGTH_LONG).show(); } }); else @@ -531,7 +528,7 @@ public void onClick(View view) { public void onClick(View view) { try { String search = etSearch.getText().toString(); - final List
listAddress = new Geocoder(context).getFromLocationName(search, 1); + final List
listAddress = new Geocoder(ActivitySettings.this).getFromLocationName(search, 1); if (listAddress.size() > 0) { Address address = listAddress.get(0); @@ -555,7 +552,7 @@ public void onClick(View view) { etSearch.setText(sb.toString()); } } catch (Throwable ex) { - Toast.makeText(context, ex.getMessage(), Toast.LENGTH_LONG).show(); + Toast.makeText(ActivitySettings.this, ex.getMessage(), Toast.LENGTH_LONG).show(); } } }); @@ -690,17 +687,17 @@ public void onClick(View view) { PrivacyManager.setSetting(uid, PrivacyManager.cSettingSSID, getValue(cbSSID, etSSID)); PrivacyManager.setSetting(uid, PrivacyManager.cSettingUa, getValue(null, etUa)); - dlgSettings.finish(); + finish(); // Refresh view if (uid == userId) { - Intent intent = new Intent(context, ActivityMain.class); - context.startActivity(intent); + Intent intent = new Intent(ActivitySettings.this, ActivityMain.class); + startActivity(intent); } else { - Intent intent = new Intent(context, ActivityApp.class); + Intent intent = new Intent(ActivitySettings.this, ActivityApp.class); intent.putExtra(ActivityApp.cUid, uid); intent.putExtra(ActivityApp.cAction, ActivityApp.cActionRefresh); - context.startActivity(intent); + startActivity(intent); } } }); @@ -709,7 +706,7 @@ public void onClick(View view) { btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - dlgSettings.finish(); + finish(); } }); } From 54f5d55b5ca05dd6e54cee8e084de1bd8289df5f Mon Sep 17 00:00:00 2001 From: tonymanou Date: Thu, 28 Aug 2014 15:04:59 +0200 Subject: [PATCH 04/14] Moved Cancel and OK buttons to the action bar --- res/layout/settings.xml | 1070 ++++++++--------- res/menu/settings.xml | 15 + .../bokhorst/xprivacy/ActivitySettings.java | 462 ++++--- 3 files changed, 797 insertions(+), 750 deletions(-) create mode 100644 res/menu/settings.xml diff --git a/res/layout/settings.xml b/res/layout/settings.xml index 48b626c70..ecc5eb43b 100644 --- a/res/layout/settings.xml +++ b/res/layout/settings.xml @@ -1,8 +1,8 @@ - - + android:layout_height="wrap_content" + android:orientation="vertical" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_marginLeft="30dip" + android:orientation="horizontal" > + + + android:hint="35" + android:inputType="numberDecimal" + android:maxLength="2" + tools:ignore="HardcodedText" /> + - + + android:ellipsize="end" + android:singleLine="true" + android:text="@string/settings_quirks" + android:textIsSelectable="false" /> - - - + android:hint="freeze,resolve,test" + android:inputType="text" + tools:ignore="HardcodedText" /> + - +