• Stars
    star
    1,493
  • Rank 30,382 (Top 0.7 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔥🔥🔥 Kotlin + MVVM + LCE版玩安卓,暗黑模式、横竖屏、无网、弱网、无数据、加载失败等等各种情况,协程、Room、Hilt、DataStore、LiveData、Retrofit、屏幕适配、本地缓存、多语言切换、多 lib,你想要的我都有!!!

Play Android

项目新增了 Compose 版本,大家如果想体验的话下载代码直接切换为 main 或 compose 分支即可,有问题直接提 issues。

我的新书

大家可以购买我的新书《Jetpack Compose:Android全新UI编程》进行阅读,里面有完整的 Compose 框架供大家学习。

京东购买地址

当当购买地址

呸呸呸,太不要脸了,又在推荐自己的新书。。。

如果对你有帮助的话,别忘记点个 Star,感激不尽。

公众号

如果想关注我的话可以关注我的公众号:《江江安卓》,里面会不定期更新有关安卓的知识及个人见解。

体验

如果想要下载尝试下的话可以直接点击链接进行下载,或者扫描下面的二维码进行下载。

https://www.pgyer.com/llj2

img

如果上面的下载次数用完的话可以点击下面链接: https://github.com/zhujiang521/PlayAndroid/raw/master/apk/app-release_7zip_aligned_signed.apk

玩安卓MVVM版截图

首先来看下之前已经实现的大概样式吧:

初始样式

看着样式还好,但之前只是简单做了下,实现了最基本的功能,切换成横屏之后基本没办法看,更不要说分屏、夜间模式、本地缓存、无网弱网情况、无数据情况等等了,接下来看一下现在新增的适配页面吧。

夜间模式

横屏适配

无网、无数据适配

实现过程

项目用到了很多技术,基本上都是现在安卓app的最新标配,比如:MVVM、JetPack(LiveData、Room、ViewModel)、Retrofit、协程、Glide等等。

其实在优化这个Demo的时候觉得做了好多事,但是真的让我写的时候就有点懵逼了,因为用到的东西比较多,随便拎出一个来都能单独写一篇文章;

比如在apk大小的优化,这个apk最后被我优化到只剩3.3MB,现在随便一个apk都得几十MB吧。apk优化的挺多,比如代码混淆、资源文件的混淆、不需要的语言删除、图片转webp等等,如果想深入了解apk压缩的话,可以去看我之前写的这篇文章:玩安卓必须要掌握的性能优化之APK极限压缩

又比如新增的浏览历史功能中用到了Room,没有Room的时候基本都在使用原生或者使用LitePalGreenDAO等来实现,虽然LitePalGreenDAO也是ORM的方式来实现的数据库操作,但是总体来说还是没有Room好用,Room写好实现的DAO接口文件即可,在你编译的时候会直接生成对应的实现类,真的很香。

类似上面的还有很多,如果代码哪块写的不好或者有优化的地方欢迎大家告诉我或者给我提issues。

使用到的库

banner

bugly

SmartRefreshLayout

utilCode

glide

retrofit

dataStore

coroutines

room

License

Copyright (c) 2020 朱江

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

More Repositories

1

PlayWeather

🔥🔥🔥 Compose、Lce、MVVM、深色模式、横屏、无网弱网适配、Room、Hilt、多语言切换,目前Android最新的库基本全用上了,你想要的都有。还使用 Compose-Desktop 编写了桌面版本,快来试试吧!🔥🔥🔥
Kotlin
465
star
2

AndroidAOP

aop的方式实现防止按钮重复点击,java和kotlin都能使用
Kotlin
236
star
3

Banner

🔥🔥🔥Android Compose Banner!!! 安卓 Compose 版本的 Banner,欢迎大家体验!!!
Kotlin
56
star
4

Skin

安卓暗黑模式适配
Kotlin
52
star
5

flutter_play_android

Flutter版本的玩安卓
Dart
49
star
6

PlayerAndPusher

安卓实现视频直播(rtmp)以及直播推流(NDK实现)
C
28
star
7

ComposeBookSource

《Jetpack Compose:Android全新UI编程》全书源代码
Kotlin
24
star
8

Weather

Kotlin
22
star
9

Player

直播推流和视频拉流(Rtmp)
C
11
star
10

Room

Room的基本使用
Java
10
star
11

Filter

Java
9
star
12

AirConditioner

Kotlin
5
star
13

SmartHome

Smart home first commit.
Kotlin
5
star
14

EventBus

Kotlin
4
star
15

ZFileManager

🔥🔥🔥文件管理:默认支持 音频,视频,图片,txt,zip,word,excel,ppt,pdf 9种文件,支持音频、视频播放,图片查看,zip解压,文件重命名、复制、移动、删除、查看详情
Kotlin
3
star
16

ComposeChart

🔥🔥🔥Compose版本的Chart库
Kotlin
2
star
17

zhujiang521

2
star
18

XmlToExcel

Android 中 string.xml 转换 Excel 的小工具,大家可以直接拉代码进行使用,或者根据产品需求进行微调后使用
Kotlin
2
star
19

PlayWeatherMultiplatform

Kotlin
2
star
20

Countdown

Android Development Challenge
Kotlin
1
star
21

Shortcut

Java
1
star
22

RecyclerViewDrag

Kotlin
1
star
23

PinYinUtils

Java
1
star
24

Calculator

一个使用 Compose 构建的 Calculator (计算器)
Kotlin
1
star