2024.2.16 记账本app开发(八)
主页列表显示记账记录和顶部图表等页面绘制:
记账列表记录:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp"
android:background="@color/white">
<ImageView
android:id="@+id/item_mainlv_iv"
android:layout_width="45dp"
android:layout_height="45dp"
android:src="@mipmap/ic_yanjiu_fs">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/item_mainlv_iv"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/item_mainlv_tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="烟酒茶"
android:textStyle="bold"
android:textSize="16sp">
</TextView>
<TextView
android:id="@+id/item_mainlv_tv_beizhu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="茅台一箱"
android:layout_marginTop="5dp"
android:textSize="12sp">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="@+id/item_mainlv_tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥500.0"
android:textStyle="bold">
</TextView>
<TextView
android:id="@+id/item_mainlv_tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="今天18:10"
android:layout_marginTop="5dp">
</TextView>
</LinearLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="10dp"
android:background="@color/white">
<ImageView
android:id="@+id/item_mainlv_iv"
android:layout_width="45dp"
android:layout_height="45dp"
android:src="@mipmap/ic_yanjiu_fs">
</ImageView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/item_mainlv_iv"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/item_mainlv_tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="烟酒茶"
android:textStyle="bold"
android:textSize="16sp">
</TextView>
<TextView
android:id="@+id/item_mainlv_tv_beizhu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="茅台一箱"
android:layout_marginTop="5dp"
android:textSize="12sp">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="@+id/item_mainlv_tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥500.0"
android:textStyle="bold">
</TextView>
<TextView
android:id="@+id/item_mainlv_tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="今天18:10"
android:layout_marginTop="5dp">
</TextView>
</LinearLayout>
</RelativeLayout>
顶部图标页面绘制:
<?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:background="@color/grey_f3f3f3">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="20dp">
<TextView
android:id="@+id/item_mainlv_top_tvl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/month_out">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥0"
android:layout_below="@id/item_mainlv_top_tvl"
android:textSize="26sp"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="@color/black">
</TextView>
<ImageView
android:id="@+id/item_mainlv_top_iv_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@mipmap/ih_show"
android:layout_alignTop="@id/item_mainlv_top_tv_out">
</ImageView>
<TextView
android:id="@+id/item_mainlv_top_tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/month_in"
android:layout_below="@id/item_mainlv_top_tv_out">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv_in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="¥ 0"
android:layout_below="@id/item_mainlv_top_tv_out"
android:layout_toRightOf="@id/item_mainlv_top_tv2"
android:layout_marginLeft="5dp">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv_budget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥0"
android:textColor="@color/black"
android:layout_alignParentRight="true"
android:layout_alignBottom="@id/item_mainlv_top_tv2"
android:layout_marginLeft="5dp">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/budget"
android:layout_toLeftOf="@id/item_mainlv_top_tv_budget"
android:layout_alignBottom="@id/item_mainlv_top_tv2">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@mipmap/ih_biaoge"
android:layout_below="@id/item_mainlv_top_tv2"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="@string/seeexcel"
android:textColor="@color/green_006400"
android:drawablePadding="10dp">
</TextView>
</RelativeLayout>
<TextView
android:id="@+id/item_mainlv_top_tv_day"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="今日支出 ¥0 收入 ¥0"
android:textStyle="bold"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp">
</TextView>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey_f3f3f3">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:padding="20dp">
<TextView
android:id="@+id/item_mainlv_top_tvl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/month_out">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥0"
android:layout_below="@id/item_mainlv_top_tvl"
android:textSize="26sp"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="@color/black">
</TextView>
<ImageView
android:id="@+id/item_mainlv_top_iv_hide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@mipmap/ih_show"
android:layout_alignTop="@id/item_mainlv_top_tv_out">
</ImageView>
<TextView
android:id="@+id/item_mainlv_top_tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/month_in"
android:layout_below="@id/item_mainlv_top_tv_out">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv_in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:text="¥ 0"
android:layout_below="@id/item_mainlv_top_tv_out"
android:layout_toRightOf="@id/item_mainlv_top_tv2"
android:layout_marginLeft="5dp">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv_budget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥0"
android:textColor="@color/black"
android:layout_alignParentRight="true"
android:layout_alignBottom="@id/item_mainlv_top_tv2"
android:layout_marginLeft="5dp">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/budget"
android:layout_toLeftOf="@id/item_mainlv_top_tv_budget"
android:layout_alignBottom="@id/item_mainlv_top_tv2">
</TextView>
<TextView
android:id="@+id/item_mainlv_top_tv4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@mipmap/ih_biaoge"
android:layout_below="@id/item_mainlv_top_tv2"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:text="@string/seeexcel"
android:textColor="@color/green_006400"
android:drawablePadding="10dp">
</TextView>
</RelativeLayout>
<TextView
android:id="@+id/item_mainlv_top_tv_day"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="今日支出 ¥0 收入 ¥0"
android:textStyle="bold"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp">
</TextView>
</LinearLayout>