比较简单的日历签到(没有第三方框架)

这篇博客介绍了如何在Android应用中实现一个简单的日历签到功能,无需使用第三方框架。内容包括布局文件的设置,实体类Sign的定义,以及在Activity中处理签到逻辑,包括日期获取、数据存储和界面更新等操作。
摘要由CSDN通过智能技术生成


一、布局文件 

<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"
    android:orientation="vertical"
    tools:context="com.cn.fqs.dd.ui.CalendarActivity" >
    
    <include 
        android:id="@+id/include_calendar_actionbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/actionbar"/>
    
    <TextView
        android:id="@+id/show"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:background="#191970"
        android:gravity="center"
        android:text="XXXX年XX月XX日"
        android:textColor="#ffffffff"
        android:textSize="18sp" />
<LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        
        <TextView 
            android:layout_width="0dp"
            android:layout_height="30dp"
            android:layout_weight="1"
            android:gravity="center"
            android:textColor="#ffffffff"
            android:background="#ff669900"
            android:textSize="12sp"
            android:text="星期天"/>
        <TextView 
            android:layout_width="0dp"
            android:layout_height="30dp"
            android:layout_weight="1"
            android:gravity="center"
            android:background="#ffafafaf"
            android:textColor="#ffffffff"
            android:textSize="12sp"
            android:text="星期一"/>
        <TextView 
            android:layout_width="0dp"
            android:layout_height="30dp"
            android:layout_weight="1"
            android:gravity="center"
            android:background="#ffafafaf"
            android:textColor="#ffffffff"
            android:textSize="12sp"
            android:text="星期二"/>
        <TextView 
            android:layout_width="0dp"
            android:layout_height="30dp"
            android:layout_weight="1"
            android:gravity="center"
            android:background="#ffafafaf"
            android:textColor="#ffffffff"
            android:textSize="12sp"
            android:text="星期三"/>
        <TextView 
            android:layout_width="0dp"
            android:layout_height="30dp"
            android:layout_weight="1"
            android:gravity="center"
            android:background="#ffafafaf"
            android:textColor="#ffffffff"
            android:textSize="12sp"
            android:text="星期四"/>
        <TextView 
            android:layout_width="0dp"
            android:layout_height="30dp"
            android:layout_weight="1"
            android:gravity="center"
            android:background="#ffafafaf
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值