activity_main ;
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.month_four.MainActivity"> <android.support.design.widget.TabLayout android:id="@+id/main_tab" android:layout_width="match_parent" android:layout_height="wrap_content" app:tabBackground="@color/colorPrimary" app:tabGravity="fill" app:tabIndicatorColor="@color/colorAccent" app:tabIndicatorHeight="2dp" app:tabMode="fixed" app:tabSelectedTextColor="@color/colorAccent" app:tabTextColor="#FFF" /> <android.support.v4.view.ViewPager android:id="@+id/main_vp" android:layout_width="match_parent" android:layout_height="match_parent"></android.support.v4.view.ViewPager> </android.support.constraint.ConstraintLayout>
fragment_animation :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.month_four.AnimationFragment"> <ImageView android:id="@+id/anime_iv" android:layout_width="200dp" android:layout_height="200dp" android:layout_centerInParent="true" android:src="@mipmap/ic_launcher" /> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:id="@+id/btn_alpha" android:text="透明度" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" /> <Button android:id="@+id/btn_scale" android:text="放缩" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" /> <Button android:id="@+id/btn_tran" android:text="平移" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" /> <Button android:id="@+id/btn_rotate" android:text="旋转" android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" /> </LinearLayout> </RelativeLayout>
fragment_text :
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.month_four.TextFragment"> <!-- TODO: Update blank fragment layout --> <android.support.v7.widget.RecyclerView android:id="@+id/text_rv" android:layout_width="match_parent" android:layout_height="match_parent" /> </FrameLayout>
fragment_view :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" tools:context="com.example.month_four.ViewFragment"> <com.animee.forthmonth.custom.TitleView android:id="@+id/title1" android:layout_width="match_parent" android:layout_height="60dp" app:bgColor="#009900" app:titleText="标题1"></com.animee.forthmonth.custom.TitleView> <com.animee.forthmonth.custom.TitleView android:layout_width="match_parent" android:layout_height="60dp" app:titleText="标题2" android:layout_marginTop="10dp" app:bgColor="#009900" app:rightIvVisiable="false"></com.animee.forthmonth.custom.TitleView> <com.animee.forthmonth.custom.TitleView android:layout_width="match_parent" android:layout_height="60dp" app:titleText="标题3" app:bgColor="#990000" android:layout_marginTop="10dp" app:leftIvVisiable="false" app:rightIvVisiable="false" app:leftTvVisiable="true" app:rightTvVisiable="true"> </com.animee.forthmonth.custom.TitleView> <com.animee.forthmonth.custom.TitleView android:layout_width="match_parent" android:layout_height="60dp" app:bgColor="#990000" android:layout_marginTop="10dp" app:titleText="标题4" app:leftIvVisiable="false" app:leftTvVisiable="true" app:rightIvRes="@mipmap/mail_folder_type_add_account"></com.animee.forthmonth.custom.TitleView> <com.animee.forthmonth.custom.TitleView android:layout_width="match_parent" android:layout_height="60dp" app:bgColor="#000099" android:layout_marginTop="10dp" app:titleText="标题5" app:leftIvVisiable="false" app:leftTvVisiable="true" app:leftTextColor="#FF0000" app:rightIvRes="@mipmap/mail_folder_type_add_account"> </com.animee.forthmonth.custom.TitleView> <com.animee.forthmonth.custom.TitleView android:layout_width="match_parent" android:layout_height="60dp" app:bgColor="#000099" android:layout_marginTop="10dp" app:titleText="标题6" app:titleTextColor="#000" app:leftIvVisiable="false" app:leftTvVisiable="true" app:leftTextColor="#FF0000" app:rightIvRes="@mipmap/mail_folder_type_draft"></com.animee.forthmonth.custom.TitleView> </LinearLayout>
item_text :
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/baike_des" android:layout_marginTop="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="neirong" /> <ImageView android:background="@color/colorPrimaryDark" android:layout_marginTop="20dp" android:layout_width="match_parent" android:layout_height="1dp" /> </RelativeLayout>
title_layout :
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:id="@+id/title_layout" android:layout_height="match_parent"> <TextView android:id="@+id/center_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="标题一" android:textSize="22sp" android:textColor="#FFFFFF" android:layout_centerInParent="true"/> <ImageView android:id="@+id/left_iv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/icon_title_bar_filter_focus" android:layout_centerVertical="true" android:layout_marginLeft="20dp" android:visibility="invisible"/> <TextView android:id="@+id/left_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="左边" android:textColor="#FFF" android:layout_centerVertical="true" android:layout_marginLeft="20dp" android:textSize="18sp"/> <ImageView android:id="@+id/right_iv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/icon_title_bar_filter_focus" android:layout_centerVertical="true" android:layout_alignParentRight="true" android:layout_marginRight="20dp" android:visibility="invisible"/> <TextView android:id="@+id/right_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="右边" android:textSize="18sp" android:textColor="#FFFFFF" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="20dp"/> </RelativeLayout>