摘要:今天写了一下签到功能的布局,写了一些后台功能
代码:

<?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" android:background="#f4f0de" android:orientation="vertical"> <include layout="@layout/head_title" /> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:background="#ffd600" android:gravity="center_horizontal" android:orientation="vertical"> <LinearLayout android:id="@+id/ll_sign" android:layout_width="130dp" android:layout_height="30dp" android:layout_marginTop="20dp" android:background="@drawable/shape_btn_e" android:gravity="center" android:orientation="horizontal"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@mipmap/icon_qd" /> <TextView android:id="@+id/tv_sign_state" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:text="签到" android:textColor="@color/white" android:textSize="17sp" android:textStyle="bold" /> </LinearLayout> <TextView android:id="@+id/tv_sign_data" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="12dp" android:text="已连续签到2天,继续加油!" android:textColor="@color/white" android:textSize="14.5sp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="28dp" android:layout_marginTop="90dp" android:layout_marginRight="28dp" android:background="@drawable/shape_btn_f" android:gravity="center_horizontal" android:orientation="vertical"> <TextView android:id="@+id/tv_date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="2018-12" android:textColor="@color/text_one" android:textSize="16sp" /> <View android:layout_width="match_parent" android:layout_height="1px" android:layout_marginLeft="25dp" android:layout_marginTop="25dp" android:layout_marginRight="25dp" android:layout_marginBottom="10dp" android:background="@color/line_x" /> <com.lh.std_everything.ui.sign.SignViewX.SignView android:id="@+id/activity_main_cv" android:layout_width="match_parent" android:layout_height="300dp" android:background="@color/white" /> </LinearLayout> </FrameLayout> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="80dp" android:layout_marginLeft="8dp" android:layout_marginTop="8dp" android:layout_marginRight="8dp" android:background="@drawable/shape_btn_g" android:orientation="vertical"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="12dp" android:src="@mipmap/icon_zd" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" android:gravity="center" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="您当前积分:" android:textColor="@color/text_ten" android:textSize="13sp" /> <TextView android:id="@+id/tv_score" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="2dp" android:text="500" android:textColor="@color/text_ten" android:textSize="14sp" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4dp" android:src="@mipmap/icon_integral_b" /> </LinearLayout> </LinearLayout> </LinearLayout>
后台适配器:

package com.lh.std_everything.ui.sign.SignViewX; /** * 签到日历控件数据适配器 * Created by David 2020/5/1. */ public abstract class CalendarAdapter { public abstract SignView.DayType getType(int dayOfMonth); }
明天继续完善