Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Moved flush button to expert mode section
Browse files Browse the repository at this point in the history
Fixes #1934
  • Loading branch information
M66B committed Aug 30, 2014
1 parent 67458d0 commit 8030a63
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Version 3.x will be available with a [pro license](http://www.xprivacy.eu/) only

* Improved database locking ([pull request](/../../issues/1939))
* Changed settings dialog to settings activity ([pull request](/../../issues/1938))
* Moved flush button to expert mode section ([issue](/../../issues/1934))
* Updated simplified Chinese translation

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
Expand Down
15 changes: 8 additions & 7 deletions res/layout/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,16 @@
tools:ignore="HardcodedText" />
</LinearLayout>

<Button
android:id="@+id/btnFlush"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:text="@string/menu_flush" />

<Button
android:id="@+id/btnClearDb"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dip"
android:text="@string/menu_clear_db" />
Expand Down Expand Up @@ -188,12 +195,6 @@
android:layout_height="wrap_content"
android:text="@string/menu_clear" />

<Button
android:id="@+id/btnFlush"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/menu_flush" />

<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
30 changes: 15 additions & 15 deletions src/biz/bokhorst/xprivacy/ActivitySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class ActivitySettings extends ActivityBase implements OnCheckedChangeLis
private CheckBox cbAOSP;
private EditText etConfidence;
private EditText etQuirks;
private Button btnFlush;
private Button btnClearDb;
private CheckBox cbRandom;
private EditText etSerial;
Expand Down Expand Up @@ -112,27 +113,27 @@ protected void onCreate(Bundle savedInstanceState) {
cbParameters = (CheckBox) findViewById(R.id.cbParameters);
cbLog = (CheckBox) findViewById(R.id.cbLog);

final CheckBox cbExpert = (CheckBox) findViewById(R.id.cbExpert);
CheckBox cbExpert = (CheckBox) findViewById(R.id.cbExpert);
cbSystem = (CheckBox) findViewById(R.id.cbSystem);
cbExperimental = (CheckBox) findViewById(R.id.cbExperimental);
cbHttps = (CheckBox) findViewById(R.id.cbHttps);
cbAOSP = (CheckBox) findViewById(R.id.cbAOSP);
final LinearLayout llConfidence = (LinearLayout) findViewById(R.id.llConfidence);
LinearLayout llConfidence = (LinearLayout) findViewById(R.id.llConfidence);
etConfidence = (EditText) findViewById(R.id.etConfidence);
etQuirks = (EditText) findViewById(R.id.etQuirks);
btnFlush = (Button) findViewById(R.id.btnFlush);
btnClearDb = (Button) findViewById(R.id.btnClearDb);

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);
Button btnRandom = (Button) findViewById(R.id.btnRandom);
Button btnClear = (Button) findViewById(R.id.btnClear);

etSerial = (EditText) findViewById(R.id.etSerial);
etLat = (EditText) findViewById(R.id.etLat);
etLon = (EditText) findViewById(R.id.etLon);
etAlt = (EditText) findViewById(R.id.etAlt);
etSearch = (EditText) findViewById(R.id.etSearch);
final Button btnSearch = (Button) findViewById(R.id.btnSearch);
Button btnSearch = (Button) findViewById(R.id.btnSearch);
etMac = (EditText) findViewById(R.id.etMac);
etIP = (EditText) findViewById(R.id.etIP);
etImei = (EditText) findViewById(R.id.etImei);
Expand Down Expand Up @@ -256,6 +257,7 @@ protected void onCreate(Bundle savedInstanceState) {
cbLog.setChecked(log);
else {
cbLog.setVisibility(View.GONE);
btnFlush.setVisibility(View.GONE);
btnClearDb.setVisibility(View.GONE);
}
cbExpert.setChecked(expert);
Expand All @@ -279,6 +281,7 @@ protected void onCreate(Bundle savedInstanceState) {
cbAOSP.setChecked(false);
etConfidence.setEnabled(false);
etQuirks.setEnabled(false);
btnFlush.setEnabled(false);
btnClearDb.setEnabled(false);
}
} else {
Expand All @@ -295,6 +298,7 @@ protected void onCreate(Bundle savedInstanceState) {
cbHttps.setVisibility(View.GONE);
cbAOSP.setVisibility(View.GONE);
llConfidence.setVisibility(View.GONE);
btnFlush.setVisibility(View.GONE);
btnClearDb.setVisibility(View.GONE);

cbExpert.setChecked(expert);
Expand Down Expand Up @@ -385,16 +389,11 @@ protected void onCreate(Bundle savedInstanceState) {
etLac.setText(PrivacyManager.getSetting(-uid, PrivacyManager.cSettingLac, ""));
etUa.setText(PrivacyManager.getSetting(-uid, PrivacyManager.cSettingUa, ""));

btnFlush.setOnClickListener(this);
btnClearDb.setOnClickListener(this);
btnRandom.setOnClickListener(this);
btnClear.setOnClickListener(this);
btnSearch.setOnClickListener(this);

// Handle flush
if (uid == 0)
btnFlush.setOnClickListener(this);
else
btnFlush.setVisibility(View.GONE);
}

@Override
Expand Down Expand Up @@ -470,6 +469,7 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
cbAOSP.setEnabled(isChecked);
etConfidence.setEnabled(isChecked);
etQuirks.setEnabled(isChecked);
btnFlush.setEnabled(isChecked);
btnClearDb.setEnabled(isChecked);
if (!isChecked) {
cbSystem.setChecked(false);
Expand All @@ -486,6 +486,9 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnFlush:
flush();
break;
case R.id.btnClearDb:
clearDB();
break;
Expand All @@ -498,9 +501,6 @@ public void onClick(View v) {
case R.id.btnSearch:
search();
break;
case R.id.btnFlush:
flush();
break;
}
}

Expand Down

0 comments on commit 8030a63

Please sign in to comment.