Giter Site home page Giter Site logo

hegaojian / mvvmhelper Goto Github PK

View Code? Open in Web Editor NEW
379.0 379.0 54.0 777 KB

:chicken::basketball:这是一个快速开发的框架,Kotlin语言开发,MVVM+Jetpack架构,封装了公共头部、界面状态管理、ViewModel、LiveData、DataBinding、ViewBinding头部刷新、加载更多、沉浸式、全局通知、丰富好用的拓展函数、RxHttp网络请求等等一系列工具

License: Apache License 2.0

Kotlin 63.38% Java 36.62%
android android-library databinding kotlin mvvm rxhttp viewbinding

mvvmhelper's Introduction

🐔 Hi 鸡你太美 🏀

mvvmhelper's People

Contributors

hegaojian avatar lzwzvz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mvvmhelper's Issues

后台启动Activity,toolbar不显示

例如SplashActivity,如果设置显示showToolBar=true, 正常打开是显示toolbar的。但是如果把设备锁屏,然后运行AS启动应用,等初始化完成后,解锁设置,会发现toolbar不显示。

How to use AppViewModel as JetpackMvvm project

I want to use global variable, for example i use AppViewModel in JetpackMvvm project
class AppViewModel : BaseViewModel() { var userInfo = UnPeekLiveData.Builder<UserInfo>().setAllowNullValue(true).create() }
in MvvmHelper, is there any substitute?
thanks for awesome lib

RecyclerView万能分割线问题

grid(12)
divider {
setColor(getColorExt(R.color.colorWhite))
setDivider(10,true)
orientation = DividerOrientation.GRID
}
adapter = mainIndexAdapter
如果BaseRecyclerViewAdapter 是多布局的话,会报数组越界。不支持多布局的Rv吗?

能否维护一下rxhttp的新版本

作者你好,能否维护一下rxhttp 的新版本,新版本适配了flow,能否适配一下。另外rxlife-coroutine 这个自动管理协程生命周期的库 也已经废弃掉了,希望作者能维护一下。

使用问题

我使用livedata+databind+viewmodel,之前viewmodel中的数据变化,但是view不会更新。后来发现activity中没有加mBind.viewModel = mViewModel这句关联起来的,我想请问一下,这个代码我试了加不到基类里面(基类里面的mBind没有.viewModel这个属性),那么每个activity或者fragment都必须写一遍了,请问大佬有什么好办法吗?,谢谢

升到gradle7.0.3 的问题

Cannot access 'androidx.databinding.Observable' which is a supertype of 'com.zhixinhuixue.zsyte.xxx.databinding.ActivityListBinding'. Check your module classpath for missing or conflicting dependencies

可以编译,但是一直有红色下划线

Dialog 弹框有个小bug

/**
 * 打开等待框
 */
fun Fragment.showLoadingExt(message: String = "请求网络中...") {
    dismissLoadingExt()
    activity?.let {
        if (!it.isFinishing) {
            if (loadingDialog == null) {
                //弹出loading时 把当前界面的输入法关闭
                it.hideOffKeyboard()
                loadingDialog = Dialog(requireActivity(), R.style.loadingDialogTheme).apply {
                    setCancelable(true)
                    setCanceledOnTouchOutside(false)
                    setContentView(
                        LayoutInflater.from(it)
                            .inflate(R.layout.layout_loading_view, null).apply {
                                this.findViewById<TextView>(R.id.loading_tips).text = message
                            })
                }
                loadingDialog?.setOnDismissListener {
                    //设置dialog关闭时 置空 不然会出现 一个隐藏bug 这里就不细说了
                    dismissLoadingExt()
                }
            }
            loadingDialog?.show()
        }
    }
}

第一次调用没问题,如果在显示的时候进入后台,然后在从后台进前台 就不显示了。

拜读了代码之后,有几个问题和建议。

老哥,你这个启动图着实*到我了,看完代码之后 ,我有几个建议和问题想请教下:
1.Android 启动优化AnchorsManager 可以尝试一下App Startup。
2.能否添加Room 数据库的一些使用,这样一来也可以完善MVVM 的Repository 层也有所体现。
3.保持这个第三方库版本的更新。
4.NetCallbackExt.kt 这个类 如果是串行请求和并行请求怎么处理?
最后 感谢作者的开源。

社死

鸡哥,你能体会饿刚运行demo成功,被家里长辈看到启动页的心情吗

在执行下载任务的时候,发生了奔溃报错java.lang.IllegalStateException: closed,是在拦截器chain.proceed(request)

2021-07-22 15:17:25.895 26284-26954/com.brook.im.xxx E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.brook.im.xxx, PID: 26284 java.lang.IllegalStateException: closed at okio.RealBufferedSink.write(RealBufferedSink.kt:142) at okio.ForwardingSink.write(ForwardingSink.kt:29) at rxhttp.wrapper.progress.ProgressRequestBody$1.write(ProgressRequestBody.java:99) at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:255) at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:194) at okhttp3.RequestBody$Companion$asRequestBody$1.writeTo(RequestBody.kt:167) at rxhttp.wrapper.progress.ProgressRequestBody.writeTo(ProgressRequestBody.java:76) at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:59) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at com.android.tools.profiler.agent.okhttp.OkHttp3Interceptor.intercept(OkHttp3Interceptor.java:57) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at com.hh.library.net.interception.LogInterceptor.intercept(LogInterceptor.kt:49) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at com.hh.library.common.util.MyHeadInterceptor.intercept(MyHeadInterceptor.kt:18) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:517) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

BaseVmActivity 生命周期执行顺序问题

BaseVmActivity  中的initStatusView(savedInstanceState: Bundle?) 方法,
  findViewById<FrameLayout>(R.id.baseContentView).post {
            initView(savedInstanceState)
}

这个地方 会在oncreate onresume 执行完成之后才会执行到initView 方法。如果在onresume中做一些逻辑操作,会造成页面不更新。

最新版本,好多第三方库拉不下来。鸡哥,这些要怎么解决?

Could not find com.github.zhaokaiqiang.klog:library:1.6.0.
Could not find com.effective.android:anchors:1.1.1.
Could not find com.gyf.immersionbar:immersionbar:3.0.0.
Could not find com.gyf.immersionbar:immersionbar-ktx:3.0.0.
Could not find com.scwang.smart:refresh-layout-kernel:2.0.1
Could not find com.scwang.smart:refresh-header-classics:2.0.1.
Could not find com.noober.background:core:1.6.5.

KtxActivityLifecycleCallbacks

KtxActivityLifecycleCallbacks的onActivityDestroyed调用了finishActivity,会导致切换暗黑模式的时候Activity被finish

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.