安卓系统记账本app第一天

先安装了as,

 

activity_main.xml总览

<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/grey_f3f3f3">

    <RelativeLayout
        android:id="@+id/main_top_layout"
        android:layout_width="match_parent"
        android:layout_height="50dp">
        <TextView
            android:text="@string/app_name"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:gravity="center"
            android:padding="10dp"
            android:textStyle="bold"
            android:textSize="18sp"
            android:textColor="@color/black"/>
        <ImageView
            android:id="@+id/main_iv_search"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@mipmap/search"
            android:layout_alignParentRight="true"
            android:padding="10dp"/>
    </RelativeLayout>
    <ListView
        android:id="@+id/main_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/main_top_layout"
        android:padding="10dp"
        android:divider="@null"
        android:dividerHeight="6dp"
        android:scrollbars="none"
        android:background="@color/grey_f3f3f3"/>

    <ImageButton
        android:id="@+id/main_btn_more"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:src="@mipmap/more"
        android:layout_alignParentRight="true"
        android:layout_alignParentBottom="true"
        android:layout_margin="20dp"
        android:background="@drawable/main_morebtn_bg"/>

    <Button
        android:id="@+id/main_btn_edit"
        android:layout_width="100dp"
        android:layout_height="50dp"
        android:layout_alignBottom="@id/main_btn_more"
        android:background="@drawable/main_recordbtn_bg"
        android:layout_toLeftOf="@+id/main_btn_more"
        android:text="@string/editone"
        android:textStyle="bold"
        android:textColor="@color/white"
        android:drawableLeft="@mipmap/edit"
        android:gravity="center_vertical"/>




</RelativeLayout>

  colors.xml总览

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#008577</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="colorAccent">#D81B60</color>
    <color name="black">#000000</color>
    <color name="grey_f3f3f3">#f3f3f3</color>
    <color name="white">#ffffff</color>
    <color name="blue">#03A9F4</color>

</resources>

string.xml

<resources>
    <string name="app_name">简约记账</string>
    <string name="editone">记一笔...</string>
</resources>

main_morebtn_bg.xml  这个为圆形更多按钮

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <!-- 填充颜色 -->
    <solid  android:color="@color/blue"/>


</shape>

main_recordbtn.xml  这个为椭圆的记一笔

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid  android:color="@color/blue"/>
    <!-- 表示四个角的弧度-->
    <corners android:radius="20dp"/>

</shape>

 

 

 

 

 

RelativeLayout 为一条插入,TextView插入字符

ImageView 插入一个图片

 

ListView 插入多行数据用

 

 ImageButton为那个圆形更多

 

Button 为记一笔。。。

 

posted @ 2021-12-24 20:07  zhuzhurr  阅读(54)  评论(0)    收藏  举报