2021/5/21 工作日报 -- 简约记账app -- day6

完成了简约记账app的账单记录查询功能,支持按年月筛选并实现账单删除。通过动态添加年份,实现显示所有记录年的视图,并使用集合设置控件颜色。同时,详细描述了逻辑实现,包括页面布局、数据库操作、事件处理等。
摘要由CSDN通过智能技术生成

今日计划

  完成更多页面,账单记录页面的绘制与逻辑代码编写

今日完成情况

  实现了账单记录的查询功能,可以按照不同年的不同月份进行历史账单查询,同时也可以进行账单删除的操作
历史账单页面
  最上面的年份可以动态添加,记录中有哪一年就显示哪一年,下面的记录可以长按进行删除。
在这里插入图片描述
在这里插入图片描述
删除操作
代码实现:

  首先进行页面的布局绘制,新建activity_history.xml文件

<?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="vertical"
    android:background="@color/grey_f3f3f3">
    <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="50dp">
        <ImageView
            android:id="@+id/history_iv_back"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:src="@mipmap/it_back1"
            android:layout_marginLeft="10dp"
            android:onClick="onClick"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/history_info"
            android:textStyle="bold"
            android:textSize="18sp"
            android:layout_centerInParent="true"/>

            <ImageView
                android:id="@+id/history_iv_rili"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginRight="10dp"
                android:src="@mipmap/it_rili"
                android:layout_alignParentRight="true"
                android:onClick="onClick"/>
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp">

        <TextView
            android:id="@+id/history_tv_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="2020年11月"/>

        <TextView
            android:id="@+id/history_tv_info"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:textColor="@color/green_006400"
            android:text="@string/history_info"/>
    </RelativeLayout>

    <ListView
        android:id="@+id/history_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:divider="@null"
        android:dividerHeight="5dp"
        android:padding="10dp" />
</LinearLayout>

在这里插入图片描述
  点击日历按钮的Dialog页面布局,新建dialog_history.xml文件

<?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="wrap_content"
    android:background="@color/white">

    <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <LinearLayout
            android:id="@+id/dialog_calendar_layout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

        </LinearLayout>

    </HorizontalScrollView>
    <GridView
        android:id="@+id/dialog_calendar_gv"
        android:layout_width="match_parent"
        android:layout_height="match_pare
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值