yue布局

来源:互联网 发布:一直播怎么开通知提醒 编辑:程序博客网 时间:2024/04/30 07:13


MainActivity


<?xml version="1.0" encoding="utf-8"?>

<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="animtest.com.example.e531.yuekao_test_demo.MainActivity">


    <android.support.v4.widget.DrawerLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/mydrawer">


        <!--主内容区域-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">


            <RadioGroup
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:id="@+id/rel_navigate"
                android:layout_alignParentBottom="true">
                <RadioButton
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="首页"
                    android:button="@null"
                    android:gravity="center"
                    android:id="@+id/rb_index"
                    android:padding="3dp"
                    android:background="@drawable/rb_selector"
                    android:checked="true"/>
                <RadioButton
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="视频"
                    android:button="@null"
                    android:padding="3dp"
                    android:gravity="center"
                    android:id="@+id/rb_video"
                    android:background="@drawable/rb_selector"/>
                <RadioButton
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="微头条"
                    android:button="@null"
                    android:gravity="center"
                    android:padding="3dp"
                    android:id="@+id/rb_top"
                    android:background="@drawable/rb_selector"/>
                <RadioButton
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="我的"
                    android:padding="3dp"
                    android:button="@null"
                    android:gravity="center"
                    android:id="@+id/rb_me"
                    android:background="@drawable/rb_selector"/>


            </RadioGroup>


            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_above="@id/rel_navigate"
                android:id="@+id/main_content"></FrameLayout>




        </RelativeLayout>


        <RelativeLayout
            android:layout_width="260dp"
            android:layout_height="match_parent"
            android:id="@+id/rel_menu"
            android:layout_gravity="start"
            android:background="#550000ff">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/ic_launcher"
                android:id="@+id/img_title"
                android:layout_marginBottom="50dp"/>


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="这是侧边栏"
                android:layout_below="@+id/img_title"/>
        </RelativeLayout>


    </android.support.v4.widget.DrawerLayout>


</RelativeLayout>


content_layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">


    <animtest.com.example.e531.yuekao_test_demo.view.XListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/xlv">
    </animtest.com.example.e531.yuekao_test_demo.view.XListView>

</LinearLayout>




index_layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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">


    <android.support.design.widget.TabLayout
        android:layout_width="match_parent"
        android:layout_height="40dp"
        app:tabGravity="center"
        app:tabIndicatorColor="@color/colorAccent"
        app:tabMode="scrollable"
        app:tabSelectedTextColor="@color/colorPrimaryDark"
        app:tabTextColor="@color/colorPrimary"
        android:id="@+id/mytab"></android.support.design.widget.TabLayout>


    <android.support.v4.view.ViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/vp"></android.support.v4.view.ViewPager>


</LinearLayout>



item


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent">


    <ImageView
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:id="@+id/img"/>


    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/tv_title"/>


</LinearLayout>


                                                                              me_layout



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    >


    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/tv"
        android:text="这是我页面"
        android:textColor="#f00"
        />


</LinearLayout>




top_layout


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    >


    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/tv"
        android:text="这是头条页面"
        android:textColor="#f00"
        />


</LinearLayout>




                                                                                      video_layout



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center">


    <TextView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/tv"
        android:text="这是视频页面"
        android:textColor="#f00"
        />


</LinearLayout>





xlistview_footer


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >


    <RelativeLayout
        android:id="@+id/xlistview_footer_content"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="10dp" >


        <ProgressBar
            android:id="@+id/xlistview_footer_progressbar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:visibility="invisible" />


        <TextView
            android:id="@+id/xlistview_footer_hint_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="@string/xlistview_footer_hint_normal" />
    </RelativeLayout>


</LinearLayout>



xlistview_header



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="bottom" >


    <RelativeLayout
        android:id="@+id/xlistview_header_content"
        android:layout_width="fill_parent"
        android:layout_height="60dp" >


        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:orientation="vertical" android:id="@+id/xlistview_header_text">


            <TextView
                android:id="@+id/xlistview_header_hint_textview"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/xlistview_header_hint_normal" />


            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="3dp" >


                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/xlistview_header_last_time"
                    android:textSize="12sp" />


                <TextView
                    android:id="@+id/xlistview_header_time"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="12sp" />
            </LinearLayout>
        </LinearLayout>


        <ImageView
            android:id="@+id/xlistview_header_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@id/xlistview_header_text"
            android:layout_centerVertical="true"
            android:layout_marginLeft="-35dp"
            android:src="@drawable/xlistview_arrow" />


        <ProgressBar
            android:id="@+id/xlistview_header_progressbar"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_alignLeft="@id/xlistview_header_text"
            android:layout_centerVertical="true"
            android:layout_marginLeft="-40dp"
            android:visibility="invisible" />
    </RelativeLayout>


</LinearLayout>



   <string name="app_name">XListView</string>
    <string name="xlistview_header_hint_normal">下拉刷新</string>
    <string name="xlistview_header_hint_ready">松开刷新数据</string>
    <string name="xlistview_header_hint_loading">正在加载...</string>
    <string name="xlistview_header_last_time">上次更新时间:</string>
    <string name="xlistview_footer_hint_normal">查看更多</string>
    <string name="xlistview_footer_hint_ready">松开载入更多</string>


<uses-permission android:name="android.permission.INTERNET"></uses-permission>

apply plugin: 'com.android.application'

原创粉丝点击