Git Product home page Git Product logo

zhouhuandev / basedemo Goto Github PK

View Code? Open in Web Editor NEW
241.0 4.0 53.0 10.08 MB

🔥🔥🔥BaseDemo 是Android MVVM + Retrofit + OkHttp + Coroutine 协程 + Room + 组件化架构的Android应用开发规范化架构,通过不断的升级迭代,目前主要分为两个版本,分别为分支 MVVM+Databinding 组件化版本,分支MVVM+Databinding+Single 单体版本。旨在帮助您快速构建属于自己的APP项目架构,做到快速响应上手,另外再长期的实践经验中汇总了大量的使用工具类,主要放在了项目 `lib_common` 组件中,以供大家参考使用。具体使用请开发者工具自己项目需求决定选择如何使用。

License: Apache License 2.0

Kotlin 43.23% Java 56.77%
kotlin mvvm android retrofit2 mvvm-architecture okhttp3 jetpack-android

basedemo's Issues

some bugs

这个框架内容很丰富,周末简单体验了一下,挺不错的,学到了一些东西,但也存在一些bug说一说(因为我这边clone下来的已经魔改太多了,就不pr了)

  • lib_base#view#BaseActivity#initCommonView
if (enableAllowFullScreen()) {
    window.setFlags(
        WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN
    )
    requestWindowFeature(Window.FEATURE_NO_TITLE);
}

这段允许全屏的代码放在setContentView(R.layout.activity_root)之后会报错,需要放前面

  • lib_base#view#BaseActivity(BaseFragment)#initToolbar

    ivToolbarRight = view.findViewById(R.id.iv_toolbar_right)

两个基类都缺失了上一行代码中的视图绑定,缺失该行将导致toolbar右侧图标和监听无法加载

  • memory leak

fragment在进行切换和销毁时存在内存泄漏,目前比较严重的一个是在fragment中使用toolbar,本质是绑定activity的actionBar,fragment销毁并不会自动解绑,还是需要手动解绑。我重写了BaseFragment#onDestroyView:

override fun onDestroyView() {
    super.onDestroyView()
    mActivity.setSupportActionBar(null)
}

这能避免小黄鸟弹窗,但日志上还是会存在可能泄漏的提示,这我就不清楚为什么了

  • Binding instance cleared.

    好像来回切换的时候requireBinding会报这个exception,我有空再去研究一下为什么

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.