Skip to content

Commit a72d390

Browse files
committed
Merge branch 'develop'
2 parents b227f64 + 5f28c22 commit a72d390

File tree

30 files changed

+553
-151
lines changed

30 files changed

+553
-151
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
**2018-07-18**
4+
5+
New version: 28.0.0.0-alpha3 (based on v28.0.0-alpha3)
6+
7+
- No support preferences related changes in the support library.
8+
- `PreferenceFragmentCompatDividers` is now deprecated. Use `PreferenceFragmentCompat` instead.
9+
- Added `preference-v7-material` module which provides `Theme.MaterialComponents` related themes.
10+
- Bug fixes #166, #169, #173
11+
312
**2018-07-04**
413

514
New version: 27.1.1.2 (based on v27.1.1)

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44
55
This library is meant to fix some of the problems found in the official support preference-v7 library. Also, there are [new preference types](#extra-types) available, such as `RingtonePreference`, `DatePickerPreference`, and `TimePickerPreference`.
66

7+
Support Library (28.0.0-alpha3):
78
[ ![Download](https://api.bintray.com/packages/gericop/maven/com.takisoft.fix%3Apreference-v7/images/download.svg) ](https://bintray.com/gericop/maven/com.takisoft.fix%3Apreference-v7/_latestVersion)
89

10+
AndroidX (1.0.0-beta01):
11+
[ ![Download](https://api.bintray.com/packages/takisoft/android/com.takisoft.preferencex%3Apreferencex/images/download.svg) ](https://bintray.com/takisoft/android/com.takisoft.preferencex%3Apreferencex/_latestVersion)
12+
> Check out the other available AndroidX artifacts at https://bintray.com/takisoft/android)
13+
914
### Donation
1015

1116
If you would like to support me, you may donate some small amount via PayPal.
@@ -18,12 +23,12 @@ If you would like to support me, you may donate some small amount via PayPal.
1823
### 1. Add gradle dependency
1924
First, **remove** the unnecessary lines of preference-v7 and preference-v14 from your gradle file as the bugfix contains both of them:
2025
```gradle
21-
implementation 'com.android.support:preference-v7:27.1.1'
22-
implementation 'com.android.support:preference-v14:27.1.1'
26+
implementation 'com.android.support:preference-v7:28.0.0-alpha3'
27+
implementation 'com.android.support:preference-v14:28.0.0-alpha3'
2328
```
2429
And **add** this single line to your gradle file:
2530
```gradle
26-
implementation 'com.takisoft.fix:preference-v7:27.1.1.2'
31+
implementation 'com.takisoft.fix:preference-v7:28.0.0.0-alpha3'
2732
```
2833
> Notice the versioning: the first three numbers are *always* the same as the latest official library while the last number is for own updates. I try to keep it up-to-date but if, for whatever reasons, I wouldn't notice the new support library versions, just issue a ticket.
2934
@@ -47,6 +52,7 @@ public class MyPreferenceFragment extends PreferenceFragmentCompat {
4752
> **Warning!** Watch out for the correct package name when importing `PreferenceFragmentCompat`, it should come from `com.takisoft.fix.support.v7.preference`.
4853
---
4954
#### Option 2 - `PreferenceFragmentCompatDividers`
55+
> **Warning!** `PreferenceFragmentCompatDividers` is deprecated and will be removed from the AndroidX version of the lib. You should use `PreferenceFragmentCompat` instead.
5056
```java
5157
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompatDividers;
5258

@@ -82,6 +88,14 @@ For example, the sample app uses `PreferenceFixTheme.Light.NoActionBar` as the p
8288
</style>
8389
```
8490

91+
**Theme.MaterialComponents**
92+
There's a NEW module called `preference-v7-material` that provides the new `Theme.MaterialComponents` related themes. You can add it to your project like this:
93+
```gradle
94+
implementation 'com.takisoft.fix:preference-v7-material:28.0.0.0-alpha3'
95+
```
96+
97+
> Note that you may need to use multidexing after this because it uses the support design library which is a huge codebase.
98+
8599
### 4. That's it!
86100
Now you can enjoy using the support preferences API without losing all your hair.
87101

@@ -92,18 +106,18 @@ Now you can enjoy using the support preferences API without losing all your hair
92106
There are additional preferences not part of the official support library, but decided to add them to some extra libraries. You can add all of them to your project using
93107

94108
```gradle
95-
implementation 'com.takisoft.fix:preference-v7-extras:27.1.1.2'
109+
implementation 'com.takisoft.fix:preference-v7-extras:28.0.0.0-alpha3'
96110
```
97111

98112
or one or more groups:
99113

100114
Preference | Dependency | Preview
101115
-|-|-
102-
[`RingtonePreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#ringtonepreference) | `compile 'com.takisoft.fix:preference-v7-ringtone:27.1.1.2'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/ringtone_api26.png)
103-
[`DatePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#datepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:27.1.1.2'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/datepicker_api26.png)
104-
[`TimePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#timepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:27.1.1.2'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/timepicker_api26.png)
105-
[`ColorPickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#colorpickerpreference) | `compile 'com.takisoft.fix:preference-v7-colorpicker:27.1.1.2'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/colorpicker_api26_fixed.png)
106-
[`SimpleMenuPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#simplemenupreference) | `compile 'com.takisoft.fix:preference-v7-simplemenu:27.1.1.2'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/simplemenu_api26.png)
116+
[`RingtonePreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#ringtonepreference) | `compile 'com.takisoft.fix:preference-v7-ringtone:28.0.0.0-alpha3'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/ringtone_api26.png)
117+
[`DatePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#datepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:28.0.0.0-alpha3'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/datepicker_api26.png)
118+
[`TimePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#timepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:28.0.0.0-alpha3'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/timepicker_api26.png)
119+
[`ColorPickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#colorpickerpreference) | `compile 'com.takisoft.fix:preference-v7-colorpicker:28.0.0.0-alpha3'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/colorpicker_api26_fixed.png)
120+
[`SimpleMenuPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#simplemenupreference) | `compile 'com.takisoft.fix:preference-v7-simplemenu:28.0.0.0-alpha3'` | ![API 26](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/simplemenu_api26.png)
107121

108122
---
109123

@@ -149,7 +163,7 @@ The original implementation uses `?attr/textAppearanceSmall` as the message styl
149163
---
150164

151165
## Version
152-
The current stable version is **27.1.1.2**.
166+
The current stable version is **28.0.0.0-alpha3**.
153167

154168
## Notes #
155169
This demo / bugfix is set to work on API level 14+.
@@ -168,13 +182,36 @@ API 15 | API 21 | API 26
168182

169183
### Changelog
170184

185+
**2018-07-18**
186+
187+
New version: 28.0.0.0-alpha3 (based on v28.0.0-alpha3)
188+
189+
- No support preferences related changes in the support library.
190+
- `PreferenceFragmentCompatDividers` is now deprecated. Use `PreferenceFragmentCompat` instead.
191+
- Added `preference-v7-material` module which provides `Theme.MaterialComponents` related themes.
192+
- Bug fixes #166, #169, #173
193+
171194
**2018-07-04**
172195

173196
New version: 27.1.1.2 (based on v27.1.1)
174197

175198
- No support preferences related changes in the support library.
176199
- RingtonePreference bug fixes(#164, #165, #167).
177200

201+
**2018-05-11**
202+
203+
New version: 27.1.1.1 (based on v27.1.1)
204+
205+
- No support preferences related changes in the support library.
206+
- Bug fixes (#153, #149, #155, #152).
207+
208+
**2018-04-10**
209+
210+
New version: 27.1.1.0 (based on v27.1.1)
211+
212+
- No support preferences related changes in the support library.
213+
- Some bug fixes (see #147 for more info).
214+
178215
> For older changelogs, check out the [CHANGELOG](CHANGELOG.md) file.
179216
180217
Feel free to ask / suggest anything on this page by creating a ticket (*issues*)!

app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ android {
1010
targetSdkVersion rootProject.sdkVersion
1111
versionCode 1
1212
versionName "1.0"
13+
multiDexEnabled true
1314
}
1415
buildTypes {
1516
release {
@@ -20,7 +21,8 @@ android {
2021
}
2122

2223
dependencies {
24+
implementation 'com.android.support:multidex:1.0.3'
2325
implementation "com.android.support:appcompat-v7:${rootProject.supportLibraryVersion}"
24-
implementation project(':preference-v7')
26+
implementation project(':preference-v7-material')
2527
implementation project(':preference-v7-extras')
2628
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1010

1111
<application
12+
android:name=".MyApplication"
1213
android:allowBackup="true"
1314
android:icon="@mipmap/ic_launcher"
1415
android:label="@string/app_name"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package com.takisoft.preferencefix;
2+
3+
import android.support.multidex.MultiDexApplication;
4+
5+
public class MyApplication extends MultiDexApplication {
6+
}

app/src/main/java/com/takisoft/preferencefix/MyPreferenceFragment.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
import android.support.annotation.Nullable;
66
import android.support.v7.preference.Preference;
77
import android.support.v7.preference.PreferenceCategory;
8-
import android.view.LayoutInflater;
9-
import android.view.View;
10-
import android.view.ViewGroup;
118

129
import com.takisoft.fix.support.v7.preference.EditTextPreference;
13-
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompatDividers;
10+
import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat;
1411

1512
/**
1613
* A placeholder fragment containing a simple view.
1714
*/
18-
public class MyPreferenceFragment extends PreferenceFragmentCompatDividers {
15+
public class MyPreferenceFragment extends PreferenceFragmentCompat {
1916

2017
@Override
2118
public void onCreatePreferencesFix(@Nullable Bundle savedInstanceState, String rootKey) {
@@ -30,7 +27,7 @@ public void onCreatePreferencesFix(@Nullable Bundle savedInstanceState, String r
3027

3128
Preference prefEmptyCheck = findPreference("pref_empty_check");
3229

33-
if(prefEmptyCheck != null) {
30+
if (prefEmptyCheck != null) {
3431
prefEmptyCheck.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
3532
@Override
3633
public boolean onPreferenceChange(Preference preference, Object newValue) {
@@ -46,16 +43,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
4643
}
4744
}
4845

49-
@Override
50-
public View onCreateView(LayoutInflater inflater, ViewGroup container, @Nullable Bundle savedInstanceState) {
51-
try {
52-
return super.onCreateView(inflater, container, savedInstanceState);
53-
} finally {
54-
// Uncomment this if you want to change the divider style
55-
// setDividerPreferences(DIVIDER_OFFICIAL);
56-
}
57-
}
58-
5946
private void testDynamicPrefs() {
6047
final Context ctx = getPreferenceManager().getContext(); // this is the material styled context
6148

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources>
22
<!-- Base application theme. -->
3-
<style name="Theme.MyTheme" parent="@style/PreferenceFixTheme.Light.NoActionBar">
3+
<style name="Theme.MyTheme" parent="@style/PreferenceFixTheme.MaterialComponents.Light.NoActionBar">
44
<item name="colorAccent">@color/accent</item>
55
<item name="colorPrimary">@color/primary</item>
66
<item name="colorPrimaryDark">@color/primary_dark</item>

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
project.ext.buildToolsVersion = '27.0.3'
2+
project.ext.buildToolsVersion = '28.0.0'
33
project.ext.minSdkVersion = 14
4-
project.ext.sdkVersion = 27
5-
project.ext.supportLibraryVersion = '27.1.1'
6-
project.ext.supportLibraryVersionPrefix = '27.1.1'
7-
project.ext.supportLibraryVersionSuffix = ''
8-
project.ext.fixLibraryVersion = '2'
4+
project.ext.sdkVersion = 28
5+
project.ext.supportLibraryVersion = '28.0.0-alpha3'
6+
project.ext.supportLibraryVersionPrefix = '28.0.0'
7+
project.ext.supportLibraryVersionSuffix = '-alpha3'
8+
project.ext.fixLibraryVersion = '0'
99

1010
project.ext.extrasLibraryVersionSuffix = ''
1111

@@ -16,7 +16,7 @@ buildscript {
1616
google()
1717
}
1818
dependencies {
19-
classpath 'com.android.tools.build:gradle:3.2.0-beta02'
19+
classpath 'com.android.tools.build:gradle:3.2.0-beta03'
2020
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
2121
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
2222

preference-v7-colorpicker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ext {
4747
dependencies {
4848
implementation project(':preference-v7')
4949
implementation "com.android.support:appcompat-v7:${rootProject.supportLibraryVersion}"
50-
api 'com.takisoft.fix:colorpicker:1.0.4'
50+
api 'com.takisoft.fix:colorpicker:1.0.5-alpha3'
5151
}
5252

5353
//apply from: 'https://raw.githubusercontent.com/numetriclabz/jcenter/master/installv.gradle'

preference-v7-datetimepicker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ext {
4444

4545
dependencies {
4646
implementation project(':preference-v7')
47-
api 'com.takisoft.fix:datetimepicker:1.0.6'
47+
api 'com.takisoft.fix:datetimepicker:1.0.7-alpha3'
4848
}
4949

5050
//apply from: 'https://raw.githubusercontent.com/numetriclabz/jcenter/master/installv.gradle'

0 commit comments

Comments
 (0)