GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 项目介绍排版 · StandOpen/SmartRefreshLayout@6bcb245

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main
    • java/com/scwang/refreshlayout/activity
      • style
        • ClassicsStyleActivity.java
        • FunGameBattleCityStyleActivity.java
        • FunGameHitBlockStyleActivity.java
        • StoreHouseStyleActivity.java
      • using
        • AssignCodeUsingActivity.java
        • AssignDefaultUsingActivity.java
    • res
      • layout
        • activity_style_classics.xml
        • activity_style_fungame_battlecity.xml
        • activity_style_fungame_hitblock.xml
        • activity_using_assign_xml.xml
      • values
        • colors.xml
        • styles.xml
  • refresh-header/src/main/java/com/scwang/smartrefresh/header
    • FunGameBattleCityHeader.java
    • WaterDropHeader.java
    • fungame
      • FunGameBase.java
    • waterdrop
      • ProgressDrawable.java
  • refresh-layout/src/main
    • java/com/scwang/smartrefresh/layout
      • SmartRefreshLayout.java
      • footer
        • BallPulseFooter.java
        • ClassicsFooter.java
        • ballpulse
          • BallPulseView.java
      • header
        • ClassicsHeader.java
      • internal
        • ProgressDrawable.java
        • pathview
          • Box.java
          • IntegerParser.java
          • Length.java
          • NumberParser.java
          • PathsDrawable.java
          • TextScanner.java
          • Unit.java
    • res/values
      • attrs.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/style/ClassicsStyleActivity.java
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
import com.scwang.refreshlayout.adapter.SmartViewHolder;
1919
import com.scwang.refreshlayout.util.DynamicTimeFormat;
2020
import com.scwang.smartrefresh.layout.api.RefreshLayout;
21+
import com.scwang.smartrefresh.layout.constant.RefreshState;
2122
import com.scwang.smartrefresh.layout.constant.SpinnerStyle;
2223
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
24+
import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener;
2325

2426
import java.text.SimpleDateFormat;
2527
import java.util.Arrays;
@@ -68,7 +70,6 @@ public void onClick(View v) {
6870
});
6971

7072
mRefreshLayout = (RefreshLayout)findViewById(R.id.smart);
71-
mRefreshLayout.autoRefresh();
7273

7374
int deta = new Random().nextInt(7 * 24 * 60 * 60 * 1000);
7475
mClassicsHeader = (ClassicsHeader)mRefreshLayout.getRefreshHeader();
@@ -93,6 +94,20 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position
9394
});
9495
mRecyclerView = recyclerView;
9596
}
97+
98+
//触发上啦加载
99+
mRefreshLayout.autoLoadmore();
100+
//通过多功能监听接口实现 在第一次加载完成之后 自动刷新
101+
mRefreshLayout.setOnMultiPurposeListener(new SimpleMultiPurposeListener(){
102+
@Override
103+
public void onStateChanged(RefreshState oldState, RefreshState state) {
104+
if (oldState == RefreshState.LoadingFinish
105+
&& state == RefreshState.None) {
106+
mRefreshLayout.autoRefresh();
107+
mRefreshLayout.setOnMultiPurposeListener(null);//保准只有第一次关联
108+
}
109+
}
110+
});
96111
}
97112

98113
@Override
Collapse file

‎app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameBattleCityStyleActivity.java
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
public class FunGameBattleCityStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
2626

