|
1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | | -<layout |
3 | | - xmlns:android="http://schemas.android.com/apk/res/android" |
4 | | - xmlns:app="http://schemas.android.com/apk/res-auto"> |
| 2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto"> |
5 | 4 |
|
6 | 5 | <data> |
7 | | - <variable name="userModel" type="com.fmt.github.user.model.UserModel"/> |
| 6 | + |
| 7 | + <variable |
| 8 | + name="userModel" |
| 9 | + type="com.fmt.github.user.model.UserModel" /> |
8 | 10 | </data> |
9 | 11 |
|
10 | 12 | <androidx.coordinatorlayout.widget.CoordinatorLayout |
| 13 | + android:layout_width="match_parent" |
| 14 | + android:layout_height="match_parent" |
| 15 | + android:fitsSystemWindows="true"> |
| 16 | + |
| 17 | + <com.google.android.material.appbar.AppBarLayout |
| 18 | + android:id="@+id/app_bar" |
11 | 19 | android:layout_width="match_parent" |
12 | | - android:layout_height="match_parent" |
| 20 | + android:layout_height="wrap_content" |
13 | 21 | android:fitsSystemWindows="true"> |
14 | 22 |
|
15 | | - <com.google.android.material.appbar.AppBarLayout |
16 | | - android:id="@+id/app_bar" |
| 23 | + <com.google.android.material.appbar.CollapsingToolbarLayout |
17 | 24 | android:layout_width="match_parent" |
18 | 25 | android:layout_height="wrap_content" |
19 | | - android:fitsSystemWindows="true"> |
| 26 | + app:contentScrim="@color/colorPrimary" |
| 27 | + app:layout_scrollFlags="scroll|exitUntilCollapsed"> |
20 | 28 |
|
21 | | - <com.google.android.material.appbar.CollapsingToolbarLayout |
| 29 | + <LinearLayout |
22 | 30 | android:layout_width="match_parent" |
23 | 31 | android:layout_height="wrap_content" |
24 | | - app:layout_scrollFlags="scroll|exitUntilCollapsed" |
25 | | - app:contentScrim="@color/colorPrimary"> |
26 | | - |
27 | | - <LinearLayout |
28 | | - android:layout_width="match_parent" |
29 | | - android:layout_height="wrap_content" |
30 | | - android:orientation="vertical" |
31 | | - android:paddingTop="190dp" |
32 | | - android:paddingBottom="40dp" |
33 | | - android:layout_gravity="center|top" |
34 | | - android:layout_marginLeft="16dp" |
35 | | - android:layout_marginRight="16dp" |
36 | | - android:gravity="center"> |
| 32 | + android:layout_gravity="center|top" |
| 33 | + android:layout_marginLeft="16dp" |
| 34 | + android:layout_marginRight="16dp" |
| 35 | + android:gravity="center" |
| 36 | + android:orientation="vertical" |
| 37 | + android:paddingTop="190dp" |
| 38 | + android:paddingBottom="40dp"> |
37 | 39 |
|
38 | 40 | <TextView |
39 | | - android:layout_width="wrap_content" |
40 | | - android:layout_height="wrap_content" |
41 | | - android:text="HI!" |
42 | | - android:textStyle="bold" |
43 | | - android:textColor="@android:color/white" |
44 | | - android:textSize="30sp"/> |
| 41 | + android:layout_width="wrap_content" |
| 42 | + android:layout_height="wrap_content" |
| 43 | + android:text="HI!" |
| 44 | + android:textColor="@android:color/white" |
| 45 | + android:textSize="30sp" |
| 46 | + android:textStyle="bold" /> |
45 | 47 |
|
46 | 48 | <TextView |
47 | | - android:id="@+id/mIntroduceTv" |
48 | | - android:layout_width="match_parent" |
49 | | - android:layout_height="wrap_content" |
50 | | - android:layout_marginTop="16dp" |
51 | | - android:gravity="center" |
52 | | - android:textSize="16sp" |
53 | | - android:textColor="@android:color/white" |
54 | | - android:text="@{@string/introduce(userModel.login)}"/> |
| 49 | + android:id="@+id/mIntroduceTv" |
| 50 | + android:layout_width="match_parent" |
| 51 | + android:layout_height="wrap_content" |
| 52 | + android:layout_marginTop="16dp" |
| 53 | + android:gravity="center" |
| 54 | + android:text="@{@string/introduce(userModel.login)}" |
| 55 | + android:textColor="@android:color/white" |
| 56 | + android:textSize="16sp" /> |
55 | 57 |
|
56 | 58 | </LinearLayout> |
57 | 59 |
|
58 | 60 | <androidx.appcompat.widget.Toolbar |
59 | | - android:id="@+id/mToolbar" |
60 | | - android:layout_width="match_parent" |
61 | | - android:layout_height="?attr/actionBarSize" |
62 | | - app:navigationIcon="@mipmap/icon_back" |
63 | | - app:layout_collapseMode="pin"/> |
| 61 | + android:id="@+id/mToolbar" |
| 62 | + android:layout_width="match_parent" |
| 63 | + android:layout_height="?attr/actionBarSize" |
| 64 | + app:layout_collapseMode="pin" |
| 65 | + app:navigationIcon="@mipmap/icon_back" /> |
64 | 66 |
|
65 | 67 | </com.google.android.material.appbar.CollapsingToolbarLayout> |
66 | 68 |
|
67 | 69 |
|
68 | 70 | <com.google.android.material.tabs.TabLayout |
69 | | - android:id="@+id/mTabLayout" |
70 | | - android:layout_width="match_parent" |
71 | | - android:layout_height="wrap_content" |
72 | | - app:tabBackground="@color/colorPrimary" |
73 | | - app:tabTextColor="@android:color/white" |
74 | | - app:tabIndicatorColor="@android:color/white" |
75 | | - app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"/> |
| 71 | + android:id="@+id/mTabLayout" |
| 72 | + android:layout_width="match_parent" |
| 73 | + android:layout_height="wrap_content" |
| 74 | + app:tabBackground="@color/colorPrimary" |
| 75 | + app:tabIndicatorColor="@android:color/white" |
| 76 | + app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" |
| 77 | + app:tabTextColor="@android:color/white" /> |
76 | 78 |
|
77 | 79 | </com.google.android.material.appbar.AppBarLayout> |
78 | 80 |
|
79 | | - <androidx.viewpager.widget.ViewPager |
80 | | - android:id="@+id/mViewPager" |
81 | | - android:layout_width="match_parent" |
82 | | - android:layout_height="match_parent" |
83 | | - app:layout_behavior="@string/appbar_scrolling_view_behavior"/> |
| 81 | + <androidx.viewpager2.widget.ViewPager2 |
| 82 | + android:id="@+id/mViewPager" |
| 83 | + android:layout_width="match_parent" |
| 84 | + android:layout_height="match_parent" |
| 85 | + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> |
84 | 86 |
|
85 | 87 | <de.hdodenhof.circleimageview.CircleImageView |
86 | | - android:id="@+id/mUserIconIv" |
87 | | - android:layout_width="120dp" |
88 | | - android:layout_height="120dp" |
89 | | - android:layout_gravity="center|top" |
90 | | - android:layout_marginTop="50dp" |
91 | | - android:elevation="10dp" |
92 | | - app:layout_behavior="@string/simple_view_behavior" |
93 | | - app:behavior_dependsOn="@+id/app_bar" |
94 | | - app:behavior_dependType="y" |
95 | | - app:behavior_dependTarget="-176dp" |
96 | | - app:behavior_targetX="50dp" |
97 | | - app:behavior_targetY="8dp" |
98 | | - app:behavior_targetWidth="40dp" |
99 | | - app:behavior_targetHeight="40dp" |
100 | | - android:transitionName="image" |
101 | | - app:url="@{userModel.avatar_url}"/> |
| 88 | + android:id="@+id/mUserIconIv" |
| 89 | + android:layout_width="120dp" |
| 90 | + android:layout_height="120dp" |
| 91 | + android:layout_gravity="center|top" |
| 92 | + android:layout_marginTop="50dp" |
| 93 | + android:elevation="10dp" |
| 94 | + android:transitionName="image" |
| 95 | + app:behavior_dependTarget="-176dp" |
| 96 | + app:behavior_dependType="y" |
| 97 | + app:behavior_dependsOn="@+id/app_bar" |
| 98 | + app:behavior_targetHeight="40dp" |
| 99 | + app:behavior_targetWidth="40dp" |
| 100 | + app:behavior_targetX="50dp" |
| 101 | + app:behavior_targetY="8dp" |
| 102 | + app:layout_behavior="@string/simple_view_behavior" |
| 103 | + app:url="@{userModel.avatar_url}" /> |
102 | 104 |
|
103 | 105 | <TextView |
104 | | - android:id="@+id/mUserNameTv" |
105 | | - android:layout_width="wrap_content" |
106 | | - android:layout_height="?attr/actionBarSize" |
107 | | - android:text="@{userModel.login}" |
108 | | - android:textSize="18sp" |
109 | | - android:elevation="10dp" |
110 | | - android:layout_marginStart="96dp" |
111 | | - android:layout_marginTop="-100dp" |
112 | | - android:gravity="center_vertical" |
113 | | - android:textColor="@android:color/white" |
114 | | - android:alpha="0" |
115 | | - app:layout_behavior="@string/simple_view_behavior" |
116 | | - app:behavior_dependsOn="@+id/app_bar" |
117 | | - app:behavior_dependType="y" |
118 | | - app:behavior_dependTarget="-206dp" |
119 | | - app:behavior_targetY="0dp" |
120 | | - app:behavior_targetAlpha="1"/> |
| 106 | + android:id="@+id/mUserNameTv" |
| 107 | + android:layout_width="wrap_content" |
| 108 | + android:layout_height="?attr/actionBarSize" |
| 109 | + android:layout_marginStart="96dp" |
| 110 | + android:layout_marginTop="-100dp" |
| 111 | + android:alpha="0" |
| 112 | + android:elevation="10dp" |
| 113 | + android:gravity="center_vertical" |
| 114 | + android:text="@{userModel.login}" |
| 115 | + android:textColor="@android:color/white" |
| 116 | + android:textSize="18sp" |
| 117 | + app:behavior_dependTarget="-206dp" |
| 118 | + app:behavior_dependType="y" |
| 119 | + app:behavior_dependsOn="@+id/app_bar" |
| 120 | + app:behavior_targetAlpha="1" |
| 121 | + app:behavior_targetY="0dp" |
| 122 | + app:layout_behavior="@string/simple_view_behavior" /> |
121 | 123 |
|
122 | 124 |
|
123 | 125 | </androidx.coordinatorlayout.widget.CoordinatorLayout> |
|
0 commit comments