Skip to content

Commit

Permalink
1. fix Call requires API level 17 (current min is 14): android.view.V…
Browse files Browse the repository at this point in the history
…iew#getDisplay

2. update readme
  • Loading branch information
AllenCoder committed Dec 3, 2018
1 parent 94b86be commit 6c613fb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@
然后在dependencies添加:
```
dependencies {
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v1.9.7'
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.42'
}
```
## [androidX 迁移库版本](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/releases/tag/2.9.43-alpha1)

# 如何使用它来创建Adapter?
![demo](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/blob/master/demo_res/item_view.png)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Powerful and flexible RecyclerAdapter,
Please feel free to use this. (Welcome to **Star** and **Fork**)

kotlin demo :[BRVAH_kotlin](https://github.com/AllenCoder/BRVAH_kotlin)

## [androidX refactoring migration version, temporarily unstable](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/releases/tag/2.9.43-alpha1)
# Document
- [English](https://github.com/CymChad/BaseRecyclerViewAdapterHelper/wiki)
- [中文](http://www.jianshu.com/p/b343fcff51b0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.chad.baserecyclerviewadapterhelper.decoration;

import android.graphics.Rect;
import android.os.Build;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.DisplayMetrics;
Expand Down Expand Up @@ -115,7 +116,9 @@ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, Recycle

private void transformGapDefinition(RecyclerView parent, int spanCount) {
DisplayMetrics displayMetrics = new DisplayMetrics();
parent.getDisplay().getMetrics(displayMetrics);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
parent.getDisplay().getMetrics(displayMetrics);
}
gapHSizePx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, gapHorizontalDp, displayMetrics);
gapVSizePx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, gapVerticalDp, displayMetrics);
sectionEdgeHPaddingPx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, sectionEdgeHPaddingDp, displayMetrics);
Expand Down

0 comments on commit 6c613fb

Please sign in to comment.