GeezerVison is showing github.com — 完成 StoreHouseHeader 样式 · StandOpen/SmartRefreshLayout@df3fc9e
File tree
Expand file treeCollapse file tree
Open diff view settings
java/com/scwang/refreshlayout/activity/style
java/com/scwang/smartrefresh/header
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,7 +42,7 @@ private enum Item { |
42 | 42 | @Override |
43 | 43 | protected void onCreate(Bundle savedInstanceState) { |
44 | 44 | super.onCreate(savedInstanceState); |
45 | | - setContentView(R.layout.activity_style_fungame_hitblock); |
| 45 | + setContentView(R.layout.activity_style_storehouse); |
46 | 46 |
|
47 | 47 | mToolbar = (Toolbar)findViewById(R.id.toolbar); |
48 | 48 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { |
|
Collapse file
Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_style_storehouse.xml +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
22 | 22 | android:layout_width="match_parent" |
23 | 23 | android:layout_height="wrap_content" |
24 | 24 | android:paddingTop="25dp" |
25 | | - android:paddingBottom="25dp"/> |
| 25 | + android:paddingBottom="25dp" |
| 26 | + app:shhText="SmartRefreshLayout" |
| 27 | + app:shhLineWidth="2dp"/> |
26 | 28 | <android.support.v7.widget.RecyclerView |
27 | 29 | android:id="@+id/recycler" |
28 | 30 | android:layout_width="match_parent" |
|
Collapse file
Copy file name to clipboardExpand all lines: refresh-header/src/main/java/com/scwang/smartrefresh/header/StoreHouseHeader.java +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -76,6 +76,7 @@ private void initView(Context context, AttributeSet attrs, int defStyleAttr) { |
76 | 76 | setTextColor(0xffcccccc); |
77 | 77 |
|
78 | 78 | TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.StoreHouseHeader); |
| 79 | + mLineWidth = ta.getDimensionPixelOffset(R.styleable.StoreHouseHeader_shhLineWidth, mLineWidth); |
79 | 80 | if (ta.hasValue(R.styleable.StoreHouseHeader_shhText)) { |
80 | 81 | initWithString(ta.getString(R.styleable.StoreHouseHeader_shhText)); |
81 | 82 | } else { |
@@ -274,13 +275,13 @@ public void onDraw(Canvas canvas) { |
274 | 275 |
|
275 | 276 | @Override |
276 | 277 | public void onPullingDown(float percent, int offset, int headHeight, int extendHeight) { |
277 | | - setProgress(percent); |
| 278 | + setProgress(percent * .8f); |
278 | 279 | invalidate(); |
279 | 280 | } |
280 | 281 |
|
281 | 282 | @Override |
282 | 283 | public void onReleasing(float percent, int offset, int headHeight, int extendHeight) { |
283 | | - setProgress(percent); |
| 284 | + setProgress(percent * .8f); |
284 | 285 | invalidate(); |
285 | 286 | } |
286 | 287 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: refresh-header/src/main/res/values/attrs.xml +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
62 | 62 |
|
63 | 63 | <declare-styleable name="StoreHouseHeader"> |
64 | 64 | <attr name="shhText" format="string" /> |
| 65 | + <attr name="shhLineWidth" format="dimension" /> |
65 | 66 | </declare-styleable> |
66 | 67 |
|
67 | 68 |
|
|