新闻列表的样式表

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

    <ImageView
        android:id="@+id/news_img"
        android:layout_width="100dp"
        android:layout_height="70dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:orientation="vertical">

        <TextView
            android:id="@+id/news_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="标题"
            android:textSize="15dp"
            android:lines="1"
            android:ellipsize="end"/>

        <TextView
            android:id="@+id/news_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="内容"
            android:textSize="10dp"
            android:lines="1"
            android:ellipsize="end"
            android:layout_marginTop="10dp"/>

        <TextView
            android:id="@+id/news_msg"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="msg"
            android:textSize="10dp"
            android:layout_marginTop="10dp"/>

    </LinearLayout>

</LinearLayout>
list条目的类

public class NewsInfoSkip implements Serializable {
    private String image;
    private String title;
    private String content;
    private int id;

    public NewsInfoSkip() {
    }


    public NewsInfoSkip(String image, String title, String content, int id) {
        this.image = image;
        this.title = title;
        this.content = content;
        this.id = id;
    }


    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


}
//个人界面的bean类

public class PersonInfo {

    private int image;
    private String name;
    private int toImg;

    public PersonInfo(int image, String name, int backImg) {
        this.image = image;
        this.name = name;
        this.toImg = backImg;
    }


    public PersonInfo() {
    }



    public int getImage() {
        return image;
    }

    public void setImage(int image) {
        this.image = image;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getBackImg() {
        return toImg;
    }

    public void setBackImg(int backImg) {
        this.toImg = backImg;
    }
}
//个人界面样式表

<?xml version="1.0" encoding="utf-8"?>
<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"
    tools:context=".fragment.home.PersonFragment"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="#00BCD4"
        android:orientation="horizontal">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="个人中心"
            android:textColor="@color/white"
            android:textSize="25dp"
            android:textAlignment="center"/>

    </LinearLayout>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="3"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/person_head_img"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:background="@drawable/ic_head_img"
            android:layout_gravity="center"
            android:layout_marginLeft="20dp"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:layout_gravity="center"
            android:orientation="vertical">

            <TextView
                android:id="@+id/person_nickname"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="立即登录"
                android:textSize="25dp"
                android:layout_marginTop="20dp"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/username_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="账号:"
                    android:layout_marginTop="10dp"
                    android:visibility="gone"/>

                <TextView
                    android:id="@+id/person_username"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="111"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="10dp"
                    android:visibility="gone"/>

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#00BCD4"/>

    <ListView
        android:id="@+id/person_info"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="5"/>

    <Button
        android:id="@+id/person_btn_exit"
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:text="退出登录"
        android:background="#CA3939"
        android:textSize="20dp"
        android:textColor="@color/white"
        android:layout_gravity="center"
        android:layout_marginBottom="50dp"
        android:visibility="gone"/>

</LinearLayout>

//个人中心信息渲染样式表
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/img"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="20dp"/>

    <TextView
        android:id="@+id/person_info_title"
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:text="11"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:textSize="20dp"/>

    <ImageView
        android:id="@+id/to_login"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_marginTop="10dp"/>

</LinearLayout>

//个人界面登录的样式
<?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"
    tools:context=".activity.user.LoginActivity"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:orientation="horizontal"
        android:layout_marginTop="70dp">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:gravity="center"
            android:layout_gravity="center"
            android:text="登录"
            android:textSize="30dp"
            android:layout_marginTop="5dp"/>
    </LinearLayout>

    <EditText
        android:id="@+id/edt_username"
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:background="@drawable/bg_login"
        android:layout_gravity="center"
        android:layout_marginTop="70dp"
        android:hint="请输入账号"
        android:textColor="#000000"
        android:textAlignment="center"
        android:inputType="number"/>

    <EditText
        android:id="@+id/edt_pwd"
        android:layout_width="250dp"
        android:layout_height="50dp"
        android:background="@drawable/bg_login"
        android:layout_gravity="center"
        android:layout_marginTop="30dp"
        android:hint="请输入密码"
        android:textColor="#000000"
        android:textAlignment="center"
        android:inputType="textPassword"/>

    <TextView
        android:id="@+id/reg_judge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="点击注册?"
        android:layout_marginLeft="260dp"
        android:layout_marginTop="40dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginTop="50dp">
        <Button
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:text="登 录"
            android:textColor="@color/white"
            android:background="#CA3939"
            android:textSize="20dp"
            android:layout_gravity="center"
            android:layout_marginLeft="65dp"
            android:onClick="login"/>

        <Button
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:text="返 回"
            android:textColor="@color/white"
            android:background="#CA3939"
            android:textSize="20dp"
            android:layout_gravity="center"
            android:layout_marginLeft="30dp"
            android:onClick="backPerson"/>


    </LinearLayout>




</LinearLayout>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值