aboutsummaryrefslogtreecommitdiff
path: root/sdk/src/java/lineageos/preference/ConstraintsHelper.java
Commit message (Collapse)AuthorAgeFilesLines
* lineage-sdk: Hide a pref group if all child prefs are themselves hiddenSam Mortimer2017-12-221-1/+17
| | | | | | | | | | | *) The change https://review.lineageos.org/#/c/193263/ knowingly removed the functionality where a pref group itself would be removed if all child prefs were removed (see comments around PS8/9). *) bgcngm discovered cases where this is needed so add this functionality back. Change-Id: Ibe684a6a21a2989623df71b08c2f5241682988ac
* lineage-sdk self-removing prefs: don't remove from death row until reapedSam Mortimer2017-12-191-2/+5
| | | | | | | | | | | | | *) Graveyard is shared by all prefs with a given context. *) When we reap in onAttached(), there may be prefs that aren't yet attached to the hierarchy. Ensure that summonReaper keeps track of them until the last onAttached() is called in the context. *) Fixes self-removing prefs that weren't being removed on a settings page that has at least one least other self-removing pref. Change-Id: Ic48b86bb6f06aa29c44814a5487e2382349fb363
* Revert "Revert "lineage-sdk self-removing prefs: move reap from ↵Sam Mortimer2017-12-191-11/+5
| | | | | | | | onBindViewHolder to onAttached"" This reverts commit 9f648b7046d1f921707c749b02b911ae126fd0fa. Change-Id: Ia102cfb55c16eb52e1412e815abd081d504fc96f
* Revert "lineage-sdk self-removing prefs: move reap from onBindViewHolder to ↵Bruno Martins2017-12-061-5/+11
| | | | | | | | | | | | | | onAttached" This reverts commit 027b615325092f7676a34c137248dc9fcd57cc35. While it served its original purpose, this was causing bad side-effects when using our constraints (verified at least with requiresConfig and requiresAction). Moving the reap to onAttached was rendering self-removing prefs useless because if the view isn't loaded yet, the preference (which also doesn't yet exists) can't really be hidden. Change-Id: Ic61fe4b9979412d89c55ea1543c494e69bf6eab7
* lineage-sdk self-removing prefs: move reap from onBindViewHolder to onAttachedSam Mortimer2017-11-091-11/+5
| | | | | | | | | | | | | *) Eliminates visibility of the pref removal. You could previously see vertical movement of text during initial display of replaced prefs. *) In addition, when reaping, use setVisible(false) instead of removePreference. Otherwise, array out of bounds index exceptions occur in frameworks pref support libraries (as a result of moving from onBindViewHolder to onAttached). Change-Id: I1a0045552572a590f89715f8d94156eddaaec469
* lineage-sdk: Support requiresConfig integers and add requiresConfigMaskSam Mortimer2017-10-241-14/+18
| | | | | | | | | | | | | | | *) Add support for integer requiresConfig resources (previously supported only strings and bools). Preference is removed if the int is 0. *) Add a new attribute requiresConfigMask that takes a string decimal int. If requiresConfig is an integer then the pref is removed if (requiresConfig resource value & requiresConfigMask value) == 0. If requiresConfig is not an integer type then requiresConfigMask is ignored. *) Code clean-up for the rest of checking requiresConfig. Change-Id: Ic2622809c02a94d9cecf6f59ed6e689fdb835458
* lineage-sdk: rebrand step 2: update file contentsSam Mortimer2017-10-061-16/+16
| | | | Change-Id: I9881acc57cdc0aeea2b296aac12a8af932d30aea
* lineage-sdk: rebrand step 1: update pathsSam Mortimer2017-09-221-0/+389
Change-Id: I4c2135d03d730a313a0638d0f857afa48fb220d3