2727
private enum Item {
28+
默认主题("更改为橙色默认颜色"),
2829
橙色主题("更改为橙色主题颜色"),
2930
红色主题("更改为红色主题颜色"),
3031
绿色主题("更改为绿色主题颜色"),
@@ -75,6 +76,9 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position
7576
@Override
7677
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
7778
switch (Item.values()[position]) {
79+
case 默认主题:
80+
mRefreshLayout.setPrimaryColorsId(android.R.color.white, android.R.color.black);
81+
break;
7882
case 蓝色主题:
7983
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
8084
break;
Collapse file

‎app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/style/FunGameHitBlockStyleActivity.java
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.scwang.refreshlayout.adapter.BaseRecyclerAdapter;
1717
import com.scwang.refreshlayout.adapter.SmartViewHolder;
1818
import com.scwang.smartrefresh.layout.api.RefreshLayout;
19+
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
1920

2021
import java.util.Arrays;
2122

@@ -25,6 +26,7 @@
2526
public class FunGameHitBlockStyleActivity extends AppCompatActivity implements AdapterView.OnItemClickListener {
2627

2728
private enum Item {
29+
默认主题("更改为橙色默认颜色"),
2830
橙色主题("更改为橙色主题颜色"),
2931
红色主题("更改为红色主题颜色"),
3032
绿色主题("更改为绿色主题颜色"),
@@ -54,6 +56,12 @@ public void onClick(View v) {
5456

5557
mRefreshLayout = (RefreshLayout)findViewById(R.id.smart);
5658
mRefreshLayout.autoRefresh();
59+
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
60+
@Override
61+
public void onRefresh(RefreshLayout refreshlayout) {
62+
refreshlayout.finishRefresh(4000);
63+
}
64+
});
5765

5866
View view = findViewById(R.id.recycler);
5967
if (view instanceof RecyclerView) {
@@ -75,6 +83,9 @@ protected void onBindViewHolder(SmartViewHolder holder, Item model, int position
7583
@Override
7684
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
7785
switch (Item.values()[position]) {
86+
case 默认主题:
87+
mRefreshLayout.setPrimaryColorsId(android.R.color.white, android.R.color.black);
88+
break;
7889
case 蓝色主题:
7990
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
8091
break;
Collapse file

‎app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/style/StoreHouseStyleActivity.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
9393

9494
private void setThemeColor(int colorPrimary, int colorPrimaryDark) {
9595
mToolbar.setBackgroundResource(colorPrimary);
96+
((View)mRefreshLayout).setBackgroundResource(colorPrimary);
9697
mRefreshLayout.setPrimaryColorsId(colorPrimary, android.R.color.white);
9798
if (Build.VERSION.SDK_INT >= 21) {
9899
getWindow().setStatusBarColor(ContextCompat.getColor(this, colorPrimaryDark));
Collapse file

‎app/src/main/java/com/scwang/refreshlayout/activity/using/AssignCodeUsingActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/using/AssignCodeUsingActivity.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public void onStateChanged(RefreshState oldState, RefreshState state) {
5858
}
5959
}
6060
});
61+
6162
}
6263

6364
}
Collapse file

‎app/src/main/java/com/scwang/refreshlayout/activity/using/AssignDefaultUsingActivity.java‎

Copy file name to clipboardExpand all lines: app/src/main/java/com/scwang/refreshlayout/activity/using/AssignDefaultUsingActivity.java
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.scwang.smartrefresh.layout.api.RefreshHeader;
1616
import com.scwang.smartrefresh.layout.api.RefreshLayout;
1717
import com.scwang.smartrefresh.layout.constant.RefreshState;
18+
import com.scwang.smartrefresh.layout.constant.SpinnerStyle;
1819
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
1920
import com.scwang.smartrefresh.layout.header.ClassicsHeader;
2021
import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener;
@@ -36,16 +37,19 @@ public AssignDefaultUsingActivity() {
3637
@Override
3738
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
3839
layout.setPrimaryColorsId(R.color.colorPrimary, android.R.color.white);//创建同时可以先设置主题颜色
39-
((View) layout).setBackgroundResource(R.color.colorPrimary);
40-
return new ClassicsHeader(context);//指定为经典Header,默认是 贝塞尔雷达Header
40+
((View) layout).setBackgroundResource(R.color.colorPrimary);//设置刷新布局的背景融合Header主题色
41+
return new ClassicsHeader(context).setSpinnerStyle(SpinnerStyle.FixedBehind);//指定为经典Header,默认是 贝塞尔雷达Header
4142
}
4243
});
4344
//设置全局的Footer构建器
4445
SmartRefreshLayout.setDefaultRefreshFooterCreater(new DefaultRefreshFooterCreater() {
4546
@NonNull
4647
@Override
4748
public RefreshFooter createRefreshFooter(Context context, RefreshLayout layout) {
48-
return new ClassicsFooter(context);//指定为经典Footer,默认是 BallPulseFooter
49+
ClassicsFooter footer = new ClassicsFooter(context);
50+
footer.setBackgroundResource(android.R.color.white);
51+
footer.setSpinnerStyle(SpinnerStyle.Scale);//设置为拉伸模式
52+
return footer;//指定为经典Footer,默认是 BallPulseFooter
4953
}
5054
});
5155
}
Collapse file

‎app/src/main/res/layout/activity_style_classics.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_style_classics.xml
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
tools:listitem="@android:layout/simple_list_item_2"/>
3131
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
3232
android:layout_width="match_parent"
33-
android:layout_height="wrap_content"/>
33+
android:layout_height="wrap_content"
34+
app:srlClassicsSpinnerStyle="Scale"
35+
android:background="@android:color/white"/>
3436
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
3537

3638
</LinearLayout>
Collapse file

‎app/src/main/res/layout/activity_style_fungame_battlecity.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_style_fungame_battlecity.xml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
android:id="@+id/smart"
1717
android:layout_width="match_parent"
1818
android:layout_height="match_parent"
19-
app:srlEnableHeaderTranslationContent="true"
19+
app:srlPrimaryColor="@color/colorPrimary"
20+
app:srlAccentColor="@android:color/white"
2021
app:srlEnableLoadmore="false">
2122
<com.scwang.smartrefresh.header.FunGameBattleCityHeader
2223
android:layout_width="match_parent"
Collapse file

‎app/src/main/res/layout/activity_style_fungame_hitblock.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_style_fungame_hitblock.xml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
android:id="@+id/smart"
1717
android:layout_width="match_parent"
1818
android:layout_height="match_parent"
19-
app:srlEnableLoadmore="false"
20-
app:srlEnableHeaderTranslationContent="true">
19+
app:srlPrimaryColor="@color/colorPrimary"
20+
app:srlAccentColor="@android:color/white"
21+
app:srlEnableLoadmore="false">
2122
<com.scwang.smartrefresh.header.FunGameHitBlockHeader
2223
android:layout_width="match_parent"
2324
android:layout_height="match_parent"/>
Collapse file

‎app/src/main/res/layout/activity_using_assign_xml.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/activity_using_assign_xml.xml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
3636
android:layout_width="match_parent"
3737
android:layout_height="wrap_content"
38+
app:srlAccentColor="@android:color/white"
3839
app:srlClassicsSpinnerStyle="FixedBehind"/>
3940
<!--FixedBehind可以让Footer固定在内容的背后,下拉的时候效果同微信浏览器的效果-->
4041
</com.scwang.smartrefresh.layout.SmartRefreshLayout>

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.