This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
这里记录了 Framework 定制的常用方法 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
viewLifecycleOwner.lifecycleScope.launch { | |
send.isEnabled = false | |
for (i in 60 downTo 1) { | |
send.text = getString(R.string.login_resend, i) | |
delay(1000) | |
} | |
send.isEnabled = true | |
send.text = getString(R.string.login_send_code) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.whdx.library_login.bean | |
/** | |
* @author yyz (杨云召) | |
* @date 2020/2/27 | |
* time 11:34 | |
* description | |
* Used as a wrapper for data that is exposed via a LiveData that represents an event. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2017 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cn.whdx.mdm.utils | |
import android.app.usage.UsageStats | |
import android.app.usage.UsageStatsManager | |
import android.content.Context | |
import android.text.TextUtils | |
import cn.bcbook.baselibrary.utils.LogUtil | |
/** | |
* @author yyz (杨云召) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 请求前校验逻辑,仅能执行一次,和过期时间逻辑判断逻辑 | |
* 通知请求start事件,便于metrics 指标数据收集 | |
* 将call加入分发器的同步请求队列中 | |
* 通过拦截器责任链模式进行请求和返回一系列逻辑处理 | |
*/ | |
override fun execute(): Response { | |
// 检查是否已经执行 | |
synchronized(this) { | |
check(!executed) { "Already Executed" } |