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

Commit

Permalink
Exclude apply category / apply once
Browse files Browse the repository at this point in the history
Closes #1381
  • Loading branch information
M66B committed Feb 18, 2014
1 parent 193105a commit 731d77e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog

* Fixed null pointer in storage/open
* Fixed restricting GSF ID in some cases ([issue](/../../issues/1374))
* Make it clear that *Apply to entire category* and *Once for ... seconds* exclude each other ([issue](/../../issues/1381))
* Improved filter view layout ([issue](/../../issues/1335))

**Version 1.99.46 TEST**
Expand Down
19 changes: 18 additions & 1 deletion src/biz/bokhorst/xprivacy/PrivacyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
Expand Down Expand Up @@ -1363,13 +1364,29 @@ private AlertDialog.Builder getOnDemandDialogBuilder(final PRestriction restrict
// Once check box
final CheckBox cbOnce = new CheckBox(context);
cbOnce.setText(String.format(resources.getString(R.string.title_once),
PrivacyManager.cRestrictionCacheTimeoutMs / 1000));
(restriction.extra == null ? PrivacyManager.cRestrictionCacheTimeoutMs : 0) / 1000));
cbOnce.setChecked(mSelectOnce);
LinearLayout.LayoutParams llOnceParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
cbOnce.setLayoutParams(llOnceParams);
llContainer.addView(cbOnce);

// Category and once exclude each other
cbCategory.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked)
cbOnce.setChecked(false);
}
});
cbOnce.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked)
cbCategory.setChecked(false);
}
});

// Message
TextView tvPlease = new TextView(context);
tvPlease.setText(resources.getString(R.string.title_pleasesubmit));
Expand Down

0 comments on commit 731d77e

Please sign in to comment.