Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gregkorossy committed Sep 24, 2017
2 parents 9da9b19 + 22c4562 commit 2cd6d3e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

**2017-09-24**

New version: 26.1.0.2 (based on v26.1.0)

- Quick fix: the app won't crash if the preference XML couldn't be inflated (but it will still display as an empty screen)

**2017-09-24**

New version: 26.1.0.1 (based on v26.1.0)

- Bug fix: crash on API 26 when using dividers and preferences with widgets together
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ compile 'com.android.support:preference-v14:26.1.0'
```
And **add** this single line to your gradle file:
```gradle
compile 'com.takisoft.fix:preference-v7:26.1.0.1'
compile 'com.takisoft.fix:preference-v7:26.1.0.2'
```
> 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.
Expand Down Expand Up @@ -92,17 +92,17 @@ Now you can enjoy using the support preferences API without losing all your hair
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

```gradle
compile 'com.takisoft.fix:preference-v7-extras:26.1.0.1'
compile 'com.takisoft.fix:preference-v7-extras:26.1.0.2'
```

or one or more groups:

Preference | Dependency | Preview
-|-|-
[`RingtonePreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#ringtonepreference) | `compile 'com.takisoft.fix:preference-v7-ringtone:26.1.0.1'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/ringtone_api26.png)
[`DatePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#datepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:26.1.0.1'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/datepicker_api26.png)
[`TimePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#timepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:26.1.0.1'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/timepicker_api26.png)
[`ColorPickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#colorpickerpreference) | `compile 'com.takisoft.fix:preference-v7-colorpicker:26.1.0.1'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/colorpicker_api26_fixed.png)
[`RingtonePreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#ringtonepreference) | `compile 'com.takisoft.fix:preference-v7-ringtone:26.1.0.2'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/ringtone_api26.png)
[`DatePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#datepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:26.1.0.2'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/datepicker_api26.png)
[`TimePickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#timepickerpreference) | `compile 'com.takisoft.fix:preference-v7-datetimepicker:26.1.0.2'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/timepicker_api26.png)
[`ColorPickerPreference`](https://github.com/Gericop/Android-Support-Preference-V7-Fix/wiki/Preference-types#colorpickerpreference) | `compile 'com.takisoft.fix:preference-v7-colorpicker:26.1.0.2'` | ![API 15](https://raw.githubusercontent.com/Gericop/Android-Support-Preference-V7-Fix/master/images/colorpicker_api26_fixed.png)

---

Expand Down Expand Up @@ -148,7 +148,7 @@ The original implementation uses `?attr/textAppearanceSmall` as the message styl
---

## Version
The current stable version is **26.1.0.1**.
The current stable version is **26.1.0.2**.

## Notes #
This demo / bugfix is set to work on API level 14+.
Expand All @@ -169,6 +169,12 @@ API 15 | API 21 | API 26

**2017-09-24**

New version: 26.1.0.2 (based on v26.1.0)

- Quick fix: the app won't crash if the preference XML couldn't be inflated (but it will still display as an empty screen)

**2017-09-24**

New version: 26.1.0.1 (based on v26.1.0)

- Bug fix: crash on API 26 when using dividers and preferences with widgets together
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project.ext.sdkVersion = 26
project.ext.supportLibraryVersion = '26.1.0'
project.ext.supportLibraryVersionPrefix = '26.1.0'
project.ext.supportLibraryVersionSuffix = ''
project.ext.fixLibraryVersion = '1'
project.ext.fixLibraryVersion = '2'

project.ext.extrasLibraryVersionSuffix = ''

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state)

final int first = lm.findFirstVisibleItemPosition();
final int last = lm.findLastVisibleItemPosition();
final int lastInAdapter = parent.getAdapter().getItemCount() - 1;

final int lastInAdapter = lm.getItemCount() - 1;

if (first == RecyclerView.NO_POSITION || last == RecyclerView.NO_POSITION) {
return;
Expand Down Expand Up @@ -341,6 +342,8 @@ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, Recycle
final byte current = getViewType(view);
final byte next;

final LinearLayoutManager lm = (LinearLayoutManager) parent.getLayoutManager();

final int index = parent.indexOfChild(view);
if (index < parent.getChildCount() - 1) {
View viewNext = parent.getChildAt(index + 1);
Expand All @@ -355,7 +358,7 @@ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, Recycle
}

if (hasDividerBelow(current, next)
&& !(parent.getChildAdapterPosition(view) == parent.getAdapter().getItemCount() - 1
&& !(parent.getChildAdapterPosition(view) == lm.getItemCount() - 1
&& (divPrefFlags & DIVIDER_NO_AFTER_LAST) == DIVIDER_NO_AFTER_LAST)) {
outRect.bottom = dividerHeight;
}
Expand Down

0 comments on commit 2cd6d3e

Please sign in to comment.