File tree 5 files changed +9
-21
lines changed
java/com/github/xubo/ceilinglayout/sample
5 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 1
1
## 1、描述
2
2
** ` CeilingLayout ` 用来控制子View的吸顶联滑,目前支持联滑控件:` NestedScrollView ` 、` RecyclerView ` 、` SmartRefreshLayout ` ;只需要在xml里配置需要吸顶子View的位置索引就能自动实现吸顶联滑效果。**
3
3
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
-
9
4
## 2、模型图
10
5
` CeilingLayout ` 是` LinearLayout ` 的子类,使用方法与竖向` LinearLayout ` 一致。
11
6
43
38
</com .github.xubo.statuslayout.StatusLayout>
44
39
```
45
40
41
+ | 示例|
42
+ | :---:|
43
+ | <img src =" https://github.com/pirrip90/CeilingLayout/blob/master/screen/screen2.gif " width = " 300 " height = " 617 " /> |
44
+
46
45
## 5、gradle
47
46
add the dependency:
48
47
``` gradle
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public class MainActivity extends AppCompatActivity {
26
26
protected void onCreate (Bundle savedInstanceState ) {
27
27
super .onCreate (savedInstanceState );
28
28
setContentView (R .layout .activity_main );
29
- Utils .setColorLight (this , Color .parseColor ("#303F9F" ));
29
+ Utils .setColor (this , Color .parseColor ("#303F9F" ));
30
30
ActionBar actionBar = getSupportActionBar ();
31
31
if (actionBar != null ) {
32
32
actionBar .hide ();
Original file line number Diff line number Diff line change @@ -82,17 +82,11 @@ public static int getScreenWidth(Context context) {
82
82
* @param activity
83
83
* @param color
84
84
*/
85
- public static void setColorLight (Activity activity , @ ColorInt int color ) {
85
+ public static void setColor (Activity activity , @ ColorInt int color ) {
86
86
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 );
96
90
}
97
91
}
98
92
}
Original file line number Diff line number Diff line change 15
15
android : textColor =" #FFFFFF"
16
16
android : textSize =" 17sp" />
17
17
18
- <View
19
- android : layout_width =" match_parent"
20
- android : layout_height =" 1.0dp"
21
- android : background =" #EEEEEE" />
22
-
23
18
<com .github.xubo.ceilinglayout.CeilingLayout
24
19
android : layout_width =" match_parent"
25
20
android : layout_height =" match_parent"
You can’t perform that action at this time.
0 commit comments