- 博客(15)
- 收藏
- 关注
原创 A界面的BFragment 跳转B界面,逻辑处理完成后跳转A界面的CFragment
例如说A 界面有三个 A B C Fragment 现在在B Fragment 里面, 需要跳转B Activity ,当B Activity 调用Finish 时,需要跳转到C Fragment 里面此时就需要以下操作。在接受A Activity 里面写。在B Activity 里面写。
2023-03-14 18:33:55 103
原创 java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout
java.lang.IllegalStateException: Cannot call this method while RecyclerView is computing a layout or scrolling
2022-10-10 18:27:41 726 1
原创 android 解决滑动冲突-内部拦截法
内部拦截法:内部拦截法是指父容器不拦截任何触摸事件,所有的触摸事件都传递给子元素,如果子元素需要此触摸事件就直接消耗掉,否则就交由父容器进行处理,这种方法和Android中的事件传递、处理机制不一致,需要配合requestDisallowInterceptTouchEvent方法才能正常工作,使用起来比外部拦截法稍显复杂。这种方法需要重写子元素的dispatchTouchEvent方法和父容器的onInterceptTouchEvent方法。内部拦截主要依赖于requestDisallowIntercept
2022-07-08 17:08:51 815
原创 flutter
**No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabiflutter导入项目时报错,说明是ndk没有配,去安卓包下面找到build文件,把本地C:\Users\Tony\AppData\Local\Android\Sdk\ndk 下面的ndk版本复制,然后配置ndkVersion '20.0.5594570’...
2022-02-14 16:42:00 1072
原创 MyRetrofitClient
object MyRetrofitClient : BaseRetrofitClient() { val service by lazy { getService(ApiService::class.java, ApiService.BASE_URL) }// private val cookieJar by lazy { PersistentCookieJar(SetCoo...
2020-01-08 19:11:01 101
原创 BaseRetrofitClient
abstract class BaseRetrofitClient { companion object { private const val TIME_OUT = 5 } private val client: OkHttpClient get() { val cookieJar = ...
2020-01-08 19:08:38 139
原创 TaskRepository
//仓库class TaskRepository :BaseRepository(){ suspend fun getBanner(): ServerResponse<List<BannerBean>> { return apiCall { MyRetrofitClient.service.getBanner() } } }...
2020-01-08 19:06:13 237
原创 BaseRepository
open class BaseRepository { suspend fun <T : Any> apiCall(call: suspend () -> ServerResponse<T>): ServerResponse<T> { return call.invoke() }}
2020-01-08 19:04:54 161
原创 ServerResponse
//对数据类型进行封装data class ServerResponse<out T>(val code: Int, val message: String, val data: T)
2020-01-08 19:02:59 173
原创 kotlin MVVM BaseRepository
open class BaseRepository {suspend fun <T : Any> apiCall(call: suspend () -> ServerResponse<T>): ServerResponse<T> { return call.invoke()}}
2020-01-08 16:50:39 934
原创 kotlin MVVM BaseVMFragment
abstract class BaseVMFragment<VM : BaseViewModel> : androidx.fragment.app.Fragment() { protected lateinit var mViewModel: VM override fun onCreateView(inflater: LayoutInflater, contain...
2020-01-08 16:46:52 618
原创 Kotlin MVVM BaseVMActivity
abstract class BaseVMActivity<VM : BaseViewModel> : BaseActivity(), LifecycleObserver { lateinit var mViewModel: VM override fun onCreate(savedInstanceState: Bundle?) { initVM(...
2020-01-08 16:44:58 762
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人