drawable类 有两个xml文件:
第一个xml;
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
>
<solid android:color="#FF0080" /> <!-- 定义填充的颜色值 -->
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<!-- 设置圆角矩形 -->
<corners android:radius="100dp" />
<stroke android:width="2dp" android:color="#FFFF00" />
</shape>
第二个xml:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<!-- 设置圆角矩形 -->
<corners android:radius="1dp" />
<stroke android:width="0.5dp" android:color="#000000" />
</shape>
layout下 有两个xml文件:
第一个主布局:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical"
tools:context="com.example.video_.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|left"
android:paddingLeft="20dp"
android:text="我的频道" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:paddingLeft="10dp"
android:text="长按拖拽替换位置"
android:textSize="15sp" />
<TextView
android:id="@+id/edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/redsharp"
android:gravity="center"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="编辑"
android:textSize="15sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#C0C0C0" />
<android.support.v7.widget.RecyclerView
android:id="@+id/mine_recycleView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#C0C0C0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center|left"
android:paddingLeft="20dp"
android:text="其他频道" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:paddingLeft="10dp"
android:text="点击添加替换我的频道中"
android:textSize="15sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#C0C0C0" />
<android.support.v7.widget.RecyclerView
android:id="@+id/other_recycleView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
第二个xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/channel_rl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:background="@drawable/sharp"
>
<TextView
android:id="@+id/channel_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:text="fdsgfdgdfgdfg"
android:textSize="16sp" />
<TextView
android:id="@+id/delete_tv"
android:layout_width="15dp"
android:layout_height="15dp"
android:background="@mipmap/delete" />
</RelativeLayout>
还要添加一个 点击完成 出现一个图片在文字上面 点击可以位置向下移动