登录 注册
当前位置:主页 > 资源下载 > 50 > 简洁的签到打卡日历

简洁的签到打卡日历

  • 更新:2024-08-17 09:31:44
  • 大小:708KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Android - 移动开发
  • 格式:ZIP

资源介绍

import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.org.security.app.main.R; import com.org.security.tools.DateUtils; /** * Created by Administrator on 2017/8/16. */ public class SignDate extends LinearLayout { private TextView tvYear; private InnerGridView gvWeek; private InnerGridView gvDate; private AdapterDate adapterDate; public SignDate(Context context) { super(context); init(); } public SignDate(Context context, AttributeSet attrs) { super(context, attrs); init(); } public SignDate(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(); } private void init() { View view = View.inflate(getContext(), R.layout.layout_signdate, this); tvYear = view.findViewById(R.id.tvYear); gvWeek = view.findViewById(R.id.gvWeek); gvDate = view.findViewById(R.id.gvDate); tvYear.setText(DateUtils.getCurrentYearAndMonth()); gvWeek.setAdapter(new AdapterWeek(getContext())); adapterDate = new AdapterDate(getContext()); gvDate.setAdapter(adapterDate); } /** * 签到成功的回调 * * @param onSignedSuccess */ public void setOnSignedSuccess(OnSignedSuccess onSignedSuccess) { adapterDate.setOnSignedSuccess(onSignedSuccess); } /** * 签到 */ public void setOnSigned(int postion) { adapterDate.setOnSigned(postion); } /** * 签到 */ public void setOnSigned(String date) { adapterDate.setOnSigned(date); } }