Skip to content

Commit 263e751

Browse files
author
xubo
committed
readme modify
1 parent fa5489d commit 263e751

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
## 1、描述
22
**`CeilingLayout`用来控制子View的吸顶联滑,目前支持联滑控件:`NestedScrollView``RecyclerView``SmartRefreshLayout`;只需要在xml里配置需要吸顶子View的位置索引就能自动实现吸顶联滑效果。**
33

4-
|示例|
5-
|:---:|
6-
| <div align="left"><img src="https://github.com/pirrip90/CeilingLayout/blob/master/screen/screen2.gif" width = "300" height = "617"/></div> |
7-
8-
94
## 2、模型图
105
`CeilingLayout``LinearLayout`的子类,使用方法与竖向`LinearLayout`一致。
116

@@ -43,6 +38,10 @@
4338
</com.github.xubo.statuslayout.StatusLayout>
4439
```
4540

41+
|示例|
42+
|:---:|
43+
| <img src="https://github.com/pirrip90/CeilingLayout/blob/master/screen/screen2.gif" width = "300" height = "617"/> |
44+
4645
## 5、gradle
4746
add the dependency:
4847
```gradle

app/src/main/java/com/github/xubo/ceilinglayout/sample/MainActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class MainActivity extends AppCompatActivity {
2626
protected void onCreate(Bundle savedInstanceState) {
2727
super.onCreate(savedInstanceState);
2828
setContentView(R.layout.activity_main);
29-
Utils.setColorLight(this, Color.parseColor("#303F9F"));
29+
Utils.setColor(this, Color.parseColor("#303F9F"));
3030
ActionBar actionBar = getSupportActionBar();
3131
if (actionBar != null) {
3232
actionBar.hide();

app/src/main/java/com/github/xubo/ceilinglayout/sample/Utils.java

+4-10
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,11 @@ public static int getScreenWidth(Context context) {
8282
* @param activity
8383
* @param color
8484
*/
85-
public static void setColorLight(Activity activity, @ColorInt int color) {
85+
public static void setColor(Activity activity, @ColorInt int color) {
8686
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
87-
Window window = activity.getWindow();
88-
//状态栏字符颜色为深色
89-
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
90-
//使状态栏导航栏可绘制
91-
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
92-
//清除FLAG_TRANSLUCENT_STATUS
93-
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
94-
//设置状态栏颜色
95-
window.setStatusBarColor(color);
87+
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
88+
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
89+
activity.getWindow().setStatusBarColor(color);
9690
}
9791
}
9892
}

app/src/main/res/layout/activity_main.xml

-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
android:textColor="#FFFFFF"
1616
android:textSize="17sp"/>
1717

18-
<View
19-
android:layout_width="match_parent"
20-
android:layout_height="1.0dp"
21-
android:background="#EEEEEE"/>
22-
2318
<com.github.xubo.ceilinglayout.CeilingLayout
2419
android:layout_width="match_parent"
2520
android:layout_height="match_parent"

screen/screen2.gif

1020 KB
Loading

0 commit comments

Comments
 (0)