-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6bdbdc2
Showing
84 changed files
with
2,074 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
*.iml | ||
.gradle | ||
/.idea | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apply from: "${rootProject.rootDir}/assembly.gradle" | ||
project.ext.setAppOrLibDefaultConfig project |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
account/src/androidTest/java/com/abner/account/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.abner.account | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.abner.account.test", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.abner.account"> | ||
|
||
<application> | ||
<activity | ||
android:name=".AccountActivity" | ||
android:screenOrientation="portrait" /> | ||
</application> | ||
</manifest> |
52 changes: 52 additions & 0 deletions
52
account/src/main/java/com/abner/account/AccountActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.abner.account | ||
|
||
import android.os.Bundle | ||
import android.widget.Button | ||
import android.widget.Toast | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.abner.common.router.CommonRouterConstant | ||
import com.abner.common.router.CommonRouterManger | ||
import com.abner.common.utils.CommonUserUtils | ||
import com.alibaba.android.arouter.facade.annotation.Route | ||
|
||
/** | ||
*AUTHOR:AbnerMing | ||
*DATE:2022/9/8 | ||
*INTRODUCE:Account页面 | ||
*/ | ||
@Route(path = CommonRouterConstant.ACCOUNT) | ||
class AccountActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_account) | ||
|
||
//普通页面跳转 | ||
findViewById<Button>(R.id.btn_code).setOnClickListener { | ||
CommonRouterManger.instance.navigationActivity(CommonRouterConstant.CODE) | ||
} | ||
//页面带参数跳转 | ||
findViewById<Button>(R.id.btn_code_params).setOnClickListener { | ||
CommonRouterManger.instance.navigationActivityParams( | ||
CommonRouterConstant.CODE, | ||
"params" to "我是携带的参数", | ||
"params2" to 100 | ||
) | ||
} | ||
|
||
//模拟登录,真实业务中,请以实际为准,目前只是测试 | ||
findViewById<Button>(R.id.btn_login).setOnClickListener { | ||
//登录成功之后,保存用户信息,格式自定义,请以实际为准,当前为Demo测试 | ||
val json = "{\n" + | ||
"\t\"code\": 0,\n" + | ||
"\t\"message\": \"登录成功\",\n" + | ||
"\t\"data\": {\n" + | ||
"\t\t\"userName\": \"Abner0002323\",\n" + | ||
"\t\t\"userId\": \"896767898989989879\",\n" + | ||
"\t\t\"nickName\": \"AbnerMing\"\n" + | ||
"\t}\n" + | ||
"}" | ||
CommonUserUtils.instance.setUser(json) | ||
Toast.makeText(this, "模拟登录成功", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.abner.account | ||
|
||
import android.app.Application | ||
|
||
/** | ||
*AUTHOR:AbnerMing | ||
*DATE:2022/9/8 | ||
*INTRODUCE: | ||
*/ | ||
class AccountApp :Application(){ | ||
override fun onCreate() { | ||
super.onCreate() | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
account/src/main/java/com/abner/account/iml/AccountUserServiceIml.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.abner.account.iml | ||
|
||
import android.app.AlertDialog | ||
import android.content.Context | ||
import android.text.TextUtils | ||
import com.abner.common.data.bean.UserInfo | ||
import com.abner.common.router.CommonRouterConstant | ||
import com.abner.common.service.AccountUserService | ||
import com.abner.common.utils.DataStoreUtils | ||
import com.alibaba.android.arouter.facade.annotation.Route | ||
import com.google.gson.Gson | ||
|
||
/** | ||
*AUTHOR:AbnerMing | ||
*DATE:2022/9/10 | ||
*INTRODUCE: | ||
*/ | ||
@Route(path = CommonRouterConstant.USER_INFO, name = "AccountUserServiceIml") | ||
class AccountUserServiceIml : AccountUserService { | ||
|
||
override fun getUser(): UserInfo? { | ||
//获取用户信息后,转成需要的对象 | ||
val userJson = DataStoreUtils.getSyncData("user", "") | ||
if (TextUtils.isEmpty(userJson)) { | ||
return null | ||
} | ||
return Gson().fromJson(userJson, UserInfo::class.java) | ||
} | ||
|
||
/** | ||
* AUTHOR:AbnerMing | ||
* INTRODUCE:测试弹窗或其他功能 | ||
*/ | ||
override fun showDialog() { | ||
AlertDialog.Builder(mContext) | ||
.setTitle("测试一个Dialog弹出框") | ||
.setMessage("简单测试以下") | ||
.setNegativeButton("取消") { _, _ -> | ||
|
||
} | ||
.setPositiveButton("确定") { _, _ -> | ||
|
||
|
||
} | ||
.show() | ||
} | ||
|
||
private var mContext: Context? = null | ||
|
||
override fun init(context: Context?) { | ||
mContext = context | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.abner.account"> | ||
|
||
<application | ||
android:name=".AccountApp" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="account" | ||
android:theme="@style/Account"> | ||
<activity android:name=".AccountActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:paddingLeft="20dp" | ||
android:paddingRight="20dp"> | ||
|
||
<Button | ||
android:id="@+id/btn_code" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="20dp" | ||
android:textAllCaps="false" | ||
android:text="account组件跳转到Code组件" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/btn_code_params" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="20dp" | ||
android:textAllCaps="false" | ||
android:text="account组件跳转到Code组件带参数" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/btn_code" /> | ||
|
||
<Button | ||
android:id="@+id/btn_login" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="20dp" | ||
android:text="模拟登录" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/btn_code_params" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="purple_200">#FFBB86FC</color> | ||
<color name="purple_500">#FF6200EE</color> | ||
<color name="purple_700">#FF3700B3</color> | ||
<color name="teal_200">#FF03DAC5</color> | ||
<color name="teal_700">#FF018786</color> | ||
<color name="black">#FF000000</color> | ||
<color name="white">#FFFFFFFF</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">Account</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
<!-- Base application theme. --> | ||
<style name="Account" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> | ||
<!-- Primary brand color. --> | ||
<item name="colorPrimary">@color/purple_500</item> | ||
<item name="colorPrimaryVariant">@color/purple_700</item> | ||
<item name="colorOnPrimary">@color/white</item> | ||
<!-- Secondary brand color. --> | ||
<item name="colorSecondary">@color/teal_200</item> | ||
<item name="colorSecondaryVariant">@color/teal_700</item> | ||
<item name="colorOnSecondary">@color/black</item> | ||
<!-- Status bar color. --> | ||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> | ||
<!-- Customize your theme here. --> | ||
</style> | ||
</resources> |
17 changes: 17 additions & 0 deletions
17
account/src/test/java/com/abner/account/ExampleUnitTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.abner.account | ||
|
||
import org.junit.Test | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Example local unit test, which will execute on the development machine (host). | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
class ExampleUnitTest { | ||
@Test | ||
fun addition_isCorrect() { | ||
assertEquals(4, 2 + 2) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
apply from: "${rootProject.rootDir}/assembly.gradle" | ||
project.ext.setAppDefaultConfig project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile | ||
|
||
# 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{*;} | ||
|
||
# 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口 | ||
-keep interface * implements com.alibaba.android.arouter.facade.template.IProvider | ||
|
||
# 如果使用了 单类注入,即不定义接口实现 IProvider,需添加下面规则,保护实现 | ||
# -keep class * implements com.alibaba.android.arouter.facade.template.IProvider |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/com/abner/assembly/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.abner.assembly | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.abner.assembly", appContext.packageName) | ||
} | ||
} |
Oops, something went wrong.