Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# WanAndroid

## 介绍
- 鸿洋玩Android的APP,准备编写不同的架构版本,每一个分支代表一个版本,目前已开发完单一MVVM版、MVVM+组件化和compose...已在路上
MVVM版:使用kotlin+协程+liveData+viewModel+dataBinding构造的MVVM架构的单体项目
- 鸿洋玩Android的APP,准备编写不同的架构版本,每一个分支代表一个版本,目前已开发完单一MVVM版、MVVM+组件化版

- MVVM版:使用kotlin+协程+liveData+viewModel+dataBinding构造的MVVM架构的单体项目
- MVVM+组件化版:将MVVM版进行组件划分
- compose版:基于Compose实现,(Compose+ViewModel+Flow+Navigation+Material3),完全适配暗黑模式

- Flutter、uniApp后续都会进行改造

## 功能展示
- 首页Tab
Expand All @@ -14,7 +19,8 @@ MVVM版:使用kotlin+协程+liveData+viewModel+dataBinding构造的MVVM架构
- 搜索,包含热搜和搜索历史

## APK下载
- https://raw.githubusercontent.com/BTPJ/WanAndroid/MVVM/app/release/WanAndroid_V1.5.apk
- https://raw.githubusercontent.com/Toping123/WanAndroid/MVVM/app/release/WanAndroid_V1.5.apk
- Compose:https://raw.githubusercontent.com/Toping123/WanAndroid/Compose/app/release/WanAndroid_V1.0.apk

## 开源库
- 图片处理:Glide
Expand All @@ -28,9 +34,10 @@ MVVM版:使用kotlin+协程+liveData+viewModel+dataBinding构造的MVVM架构
- bugly应用升级与错误上传

## 项目地址
- [Github](https://github.com/BTPJ/WanAndroid/tree/MVVM)
- [Gitee](https://gitee.com/BTPJ_git/WanAndroid/tree/MVVM)
- [Github MVVM分支](https://github.com/Toping123/WanAndroid/tree/MVVM)
- [Github Component分支](https://github.com/Toping123/WanAndroid/tree/Component)
- [Github Compose分支](https://github.com/Toping123/WanAndroid/tree/Compose)

## 致谢
- WanAndroid网站提供的开放Api, 和里面的一些优秀开源项目和文章
- 参考鸡哥的些许样式和代码:https://github.com/hegaojian/JetpackMvvm
- WanAndroid网站提供的开放API, 和里面的一些优秀开源项目和文章
- 参考[鸡哥](https://github.com/hegaojian/JetpackMvvm.git)的些许样式和代码
42 changes: 26 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-kapt'
id 'kotlin-parcelize'
}

android {
namespace 'com.btpj.wanandroid'

compileSdk rootProject.ext.android.compileSdk

defaultConfig {
Expand All @@ -18,11 +21,18 @@ android {
// 设置支持的SO库架构,以微信为基准只支持arm64-v8a即可,可以达到缩包的目的
abiFilters 'arm64-v8a'//, 'armeabi'//, 'armeabi-v7a', 'x86', 'x86_64'
}
resConfigs 'zh-rCN'

// 只保留汉语资源
resConfigs('zh-rCN')

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// ARouter配置
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
}

// 调试版设置统一的Key,多人开发时更方便,
Expand Down Expand Up @@ -62,28 +72,28 @@ android {
}
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_17
}
buildFeatures {
dataBinding true
}
}

dependencies {
implementation project(path: ':lib_base')

// 轮播图 https://github.com/youth5201314/banner
implementation rootProject.ext.dependencies.banner
implementation rootProject.ext.dependencies.agentWeb
implementation rootProject.ext.dependencies.flexbox
implementation rootProject.ext.dependencies.AndroidAutoSize
implementation rootProject.ext.dependencies.bugly_update
implementation rootProject.ext.dependencies.bugly_nativecrashreport
// 使用debugImplementation只在调试时引入
debugImplementation rootProject.ext.dependencies.leakcanary
implementation project(path: ':lib_common')
if (!rootProject.ext.isBuildModule) {
implementation project(path: ':module_main')
implementation project(path: ':module_home')
implementation project(path: ':module_project')
implementation project(path: ':module_square')
implementation project(path: ':module_wechat')
implementation project(path: ':module_mine')
implementation project(path: ':module_web')
}
}
33 changes: 32 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,35 @@ public <init>(android.view.View);

# bugly混淆
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}
-keep public class com.tencent.bugly.**{*;}

# ARouter混淆
-keep public class com.alibaba.android.arouter.routes.**{*;}
-keep public class com.alibaba.android.arouter.facade.**{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;}
-keep class * implements com.alibaba.android.arouter.facade.template.IProvider
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider

# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider

# Retrofit混淆
-keepattributes Signature, InnerClasses, EnclosingMethod
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
-keepattributes AnnotationDefault
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}
-dontwarn javax.annotation.**
-dontwarn kotlin.Unit
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface * extends <1>
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
-keep,allowobfuscation,allowshrinking class retrofit2.Response

Binary file added app/release/WanAndroid_V1.0.apk
Binary file not shown.
Binary file removed app/release/WanAndroid_V1.5.apk
Binary file not shown.
6 changes: 3 additions & 3 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 5,
"versionName": "1.5",
"outputFile": "WanAndroid_V1.5.apk"
"versionCode": 1,
"versionName": "1.0",
"outputFile": "WanAndroid_V1.0.apk"
}
],
"elementType": "File"
Expand Down
71 changes: 2 additions & 69 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,83 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.btpj.wanandroid">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".base.App"
android:name="com.btpj.lib_base.base.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/Theme.WanAndroid"
tools:ignore="LockedOrientationActivity,UnusedAttribute">
<activity
android:name=".ui.main.MainActivity"
android:exported="false" />
<activity
android:name=".ui.search.result.SearchResultActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.search.SearchActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.author.AuthorActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.collect.CollectActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.integral.record.IntegralRecordActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.integral.rank.IntegralRankActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.setting.SettingActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.login.LoginActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.login.register.RegisterActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.web.WebActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.share.add.AddArticleActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.share.list.MyArticleActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.ip.ChangeIpActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.splash.SplashActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- 屏幕适配配置 -->
<meta-data
Expand Down
25 changes: 0 additions & 25 deletions app/src/main/java/com/btpj/wanandroid/base/App.kt

This file was deleted.

27 changes: 0 additions & 27 deletions app/src/main/java/com/btpj/wanandroid/base/BaseActivity.kt

This file was deleted.

25 changes: 0 additions & 25 deletions app/src/main/java/com/btpj/wanandroid/base/BaseFragment.kt

This file was deleted.

Loading