diff --git a/.gradle/7.3.3/checksums/checksums.lock b/.gradle/7.3.3/checksums/checksums.lock
index d6d1dd0..719934a 100644
Binary files a/.gradle/7.3.3/checksums/checksums.lock and b/.gradle/7.3.3/checksums/checksums.lock differ
diff --git a/.gradle/7.3.3/checksums/md5-checksums.bin b/.gradle/7.3.3/checksums/md5-checksums.bin
index cd2e325..0073822 100644
Binary files a/.gradle/7.3.3/checksums/md5-checksums.bin and b/.gradle/7.3.3/checksums/md5-checksums.bin differ
diff --git a/.gradle/7.3.3/checksums/sha1-checksums.bin b/.gradle/7.3.3/checksums/sha1-checksums.bin
index 013a5fd..27303ea 100644
Binary files a/.gradle/7.3.3/checksums/sha1-checksums.bin and b/.gradle/7.3.3/checksums/sha1-checksums.bin differ
diff --git a/.gradle/7.3.3/executionHistory/executionHistory.bin b/.gradle/7.3.3/executionHistory/executionHistory.bin
index d8a7ba8..582032a 100644
Binary files a/.gradle/7.3.3/executionHistory/executionHistory.bin and b/.gradle/7.3.3/executionHistory/executionHistory.bin differ
diff --git a/.gradle/7.3.3/executionHistory/executionHistory.lock b/.gradle/7.3.3/executionHistory/executionHistory.lock
index a14a774..3923acc 100644
Binary files a/.gradle/7.3.3/executionHistory/executionHistory.lock and b/.gradle/7.3.3/executionHistory/executionHistory.lock differ
diff --git a/.gradle/7.3.3/fileHashes/fileHashes.bin b/.gradle/7.3.3/fileHashes/fileHashes.bin
index ece0a02..fd062c5 100644
Binary files a/.gradle/7.3.3/fileHashes/fileHashes.bin and b/.gradle/7.3.3/fileHashes/fileHashes.bin differ
diff --git a/.gradle/7.3.3/fileHashes/fileHashes.lock b/.gradle/7.3.3/fileHashes/fileHashes.lock
index 1e2a6c0..3773b4e 100644
Binary files a/.gradle/7.3.3/fileHashes/fileHashes.lock and b/.gradle/7.3.3/fileHashes/fileHashes.lock differ
diff --git a/.gradle/7.3.3/fileHashes/resourceHashesCache.bin b/.gradle/7.3.3/fileHashes/resourceHashesCache.bin
index c97b593..637df9e 100644
Binary files a/.gradle/7.3.3/fileHashes/resourceHashesCache.bin and b/.gradle/7.3.3/fileHashes/resourceHashesCache.bin differ
diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index 8b6d2d4..a41c9f1 100644
Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin
index 5cce5c1..0253b43 100644
Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ
diff --git a/.gradle/file-system.probe b/.gradle/file-system.probe
index 709f9ce..d063028 100644
Binary files a/.gradle/file-system.probe and b/.gradle/file-system.probe differ
diff --git a/app/build.gradle b/app/build.gradle
index 45e44bf..19be278 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -70,7 +70,7 @@ android {
dependencies {
//视频播放器
- implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.2.0-release-jitpack'
+// implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.2.0-release-jitpack'
//权限申请
implementation 'com.guolindev.permissionx:permissionx:1.6.1'
implementation "androidx.room:room-runtime:2.4.0"
@@ -94,7 +94,6 @@ dependencies {
implementation 'com.kongzue.stacklabel:stacklabelview:1.1.9'
implementation files('libs/editor_0.8.aar')
implementation project(path: ':assistantCoreLibrary')
- implementation project(path: ':networkApi')
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
implementation 'com.afollestad.material-dialogs:input:3.3.0'
@@ -104,9 +103,9 @@ dependencies {
implementation 'com.github.QuadFlask:colorpicker:0.0.15'
implementation 'cat.ereza:customactivityoncrash:2.3.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
- implementation 'androidx.appcompat:appcompat:1.3.1'
+ implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.core:core-splashscreen:1.0.0-beta01'
- implementation 'com.google.android.material:material:1.5.0'
+ implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7a19002..0928761 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -23,6 +23,9 @@
android:supportsRtl="true"
android:theme="@style/Theme.rust.Concept"
android:usesCleartextTraffic="true">
+
diff --git a/app/src/main/java/com/coldmint/rust/pro/CreationWizardActivity.kt b/app/src/main/java/com/coldmint/rust/pro/CreationWizardActivity.kt
new file mode 100644
index 0000000..d84b2c4
--- /dev/null
+++ b/app/src/main/java/com/coldmint/rust/pro/CreationWizardActivity.kt
@@ -0,0 +1,110 @@
+package com.coldmint.rust.pro
+
+import android.content.Intent
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.coldmint.rust.pro.adapters.GuideAdapter
+import com.coldmint.rust.pro.base.BaseActivity
+import com.coldmint.rust.pro.databean.GuideData
+import com.coldmint.rust.pro.databinding.ActivityCreationWizardBinding
+import com.coldmint.rust.pro.tool.AppSettings
+
+class CreationWizardActivity : BaseActivity() {
+ //创建向导类型(模组,模板包)
+ lateinit var type: String
+ override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
+ setReturnButton()
+ title = getString(R.string.creation_wizard)
+ val temType = intent.getStringExtra("type")
+ if (temType.isNullOrBlank()) {
+ showToast("请传入类型")
+ finish()
+ return
+ }
+ type = temType
+ viewBinding.recyclerView.layoutManager = LinearLayoutManager(this)
+ when (temType) {
+ "mod" -> {
+ val dataList = ArrayList()
+ dataList.add(
+ GuideData(
+ R.string.create_mod_lable,
+ R.string.create_mod_describe,
+ R.drawable.ic_outline_create_24
+ )
+ )
+ dataList.add(
+ GuideData(
+ R.string.import_mod,
+ R.string.import_mod_from_file_manager_describe,
+ R.drawable.folder
+ )
+ )
+ dataList.add(
+ GuideData(
+ R.string.import_mod_from_package_directory,
+ R.string.import_mod_from_package_directory_describe,
+ R.drawable.zip
+ )
+ )
+ dataList.add(
+ GuideData(
+ R.string.import_mod_from_recycle_bin,
+ R.string.import_mod_from_recycle_bin_describe,
+ R.drawable.auto_delete
+ )
+ )
+ val adapter = GuideAdapter(this, dataList)
+ adapter.setItemEvent { i, itemGuideBinding, viewHolder, guideData ->
+ itemGuideBinding.root.setOnClickListener {
+ finish()
+ when (guideData.titleRes) {
+ R.string.create_mod_lable -> {
+ startActivity(
+ Intent(
+ this,
+ CreateModActivity::class.java
+ )
+ )
+ }
+ R.string.import_mod -> {
+ val startIntent =
+ Intent(this, FileManagerActivity::class.java)
+ val fileBundle = Bundle()
+ fileBundle.putString("type", "selectFile")
+ startIntent.putExtra("data", fileBundle)
+ startActivity(startIntent)
+ }
+ R.string.import_mod_from_package_directory -> {
+ val startIntent =
+ Intent(this, FileManagerActivity::class.java)
+ val fileBundle = Bundle()
+ fileBundle.putString("type", "selectFile")
+ val packDirectory = appSettings.getValue(
+ AppSettings.Setting.PackDirectory,
+ AppSettings.dataRootDirectory + "/bin/"
+ )
+ fileBundle.putString("path", packDirectory)
+ fileBundle.putString("rootpath", packDirectory)
+ startIntent.putExtra("data", fileBundle)
+ startActivity(startIntent)
+ }
+ R.string.import_mod_from_recycle_bin -> {
+ startActivity(Intent(this, RecyclingStationActivity::class.java))
+ }
+ }
+ }
+ }
+
+ viewBinding.recyclerView.adapter = adapter
+ }
+ }
+ }
+
+ override fun getViewBindingObject(): ActivityCreationWizardBinding {
+ return ActivityCreationWizardBinding.inflate(layoutInflater)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/coldmint/rust/pro/FileManagerActivity.kt b/app/src/main/java/com/coldmint/rust/pro/FileManagerActivity.kt
index 0cf116a..3bd3ced 100644
--- a/app/src/main/java/com/coldmint/rust/pro/FileManagerActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/FileManagerActivity.kt
@@ -156,8 +156,6 @@ class FileManagerActivity : BaseActivity() {
else -> {
val ints = intArrayOf(
R.string.open_action1,
- R.string.open_action2,
- R.string.open_action3,
R.string.open_action4
)
val items = FileAdapter.conversionSymbol(
@@ -235,18 +233,19 @@ class FileManagerActivity : BaseActivity() {
//加载文件
fun loadFiles(file: File) {
executorService.submit {
+ if (!file.exists()) {
+ runOnUiThread {
+ viewBinding.fileList.isVisible = false
+ viewBinding.progressBar.isVisible = false
+ viewBinding.fileError.isVisible = true
+ viewBinding.fileError.setText(R.string.unable_to_open_this_directory)
+ viewBinding.fab.hide()
+ }
+ return@submit
+ }
+
if (file.isDirectory) {
val files = file.listFiles()
- if (files == null || !file.exists()) {
- runOnUiThread {
- viewBinding.fileList.isVisible = false
- viewBinding.progressBar.isVisible = false
- viewBinding.fileError.isVisible = true
- viewBinding.fileError.setText(R.string.unable_to_open_this_directory)
- viewBinding.fab.hide()
- }
- return@submit
- }
directs = file
val fileArrayList: ArrayList = ArrayList(listOf(*files))
if (file.absolutePath != mRoot.absolutePath) {
@@ -472,7 +471,6 @@ class FileManagerActivity : BaseActivity() {
}
-
/**
* 解析文件路径
*
diff --git a/app/src/main/java/com/coldmint/rust/pro/LoginActivity.kt b/app/src/main/java/com/coldmint/rust/pro/LoginActivity.kt
index b64a825..9f6a812 100644
--- a/app/src/main/java/com/coldmint/rust/pro/LoginActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/LoginActivity.kt
@@ -106,34 +106,28 @@ class LoginActivity : BaseActivity() {
}
val appId = appSettings.getValue(AppSettings.Setting.AppID, "");
isLogin = true
- viewBinding.button.setBackgroundColor(
- GlobalMethod.getThemeColor(
- this@LoginActivity,
- R.attr.colorPrimaryVariant
- )
- )
viewBinding.button.setText(R.string.request_data)
User.login(LoginRequestData(account, passWord, appId),
object : ApiCallBack {
override fun onResponse(userData: UserData) {
isLogin = false
- viewBinding.button.setBackgroundColor(GlobalMethod.getColorPrimary(this@LoginActivity))
viewBinding.button.setText(R.string.login)
if (userData.code == ServerConfiguration.Success_Code) {
appSettings.forceSetValue(
AppSettings.Setting.Account,
- userData.data.account
+ account
)
appSettings.forceSetValue(AppSettings.Setting.PassWord, passWord)
appSettings.forceSetValue(
- AppSettings.Setting.UserName,
- userData.data.userName
+ AppSettings.Setting.Token,
+ userData.data.token
)
GlobalMethod.isActive = userData.data.activation
//更新本地激活时间
val expirationTime = userData.data.expirationTime
val time = ServerConfiguration.toLongTime(expirationTime)
appSettings.forceSetValue(AppSettings.Setting.ExpirationTime, time)
+ appSettings.forceSetValue(AppSettings.Setting.LoginStatus,true)
startActivity(Intent(this@LoginActivity, MainActivity::class.java))
finish()
} else {
diff --git a/app/src/main/java/com/coldmint/rust/pro/MainActivity.kt b/app/src/main/java/com/coldmint/rust/pro/MainActivity.kt
index d0f3ea0..f637cc9 100644
--- a/app/src/main/java/com/coldmint/rust/pro/MainActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/MainActivity.kt
@@ -314,62 +314,9 @@ class MainActivity : BaseActivity() {
val templateItem = getString(R.string.template_title)
when (item) {
warehouseItem -> {
- val popupMenu = PopupMenu(this@MainActivity, viewBinding.mainButton)
- popupMenu.menu.add(R.string.create_mod_lable)
- val fileManagerMenu = popupMenu.menu.addSubMenu(R.string.open_action2)
- fileManagerMenu.add(R.string.file_manager)
- fileManagerMenu.add(R.string.packaged_mod)
- if (AppOperator.isAppInstalled(this, GlobalMethod.ADM_PACKAGE)) {
- fileManagerMenu.add(R.string.from_adm)
- }
- popupMenu.setOnMenuItemClickListener { item ->
- when (item.title.toString()) {
- getString(R.string.create_mod_lable) -> {
- startActivity(
- Intent(
- this@MainActivity,
- CreateModActivity::class.java
- )
- )
- }
- getString(R.string.file_manager) -> {
- val startIntent =
- Intent(this@MainActivity, FileManagerActivity::class.java)
- val fileBundle = Bundle()
- fileBundle.putString("type", "selectFile")
- startIntent.putExtra("data", fileBundle)
- startActivityForResult(startIntent, 1)
- }
- getString(R.string.packaged_mod) -> {
- val startIntent =
- Intent(this@MainActivity, FileManagerActivity::class.java)
- val fileBundle = Bundle()
- fileBundle.putString("type", "selectFile")
- val packDirectory = appSettings.getValue(
- AppSettings.Setting.PackDirectory,
- AppSettings.dataRootDirectory + "/bin/"
- )
- fileBundle.putString("path", packDirectory)
- fileBundle.putString("rootpath", packDirectory)
- startIntent.putExtra("data", fileBundle)
- startActivityForResult(startIntent, 1)
- }
- getString(R.string.from_adm) -> {
- val startIntent =
- Intent(this@MainActivity, FileManagerActivity::class.java)
- val fileBundle = Bundle()
- fileBundle.putString("type", "selectFile")
- val packDirectory =
- Environment.getExternalStorageDirectory().absolutePath + "/ADM"
- fileBundle.putString("path", packDirectory)
- fileBundle.putString("rootpath", packDirectory)
- startIntent.putExtra("data", fileBundle)
- startActivityForResult(startIntent, 1)
- }
- }
- true
- }
- popupMenu.show()
+ val intent = Intent(this, CreationWizardActivity::class.java)
+ intent.putExtra("type", "mod")
+ startActivity(intent)
}
templateItem -> {
val popupMenu = PopupMenu(this@MainActivity, viewBinding.mainButton)
diff --git a/app/src/main/java/com/coldmint/rust/pro/RecyclingStationActivity.kt b/app/src/main/java/com/coldmint/rust/pro/RecyclingStationActivity.kt
index 0714fec..fd0857c 100644
--- a/app/src/main/java/com/coldmint/rust/pro/RecyclingStationActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/RecyclingStationActivity.kt
@@ -22,8 +22,8 @@ class RecyclingStationActivity : BaseActivity()
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
if (canUseView) {
- viewBinding.toolbar.setTitle(R.string.enable_the_recovery_station)
setReturnButton()
+ title = getString(R.string.enable_the_recovery_station)
viewBinding.backupList.layoutManager =
LinearLayoutManager(this@RecyclingStationActivity)
val workFolderPath = appSettings.getValue(
@@ -69,7 +69,8 @@ class RecyclingStationActivity : BaseActivity()
if (file == null) {
return@setOnClickListener
}
- val popupMenu = PopupMenu(this@RecyclingStationActivity, fileItemBinding.more)
+ val popupMenu =
+ PopupMenu(this@RecyclingStationActivity, fileItemBinding.more)
popupMenu.menu.add(R.string.recovery_file)
popupMenu.menu.add(R.string.delete_title)
popupMenu.setOnMenuItemClickListener(PopupMenu.OnMenuItemClickListener { item ->
diff --git a/app/src/main/java/com/coldmint/rust/pro/RegisterActivity.kt b/app/src/main/java/com/coldmint/rust/pro/RegisterActivity.kt
index b0cdd90..91fa8a3 100644
--- a/app/src/main/java/com/coldmint/rust/pro/RegisterActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/RegisterActivity.kt
@@ -450,7 +450,7 @@ class RegisterActivity : BaseActivity() {
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
if (canUseView) {
- viewBinding.toolbar.setTitle(R.string.register)
+ title = getString(R.string.register)
setReturnButton()
initAction()
}
diff --git a/app/src/main/java/com/coldmint/rust/pro/RustApplication.kt b/app/src/main/java/com/coldmint/rust/pro/RustApplication.kt
index 3c1090d..b46f696 100644
--- a/app/src/main/java/com/coldmint/rust/pro/RustApplication.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/RustApplication.kt
@@ -3,6 +3,8 @@ package com.coldmint.rust.pro
import android.app.Application
import android.content.Context
import cat.ereza.customactivityoncrash.config.CaocConfig
+import com.google.android.material.color.DynamicColors
+import com.google.android.material.color.DynamicColorsOptions
class RustApplication : Application() {
@@ -14,6 +16,7 @@ class RustApplication : Application() {
override fun onCreate() {
super.onCreate()
// UMConfigure.preInit(this, appId, channel)
+// DynamicColors.applyToActivitiesIfAvailable(this)
CaocConfig.Builder.create()
.backgroundMode(CaocConfig.BACKGROUND_MODE_SILENT) //default: CaocConfig.BACKGROUND_MODE_SHOW_CUSTOM
.enabled(true) //default: true
diff --git a/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt b/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt
index 9d404e5..a6c9f0a 100644
--- a/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/UserHomePageActivity.kt
@@ -32,9 +32,6 @@ import com.google.android.material.snackbar.Snackbar
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.gyf.immersionbar.ktx.immersionBar
-import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
-import com.shuyu.gsyvideoplayer.utils.GSYVideoHelper
-import com.shuyu.gsyvideoplayer.utils.GSYVideoType
class UserHomePageActivity : BaseActivity() {
@@ -46,9 +43,6 @@ class UserHomePageActivity : BaseActivity() {
val userHomeStateAdapter by lazy {
UserHomeStateAdapter(this, userId)
}
- val videoHelper by lazy {
- GSYVideoHelper(this)
- }
val appID by lazy {
@@ -95,23 +89,9 @@ class UserHomePageActivity : BaseActivity() {
}
initButton()
- loadVideo()
}
- fun loadVideo() {
- viewBinding.coverView.visibility = View.INVISIBLE
- viewBinding.appBar.setBackgroundResource(R.drawable.transparent)
- viewBinding.tabLayout.setBackgroundResource(R.drawable.transparent)
- viewBinding.videoView.setUp("http://39.105.229.249/resources/mp4/vicious.mp4", true, null)
- videoHelper.setGsyVideoOptionBuilder(
- GSYVideoHelper.GSYVideoHelperBuilder().setHideActionBar(true).setHideStatusBar(false)
- )
- GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_FULL)
- viewBinding.videoView.isLooping = true
- viewBinding.videoView.isAutoFullWithSize = true
- viewBinding.videoView.startPlayLogic()
- }
/**
* 打开用户列表
diff --git a/app/src/main/java/com/coldmint/rust/pro/adapters/GuideAdapter.kt b/app/src/main/java/com/coldmint/rust/pro/adapters/GuideAdapter.kt
new file mode 100644
index 0000000..d394a91
--- /dev/null
+++ b/app/src/main/java/com/coldmint/rust/pro/adapters/GuideAdapter.kt
@@ -0,0 +1,33 @@
+package com.coldmint.rust.pro.adapters
+
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import com.coldmint.rust.pro.base.BaseAdapter
+import com.coldmint.rust.pro.databean.GuideData
+import com.coldmint.rust.pro.databinding.ItemGuideBinding
+
+/**
+ * 向导适配器
+ */
+class GuideAdapter(context: Context, dataList: MutableList) :
+ BaseAdapter(context, dataList) {
+ override fun getViewBindingObject(
+ layoutInflater: LayoutInflater,
+ parent: ViewGroup,
+ viewType: Int
+ ): ItemGuideBinding {
+ return ItemGuideBinding.inflate(layoutInflater, parent, false)
+ }
+
+ override fun onBingView(
+ data: GuideData,
+ viewBinding: ItemGuideBinding,
+ viewHolder: ViewHolder,
+ position: Int
+ ) {
+ viewBinding.iconView.setImageResource(data.imageRes)
+ viewBinding.titleView.setText(data.titleRes)
+ viewBinding.describeView.setText(data.describeRes)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/coldmint/rust/pro/base/BaseActivity.kt b/app/src/main/java/com/coldmint/rust/pro/base/BaseActivity.kt
index b820d91..a901136 100644
--- a/app/src/main/java/com/coldmint/rust/pro/base/BaseActivity.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/base/BaseActivity.kt
@@ -17,6 +17,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.viewbinding.ViewBinding
import com.afollestad.materialdialogs.MaterialDialog
import com.coldmint.rust.pro.R
+import com.google.android.material.appbar.MaterialToolbar
import com.google.android.material.snackbar.Snackbar
import com.google.android.material.textfield.TextInputLayout
import java.util.*
@@ -43,15 +44,12 @@ abstract class BaseActivity :
}
override fun onCreate(savedInstanceState: Bundle?) {
-// WindowCompat.setDecorFitsSystemWindows(window, false)
- whenCreateActivity(savedInstanceState, false)
+ WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
+ whenCreateActivity(savedInstanceState, false)
setContentView(viewBinding.root)
- val toolBar = findViewById(R.id.toolbar)
- if (toolBar == null) {
- MaterialDialog(this).title(R.string.app_name).message(text = "启动失败,未找到标题栏")
- .positiveButton(text = "确定").cancelable(false).show()
- } else {
+ val toolBar = findViewById(R.id.toolbar)
+ if (toolBar != null) {
setSupportActionBar(toolBar)
}
whenCreateActivity(savedInstanceState, true)
diff --git a/app/src/main/java/com/coldmint/rust/pro/databean/GuideData.kt b/app/src/main/java/com/coldmint/rust/pro/databean/GuideData.kt
new file mode 100644
index 0000000..11d79cd
--- /dev/null
+++ b/app/src/main/java/com/coldmint/rust/pro/databean/GuideData.kt
@@ -0,0 +1,9 @@
+package com.coldmint.rust.pro.databean
+
+/**
+ * 向导数据
+ * @property titleRes Int
+ * @property imageRes Int
+ * @constructor
+ */
+class GuideData(val titleRes: Int, val describeRes: Int, val imageRes: Int)
\ No newline at end of file
diff --git a/app/src/main/java/com/coldmint/rust/pro/fragments/UserInfoFragment.kt b/app/src/main/java/com/coldmint/rust/pro/fragments/UserInfoFragment.kt
index 7175a2a..c0e31b3 100644
--- a/app/src/main/java/com/coldmint/rust/pro/fragments/UserInfoFragment.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/fragments/UserInfoFragment.kt
@@ -7,6 +7,7 @@ import android.widget.Toast
import androidx.recyclerview.widget.GridLayoutManager
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
+import com.coldmint.rust.core.dataBean.user.ActivationInfo
import com.coldmint.rust.core.dataBean.user.UserData
import com.coldmint.rust.core.interfaces.ApiCallBack
import com.coldmint.rust.core.web.ServerConfiguration
@@ -103,8 +104,19 @@ class UserInfoFragment : BaseFragment() {
super.onResume()
if (account.isNotBlank()) {
- User.getInfo(account, object : ApiCallBack {
- override fun onResponse(t: UserData) {
+ User.getUserActivationInfo(account, object : ApiCallBack {
+
+
+ override fun onFailure(e: Exception) {
+ viewBinding.nameView.text = account
+ loadRecyclerView(3)
+// val localTime =
+// appSettings.getValue(AppSettings.Setting.ExpirationTime, 0.toLong())
+// viewBinding.expirationTimeView.text =
+// ServerConfiguration.toStringTime(localTime)
+ }
+
+ override fun onResponse(t: ActivationInfo) {
if (t.code == ServerConfiguration.Success_Code) {
viewBinding.nameView.text = t.data.userName
val icon = t.data.headIcon
@@ -121,15 +133,6 @@ class UserInfoFragment : BaseFragment() {
}
}
- override fun onFailure(e: Exception) {
- viewBinding.nameView.text = account
- loadRecyclerView(3)
-// val localTime =
-// appSettings.getValue(AppSettings.Setting.ExpirationTime, 0.toLong())
-// viewBinding.expirationTimeView.text =
-// ServerConfiguration.toStringTime(localTime)
- }
-
})
}
}
@@ -148,7 +151,7 @@ class UserInfoFragment : BaseFragment() {
}
viewBinding.logOutButton.setOnClickListener {
- requireActivity().finish()
+ appSettings.setValue(AppSettings.Setting.LoginStatus, false)
startActivity(Intent(requireContext(), LoginActivity::class.java))
}
}
diff --git a/app/src/main/java/com/coldmint/rust/pro/tool/AppSettings.kt b/app/src/main/java/com/coldmint/rust/pro/tool/AppSettings.kt
index 4cddc60..82a34bc 100644
--- a/app/src/main/java/com/coldmint/rust/pro/tool/AppSettings.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/tool/AppSettings.kt
@@ -43,7 +43,7 @@ class AppSettings private constructor(val mContext: Context) {
private val editor: SharedPreferences.Editor = sharedPreferences.edit()
enum class Setting {
- DatabaseDirectory, DatabasePath, TemplateDirectory, AppLanguage, DeveloperMode, CustomSymbol, AutoCreateNomedia, OnlyLoadConantLanguageTemple, NightMode, GamePackage, KeepRwmodFile, EnableRecoveryStation, RecoveryStationFileSaveDays, RecoveryStationFolder, IndependentFolder, SetGameStorage, PackDirectory, IdentifiersPromptNumber, UserName, UseJetBrainsMonoFont, AppID, Account, PassWord, ExpirationTime, CheckBetaUpdate, UpdateData, ShareTip, AgreePolicy, EnglishEditingMode, NightModeFollowSystem, UseMobileNetwork, MapFolder, ModFolder, UseTheCommunityAsTheLaunchPage, AutoSave,ServerAddress
+ DatabaseDirectory, DatabasePath, TemplateDirectory, AppLanguage, DeveloperMode, CustomSymbol, AutoCreateNomedia, OnlyLoadConantLanguageTemple, NightMode, GamePackage, KeepRwmodFile, EnableRecoveryStation, RecoveryStationFileSaveDays, RecoveryStationFolder, IndependentFolder, SetGameStorage, PackDirectory, IdentifiersPromptNumber, UserName, UseJetBrainsMonoFont, AppID, Account, PassWord, ExpirationTime, CheckBetaUpdate, UpdateData, ShareTip, AgreePolicy, EnglishEditingMode, NightModeFollowSystem, UseMobileNetwork, MapFolder, ModFolder, UseTheCommunityAsTheLaunchPage, AutoSave, ServerAddress, Token, LoginStatus
}
@@ -303,5 +303,7 @@ class AppSettings private constructor(val mContext: Context) {
map[Setting.UpdateData] = "UpdateData"
map[Setting.ShareTip] = "ShareTip"
map[Setting.AgreePolicy] = "AgreePolicy"
+ map[Setting.LoginStatus] = "LoginStatus"
+ map[Setting.Token] = "Token"
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/coldmint/rust/pro/tool/GlobalMethod.kt b/app/src/main/java/com/coldmint/rust/pro/tool/GlobalMethod.kt
index a1be197..364de20 100644
--- a/app/src/main/java/com/coldmint/rust/pro/tool/GlobalMethod.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/tool/GlobalMethod.kt
@@ -51,7 +51,6 @@ object GlobalMethod {
const val DEFAULT_GAME_PACKAGE = "com.corrodinggames.rts"
const val DEBUG_SIGN = "963dfd616924b27f9247a35e45bc130a"
const val RELEASE_SIGN = "5320b24894fe7ed449842a81a2dfceda"
- const val ADM_PACKAGE = "com.dv.adm.pay"
/**
@@ -157,6 +156,7 @@ object GlobalMethod {
* @param resId 资源id
* @return 成功返回值,失败返回-1
*/
+ @Deprecated("废弃")
fun getThemeColor(context: Context, resId: Int): Int {
val typedValue = TypedValue()
return if (context.theme.resolveAttribute(resId, typedValue, true)) {
@@ -172,6 +172,7 @@ object GlobalMethod {
* @param context 上下文环境
* @return 整数
*/
+ @Deprecated("废弃")
fun getColorPrimary(context: Context): Int {
return getThemeColor(context, R.attr.colorPrimary)
}
diff --git a/app/src/main/java/com/coldmint/rust/pro/viewmodel/StartViewModel.kt b/app/src/main/java/com/coldmint/rust/pro/viewmodel/StartViewModel.kt
index 190626b..3021a5e 100644
--- a/app/src/main/java/com/coldmint/rust/pro/viewmodel/StartViewModel.kt
+++ b/app/src/main/java/com/coldmint/rust/pro/viewmodel/StartViewModel.kt
@@ -22,6 +22,8 @@ import com.afollestad.materialdialogs.MaterialDialog
import com.coldmint.rust.core.CompressionManager
import com.coldmint.rust.core.DataSet
import com.coldmint.rust.core.dataBean.LoginRequestData
+import com.coldmint.rust.core.dataBean.user.ActivationInfo
+import com.coldmint.rust.core.dataBean.user.SocialInfoData
import com.coldmint.rust.core.dataBean.user.UserData
import com.coldmint.rust.core.database.code.CodeDataBase
import com.coldmint.rust.core.interfaces.ApiCallBack
@@ -59,7 +61,7 @@ class StartViewModel(application: Application) : BaseAndroidViewModel(applicatio
* 用户数据的LiveData
*/
val userLiveData by lazy {
- MutableLiveData()
+ MutableLiveData()
}
/**
@@ -126,34 +128,17 @@ class StartViewModel(application: Application) : BaseAndroidViewModel(applicatio
* 验证用户信息
*/
fun verifyingUserInfo() {
+ val status = appSettings.getValue(AppSettings.Setting.LoginStatus, false)
+ if (!status) {
+ needLoginLiveData.value = true
+ return
+ }
//验证登录
- val account = appSettings.getValue(AppSettings.Setting.Account, "")
- val passWord = appSettings.getValue(AppSettings.Setting.PassWord, "")
- if (account.isBlank() || passWord.isBlank()) {
+ val token = appSettings.getValue(AppSettings.Setting.Token, "")
+ if (token.isBlank()) {
needLoginLiveData.value = true
} else {
- User.login(LoginRequestData(
- account,
- passWord, appSettings.getValue(AppSettings.Setting.AppID, "")
- ), object : ApiCallBack {
- override fun onResponse(userData: UserData) {
- if (userData.code == ServerConfiguration.Success_Code) {
- userLiveData.value = userData
- //更新本地激活时间
- val expirationTime = userData.data.expirationTime
- val time = ServerConfiguration.toLongTime(expirationTime)
- appSettings.forceSetValue(
- AppSettings.Setting.ExpirationTime,
- time
- )
- isActivationLiveData.value = userData.data.activation
- } else {
-// 用户登录失败
- verifyErrorMsgLiveData.value = userData.message
- Log.d("验证失败", userData.message)
- }
- }
-
+ User.getUserActivationInfo(token, object : ApiCallBack {
override fun onFailure(e: Exception) {
val localTime = appSettings.getValue(
AppSettings.Setting.ExpirationTime,
@@ -167,6 +152,25 @@ class StartViewModel(application: Application) : BaseAndroidViewModel(applicatio
isActivationLiveData.value = localTime > nowTime
}
}
+
+
+ override fun onResponse(activationInfo: ActivationInfo) {
+ if (activationInfo.code == ServerConfiguration.Success_Code) {
+ userLiveData.value = activationInfo
+ //更新本地激活时间
+ val expirationTime = activationInfo.data.expirationTime
+ val time = ServerConfiguration.toLongTime(expirationTime)
+ appSettings.forceSetValue(
+ AppSettings.Setting.ExpirationTime,
+ time
+ )
+ isActivationLiveData.value = activationInfo.data.activation
+ } else {
+// 用户登录失败
+ verifyErrorMsgLiveData.value = activationInfo.message
+ Log.d("验证失败", activationInfo.message)
+ }
+ }
})
}
}
@@ -396,6 +400,7 @@ class StartViewModel(application: Application) : BaseAndroidViewModel(applicatio
)
appSettings.initSetting(AppSettings.Setting.AutoSave, true)
appSettings.initSetting(AppSettings.Setting.AgreePolicy, false)
+ appSettings.initSetting(AppSettings.Setting.LoginStatus, false)
}
/**
diff --git a/app/src/main/res/drawable/ic_baseline_chevron_right_24.xml b/app/src/main/res/drawable/ic_baseline_chevron_right_24.xml
new file mode 100644
index 0000000..f988e7d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_baseline_chevron_right_24.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
index 054a28c..0846000 100644
--- a/app/src/main/res/drawable/ic_launcher_background.xml
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -5,7 +5,7 @@
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
-
diff --git a/app/src/main/res/drawable/ic_outline_create_24.xml b/app/src/main/res/drawable/ic_outline_create_24.xml
new file mode 100644
index 0000000..5b5fa7a
--- /dev/null
+++ b/app/src/main/res/drawable/ic_outline_create_24.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/app/src/main/res/drawable/round_background_true.xml b/app/src/main/res/drawable/round_background_true.xml
index b361216..c95d1b1 100644
--- a/app/src/main/res/drawable/round_background_true.xml
+++ b/app/src/main/res/drawable/round_background_true.xml
@@ -1,6 +1,6 @@
-
+
+ android:color="?attr/colorOnPrimary" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
index 69a9e84..a5cc0a4 100644
--- a/app/src/main/res/layout/activity_about.xml
+++ b/app/src/main/res/layout/activity_about.xml
@@ -6,11 +6,10 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
+ android:layout_height="?attr/actionBarSize" />
-
+ android:fitsSystemWindows="true"
+ tools:context=".MainActivity">
-
-
-
+ android:layout_height="?attr/actionBarSize" />
@@ -42,7 +36,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
-
-
+
-
-
-
+ android:layout_height="wrap_content"
+ android:fitsSystemWindows="true">
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_creation_wizard.xml b/app/src/main/res/layout/activity_creation_wizard.xml
new file mode 100644
index 0000000..05a74e8
--- /dev/null
+++ b/app/src/main/res/layout/activity_creation_wizard.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml
index 5cec56c..ddf2de1 100644
--- a/app/src/main/res/layout/activity_edit.xml
+++ b/app/src/main/res/layout/activity_edit.xml
@@ -27,8 +27,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
- android:theme="?attr/actionBarStyle"
- app:popupTheme="@style/ThemeOverlay.rust.Concept.popupTheme" />
+ android:theme="?attr/actionBarStyle" />
-
+ android:fitsSystemWindows="true"
+ tools:context=".MainActivity">
-
-
-
-
+ android:fitsSystemWindows="true">
-
+
+
+
+
+
+
+ android:layout_alignParentTop="true"
+ android:text="@string/error_title"
+ android:textSize="16dp" />
-
+
-
-
-
+ android:layout_height="wrap_content"
+ android:layout_below="@id/subTitleView"
+ android:layout_marginTop="8dp">
-
+ android:layout_height="wrap_content"
+ android:hint="@string/error_description"
+ android:imeOptions="actionDone"
+ android:inputType="textMultiLine"
+ android:maxLines="5" />
-
+
-
-
+
-
+
-
+
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_file.xml b/app/src/main/res/layout/activity_file.xml
index fe9e1bb..cae5a72 100644
--- a/app/src/main/res/layout/activity_file.xml
+++ b/app/src/main/res/layout/activity_file.xml
@@ -3,23 +3,18 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:layout_width="match_parent"
- android:layout_height="match_parent">
-
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true">
-
+ android:layout_height="?attr/actionBarSize" />
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 1e79a90..233b91e 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -3,26 +3,25 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerlayout"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:animateLayoutChanges="true">
-
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true">
+ android:fitsSystemWindows="true">
-
@@ -30,7 +29,6 @@
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="?android:windowBackground"
android:visibility="gone"
app:tabMode="fixed"
app:tabTextAppearance="@style/TabLayoutTextStyle">
@@ -48,7 +46,7 @@
app:defaultNavHost="true"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
-
+ android:text="@string/create"
+ app:icon="@drawable/add" />
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_recycling_station.xml b/app/src/main/res/layout/activity_recycling_station.xml
index 510c445..320d82a 100644
--- a/app/src/main/res/layout/activity_recycling_station.xml
+++ b/app/src/main/res/layout/activity_recycling_station.xml
@@ -7,18 +7,13 @@
-
+ android:layout_height="?attr/actionBarSize" />
diff --git a/app/src/main/res/layout/activity_register.xml b/app/src/main/res/layout/activity_register.xml
index ee2ea44..e07395a 100644
--- a/app/src/main/res/layout/activity_register.xml
+++ b/app/src/main/res/layout/activity_register.xml
@@ -4,31 +4,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
+ android:layout_height="wrap_content"
+ android:fitsSystemWindows="true">
-
-
-
-
-
-
+ android:layout_height="?attr/actionBarSize" />
+
+ app:layout_scrollFlags="scroll|enterAlways" />
diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml
index 4260d9b..ccfba72 100644
--- a/app/src/main/res/layout/activity_settings.xml
+++ b/app/src/main/res/layout/activity_settings.xml
@@ -1,26 +1,24 @@
+
-
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true"
+ tools:context=".MainActivity">
-
+ android:layout_height="?attr/actionBarSize" />
-
-
-
-
-
-
-
+ app:layout_scrollFlags="scroll|enterAlways" />
@@ -254,7 +242,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
- android:background="?android:windowBackground"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:tabMode="fixed"
diff --git a/app/src/main/res/layout/head_layout.xml b/app/src/main/res/layout/head_layout.xml
index 7546317..e792997 100644
--- a/app/src/main/res/layout/head_layout.xml
+++ b/app/src/main/res/layout/head_layout.xml
@@ -2,12 +2,12 @@
+ android:paddingBottom="16dp"
+ android:gravity="center_vertical"
+ android:orientation="vertical">
+ android:textSize="24sp" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index 8f5a150..f493e34 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -48,7 +48,6 @@
Unable to create, the Unit is exists.
Rename
Edit text
- Import the mod
Unzip
System default mode
Load files...
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index b877cb2..ec7e96f 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -51,7 +51,6 @@
作成できません。この単位はすでに存在します。
名前の変更
テキストの編集
- モジュールのインポート
ファイルの解凍
システムデフォルトでオン
ファイルをロード...
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 7acf920..004b51c 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -53,7 +53,6 @@
Переименование.
Исправить информационные файлы
Изменить текст.
- Импорт модуля.
Извлеките файл.
Система включена по умолчанию.
Единица не найдена.
diff --git a/app/src/main/res/values-v23/themes.xml b/app/src/main/res/values-v23/themes.xml
new file mode 100644
index 0000000..3acd365
--- /dev/null
+++ b/app/src/main/res/values-v23/themes.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index ff42fff..b6da7f0 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -51,7 +51,6 @@
無法創建,此文件夾已存在。
重命名
編輯文本
- 導入模組
解壓文件
系統默認方式打開
加載文件...
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index a86cb6e..440e2ab 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -30,7 +30,7 @@
始终允许
是的,确实收到了
不,没有
-
+ 创建向导
取消
不再提示
共%1$d个项目支持快速导航。
@@ -81,6 +81,7 @@
请输入标签。
请使用\",\"分割标签,拥有相同标签的作品会被分到一类。
创建模组
+ 创建一个新模组。
过滤
激活账户
激活成功,请重新登录。
@@ -115,8 +116,14 @@
重命名
修复信息文件
编辑文本
- 导入模组
+
导入模板包
+ 导入模组
+ 从文件管理导入模组。
+ 回收站
+ 从回收站恢复模组。
+ 打包目录
+ 导入之前打包的模组。
解压文件
系统默认方式打开
没有找到单位
diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml
index 0e032d0..7accbef 100644
--- a/app/src/main/res/values/themes.xml
+++ b/app/src/main/res/values/themes.xml
@@ -10,39 +10,12 @@
-
+
-
-
-
-
-
-
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/ActivationInfo.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/ActivationInfo.kt
new file mode 100644
index 0000000..75ddd5d
--- /dev/null
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/ActivationInfo.kt
@@ -0,0 +1,34 @@
+package com.coldmint.rust.core.dataBean.user
+
+
+import com.google.gson.annotations.SerializedName
+
+data class ActivationInfo(
+ @SerializedName("code")
+ val code: Int,
+ @SerializedName("data")
+ val `data`: Data,
+ @SerializedName("message")
+ val message: String
+) {
+ data class Data(
+ @SerializedName("account")
+ val account: String,
+ @SerializedName("activation")
+ val activation: Boolean,
+ @SerializedName("headIcon")
+ val headIcon: String?,
+ @SerializedName("banTime")
+ val banTime: String?,
+ @SerializedName("email")
+ val email: String,
+ @SerializedName("enable")
+ val enable: String,
+ @SerializedName("expirationTime")
+ val expirationTime: String,
+ @SerializedName("userName")
+ val userName: String,
+ @SerializedName("permission")
+ val permission: Int
+ )
+}
\ No newline at end of file
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/UserData.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/UserData.kt
index a7514c1..30bad23 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/UserData.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/dataBean/user/UserData.kt
@@ -1,30 +1,22 @@
package com.coldmint.rust.core.dataBean.user
-/**
- * 用户数据
- * @property code Int
- * @property `data` Data
- * @property message String
- * @constructor
- */
+
+import com.google.gson.annotations.SerializedName
+
data class UserData(
+ @SerializedName("code")
val code: Int,
+ @SerializedName("data")
val `data`: Data,
+ @SerializedName("message")
val message: String
) {
data class Data(
- val account: String,
- val appID: String,
- val creationTime: String,
- val email: String,
- val enable: Boolean,
+ @SerializedName("activation")
+ val activation: Boolean,
+ @SerializedName("expirationTime")
val expirationTime: String,
- val gender: Int,
- val headIcon: String?,
- val loginTime: String,
- val password: String,
- val permission: Int,
- val userName: String,
- val activation: Boolean
+ @SerializedName("token")
+ val token: String
)
}
\ No newline at end of file
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/ActivationApp.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/ActivationApp.kt
index 048179b..ef76a34 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/ActivationApp.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/ActivationApp.kt
@@ -16,7 +16,6 @@ import java.io.IOException
* @author Cold Mint
* @date 2021/12/22 20:12
*/
-@Deprecated("已废弃")
class ActivationApp private constructor() {
companion object {
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/AppUpdate.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/AppUpdate.kt
index 008dfb2..05dc6f2 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/AppUpdate.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/AppUpdate.kt
@@ -9,7 +9,6 @@ import com.google.gson.Gson
import okhttp3.*
import java.io.IOException
-@Deprecated("已废弃")
class AppUpdate {
/**
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/BannerManager.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/BannerManager.kt
index 751b32b..04ac8dd 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/BannerManager.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/BannerManager.kt
@@ -12,7 +12,6 @@ import java.io.IOException
/**
* 轮播图管理器
*/
-@Deprecated("已废弃")
class BannerManager private constructor() {
companion object {
val instance: BannerManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Community.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Community.kt
index 8a240ca..d455146 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Community.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Community.kt
@@ -10,7 +10,6 @@ import com.google.gson.Gson
import okhttp3.*
import java.io.IOException
-@Deprecated("已废弃")
object Community {
/**
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Coupon.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Coupon.kt
index 6b10687..e216557 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Coupon.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Coupon.kt
@@ -14,7 +14,6 @@ import java.io.IOException
* @author Cold Mint
* @date 2022/1/10 20:17
*/
-@Deprecated("已废弃")
class Coupon {
companion object {
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Dynamic.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Dynamic.kt
index 62b69fe..06d20d4 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Dynamic.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Dynamic.kt
@@ -14,7 +14,6 @@ import java.io.IOException
/**
* 动态
*/
-@Deprecated("已废弃")
class Dynamic private constructor() {
companion object {
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Report.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Report.kt
index 5a6de83..0f9e7c1 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Report.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Report.kt
@@ -15,7 +15,6 @@ import java.io.IOException
* @author Cold Mint
* @date 2022/1/6 19:45
*/
-@Deprecated("已废弃")
class Report private constructor() {
companion object {
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Search.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Search.kt
index 034a74c..6e35dd6 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Search.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/Search.kt
@@ -9,7 +9,6 @@ import com.google.gson.Gson
import okhttp3.*
import java.io.IOException
-@Deprecated("已过时")
class Search private constructor() {
companion object {
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/User.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/User.kt
index 912759c..218c3a7 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/User.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/User.kt
@@ -5,6 +5,7 @@ import android.os.Looper
import com.coldmint.rust.core.dataBean.ApiResponse
import com.coldmint.rust.core.dataBean.LoginRequestData
import com.coldmint.rust.core.dataBean.RegisterRequestData
+import com.coldmint.rust.core.dataBean.user.ActivationInfo
import com.coldmint.rust.core.dataBean.user.SocialInfoData
import com.coldmint.rust.core.dataBean.user.SpaceInfoData
import com.coldmint.rust.core.dataBean.user.UserData
@@ -21,7 +22,6 @@ import java.lang.NullPointerException
/**
* 用户类
*/
-@Deprecated("已废弃")
object User {
/**
@@ -314,6 +314,48 @@ object User {
})
}
+ /**
+ * 获取用户激活信息
+ * @param token String
+ * @param apiCallBack ApiCallBack
+ */
+ fun getUserActivationInfo(token : String, apiCallBack: ApiCallBack) {
+ val okHttpClient = ServerConfiguration.initOkHttpClient()
+ val requestBody: FormBody =
+ FormBody.Builder().add("token", token)
+ .build()
+ val request =
+ Request.Builder()
+ .url(ServerConfiguration.website + "php/user.php?action=getUserActivationInfo")
+ .post(requestBody).build()
+ val call = okHttpClient.newCall(request)
+ val handler = Handler(Looper.getMainLooper())
+ val gson = Gson()
+ call.enqueue(object : Callback {
+ override fun onFailure(call: Call, e: IOException) {
+ e.printStackTrace()
+ handler.post { apiCallBack.onFailure(e) }
+ }
+
+ override fun onResponse(call: Call, response: Response) {
+ try {
+ val data = response.body!!.string()
+ val finalActivationInfo =
+ gson.fromJson(data, ActivationInfo::class.java)
+ handler.post {
+ apiCallBack.onResponse(finalActivationInfo)
+ }
+ } catch (e: Exception) {
+ e.printStackTrace()
+ handler.post {
+ apiCallBack.onFailure(e)
+ }
+ }
+ }
+
+ })
+ }
+
/**
* 获取用户社交信息
* @param apiCallBack ApiCallBack
diff --git a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/WebMod.kt b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/WebMod.kt
index 7ba5286..03e59d0 100644
--- a/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/WebMod.kt
+++ b/assistantCoreLibrary/src/main/java/com/coldmint/rust/core/web/WebMod.kt
@@ -14,7 +14,6 @@ import okhttp3.RequestBody.Companion.asRequestBody
import java.io.File
import java.io.IOException
-@Deprecated("已废弃")
class WebMod private constructor() {
enum class SortMode(private val value: String) {
diff --git a/assistantCoreLibrary/src/main/res/values/colors.xml b/assistantCoreLibrary/src/main/res/values/colors.xml
index a4d7e56..e6bdf9f 100644
--- a/assistantCoreLibrary/src/main/res/values/colors.xml
+++ b/assistantCoreLibrary/src/main/res/values/colors.xml
@@ -2,4 +2,5 @@
#D32F2F
#FBC02D
+ #2196F3
\ No newline at end of file
diff --git a/networkApi/src/main/java/com/coldmint/rust/networkapi/NetworkManager.kt b/networkApi/src/main/java/com/coldmint/rust/networkapi/NetworkManager.kt
index c7a8c17..5d4a626 100644
--- a/networkApi/src/main/java/com/coldmint/rust/networkapi/NetworkManager.kt
+++ b/networkApi/src/main/java/com/coldmint/rust/networkapi/NetworkManager.kt
@@ -10,12 +10,15 @@ import retrofit2.converter.gson.GsonConverterFactory
/**
* 网络管理器
*/
+
+@Deprecated("已废弃", level = DeprecationLevel.HIDDEN)
object NetworkManager {
private var baseUrl: String? = null
private var retrofit: Retrofit? = null
+
const val debugKey = "网络管理器"
/**
diff --git a/settings.gradle b/settings.gradle
index b51be95..bd1c7f1 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,4 +1,3 @@
include ':app'
rootProject.name = "铁锈助手"
include ':assistantCoreLibrary'
-include ':networkApi'