Skip to content

Commit 2b7aaa6

Browse files
author
llijingjing
committed
共用头部且滚动中固定导航栏的布局和图片
1 parent 83d0127 commit 2b7aaa6

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<category android:name="android.intent.category.LAUNCHER" />
1717
</intent-filter>
1818
</activity>
19+
<activity
20+
android:name=".SimpleActivity">
21+
22+
</activity>
1923
</application>
2024

2125
</manifest>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
tools:context=".TestActivity">
7+
8+
<com.library.StickHeaderViewPager
9+
android:id="@+id/shvp_content"
10+
android:layout_width="match_parent"
11+
android:layout_height="match_parent" >
12+
13+
<ImageView
14+
android:id="@+id/iv_headerImage"
15+
android:layout_width="match_parent"
16+
android:layout_height="200dp"
17+
android:src="@mipmap/bg_simple_header"
18+
android:scaleType="centerInside"/>
19+
20+
<TextView
21+
android:id="@+id/tv_stick"
22+
android:layout_width="match_parent"
23+
android:layout_height="50dp"
24+
android:gravity="center_vertical"
25+
android:paddingLeft="10dp"
26+
android:background="#657232"
27+
android:text="This is a simple demo!"
28+
/>
29+
</com.library.StickHeaderViewPager>
30+
</RelativeLayout>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<com.library.scroll.NotifyingListenerScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:fillViewport="true"
6+
android:scrollbars="none"
7+
tools:context="com.stickyheaderviewpager.ScrollViewSimpleFragment">
8+
9+
<LinearLayout
10+
android:id="@+id/ly_content"
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:orientation="vertical"
14+
android:paddingTop="20dp"
15+
android:paddingBottom="20dp"
16+
android:paddingLeft="10dp"
17+
android:paddingRight="10dp" >
18+
19+
<TextView
20+
android:id="@+id/tv_title"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:textSize="20sp"
24+
android:layout_marginTop="10dp"
25+
android:gravity="center_horizontal"
26+
android:textColor="@android:color/black" />
27+
28+
<TextView
29+
android:id="@+id/tv_data"
30+
android:layout_width="match_parent"
31+
android:layout_height="wrap_content"
32+
android:textSize="16sp"
33+
android:gravity="center_horizontal"
34+
android:layout_marginTop="8dp"
35+
android:layout_gravity="center_horizontal"
36+
android:textColor="@android:color/black" />
37+
38+
39+
40+
41+
</LinearLayout>
42+
43+
</com.library.scroll.NotifyingListenerScrollView>
Loading

0 commit comments

Comments
 (0)