Skip to content

Settings: Use PreferenceFragmentCompat#326

Merged
fat-tire merged 3 commits intocSploit:developfrom
fat-tire:develop
Sep 29, 2015
Merged

Settings: Use PreferenceFragmentCompat#326
fat-tire merged 3 commits intocSploit:developfrom
fat-tire:develop

Conversation

@fat-tire
Copy link
Copy Markdown
Contributor

Please test extensively at this before committing! I can not say this works on any device really. Could be tons of regressions. The idea was to fix the settings so that it can be used on older APIs as it was crashing before.

Now it uses some preferences stuff from the support library, namely a PreferenceFragmentCompat and AppCompatActivity rather than the single old-style PreferencesActivity. In that way, it's a little more "modern" and if it works, it should work all the way down to API 9 Gingerbread.

But I'm not saying it works. This is a WORK IN PROGRESS that I wanted to get in for comment/testing before I went to sleep...

Also, I am including the style.xml commit too so that my patch is over that as I'm touching style.xml. But you can merge it across from master. Accepting that to master was a screwup-- should have merged into develop.

One last thing, if you're wondering about this:

-        <item name="android:colorBackground">@color/material_blue_grey_950</item>
+        <item name="android:colorBackground">#ff21272b</item>

It's cuz that value wasn't defined for older APIs. And this:

-  public static final int PICK_DIRECTORY = 43522432;
+  public static final int PICK_DIRECTORY = 1212;

Is just because that gigantic number was crashing android when it was used as a RequestCode for launching an intent:

 error : Can only use lower 16 bits for requestCode

Cheers!

V0idSt4r and others added 2 commits September 29, 2015 01:01
A 20% darker hex than the original holo_blue... Its supposed to be darker not lighter than the below colorPrimary
*  Now use one preferences.xml file
*  Use PreferenceFragmentCompat and AppCompatActivity for preferences
   instead of PreferencesActivity
*  Use legal sized RequestID in DirectoryPicker;

Note this was only tested a tiny bit on Lollipop.  Need to try it
on older devices to make sure it's okay.
@fat-tire fat-tire changed the title Settings: Use Settings: Use PreferenceFragmentCompat Sep 29, 2015
Since it's done by onCreatePreferences() there is no reason to do it
in onCreate().  Hey, half the preferences!
fat-tire added a commit that referenced this pull request Sep 29, 2015
Settings:  Use PreferenceFragmentCompat   Here goes nothin'
@fat-tire fat-tire merged commit 2c1d43c into cSploit:develop Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant