This commit is contained in:
coldmint 2022-07-02 18:11:56 +08:00
parent a129213ba3
commit dc3d0ea1f4
69 changed files with 633 additions and 403 deletions

Binary file not shown.

View File

@ -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'

View File

@ -23,6 +23,9 @@
android:supportsRtl="true"
android:theme="@style/Theme.rust.Concept"
android:usesCleartextTraffic="true">
<activity
android:name=".CreationWizardActivity"
android:exported="false" />
<activity
android:name=".TurretDesignActivity"
android:exported="false" />

View File

@ -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<ActivityCreationWizardBinding>() {
//创建向导类型(模组,模板包)
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<GuideData>()
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)
}
}

View File

@ -156,8 +156,6 @@ class FileManagerActivity : BaseActivity<ActivityFileBinding>() {
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,9 +233,7 @@ class FileManagerActivity : BaseActivity<ActivityFileBinding>() {
//加载文件
fun loadFiles(file: File) {
executorService.submit {
if (file.isDirectory) {
val files = file.listFiles()
if (files == null || !file.exists()) {
if (!file.exists()) {
runOnUiThread {
viewBinding.fileList.isVisible = false
viewBinding.progressBar.isVisible = false
@ -247,6 +243,9 @@ class FileManagerActivity : BaseActivity<ActivityFileBinding>() {
}
return@submit
}
if (file.isDirectory) {
val files = file.listFiles()
directs = file
val fileArrayList: ArrayList<File?> = ArrayList(listOf(*files))
if (file.absolutePath != mRoot.absolutePath) {
@ -472,7 +471,6 @@ class FileManagerActivity : BaseActivity<ActivityFileBinding>() {
}
/**
* 解析文件路径
*

View File

@ -106,34 +106,28 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>() {
}
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<UserData> {
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 {

View File

@ -314,62 +314,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
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)

View File

@ -22,8 +22,8 @@ class RecyclingStationActivity : BaseActivity<ActivityRecyclingStationBinding>()
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<ActivityRecyclingStationBinding>()
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 ->

View File

@ -450,7 +450,7 @@ class RegisterActivity : BaseActivity<ActivityRegisterBinding>() {
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
if (canUseView) {
viewBinding.toolbar.setTitle(R.string.register)
title = getString(R.string.register)
setReturnButton()
initAction()
}

View File

@ -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

View File

@ -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<ActivityUserHomePageBinding>() {
@ -46,9 +43,6 @@ class UserHomePageActivity : BaseActivity<ActivityUserHomePageBinding>() {
val userHomeStateAdapter by lazy {
UserHomeStateAdapter(this, userId)
}
val videoHelper by lazy {
GSYVideoHelper(this)
}
val appID by lazy {
@ -95,23 +89,9 @@ class UserHomePageActivity : BaseActivity<ActivityUserHomePageBinding>() {
}
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()
}
/**
* 打开用户列表

View File

@ -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<GuideData>) :
BaseAdapter<ItemGuideBinding, GuideData>(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<ItemGuideBinding>,
position: Int
) {
viewBinding.iconView.setImageResource(data.imageRes)
viewBinding.titleView.setText(data.titleRes)
viewBinding.describeView.setText(data.describeRes)
}
}

View File

@ -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<ViewBingType : ViewBinding> :
}
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<Toolbar>(R.id.toolbar)
if (toolBar == null) {
MaterialDialog(this).title(R.string.app_name).message(text = "启动失败,未找到标题栏")
.positiveButton(text = "确定").cancelable(false).show()
} else {
val toolBar = findViewById<MaterialToolbar>(R.id.toolbar)
if (toolBar != null) {
setSupportActionBar(toolBar)
}
whenCreateActivity(savedInstanceState, true)

View File

@ -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)

View File

@ -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<FragmentUserInfoBinding>() {
super.onResume()
if (account.isNotBlank()) {
User.getInfo(account, object : ApiCallBack<UserData> {
override fun onResponse(t: UserData) {
User.getUserActivationInfo(account, object : ApiCallBack<ActivationInfo> {
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<FragmentUserInfoBinding>() {
}
}
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<FragmentUserInfoBinding>() {
}
viewBinding.logOutButton.setOnClickListener {
requireActivity().finish()
appSettings.setValue(AppSettings.Setting.LoginStatus, false)
startActivity(Intent(requireContext(), LoginActivity::class.java))
}
}

View File

@ -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"
}
}

View File

@ -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)
}

View File

@ -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<UserData>()
MutableLiveData<ActivationInfo>()
}
/**
@ -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<UserData> {
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<ActivationInfo> {
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)
}
/**

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
</vector>

View File

@ -5,7 +5,7 @@
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#E91E63"
<path android:fillColor="@color/icon_color"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM5.92,19H5v-0.92l9.06,-9.06 0.92,0.92L5.92,19zM20.71,5.63l-2.34,-2.34c-0.2,-0.2 -0.45,-0.29 -0.71,-0.29s-0.51,0.1 -0.7,0.29l-1.83,1.83 3.75,3.75 1.83,-1.83c0.39,-0.39 0.39,-1.02 0,-1.41z"/>
</vector>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="?attr/colorPrimaryVariant" />
<solid android:color="?attr/colorPrimary" />
<corners
android:bottomLeftRadius="16dp"
android:bottomRightRadius="16dp"
@ -8,5 +8,5 @@
android:topRightRadius="16dp" />
<stroke
android:width="1dp"
android:color="?attr/colorSecondary" />
android:color="?attr/colorOnPrimary" />
</shape>

View File

@ -6,11 +6,10 @@
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
android:layout_height="?attr/actionBarSize" />
<RelativeLayout
android:layout_width="match_parent"

View File

@ -1,28 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true">
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?android:windowBackground"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="?attr/actionBarStyle"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
@ -42,7 +36,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.cardview.widget.CardView
<com.google.android.material.circularreveal.cardview.CircularRevealCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardElevation="2dp"
@ -72,7 +66,7 @@
android:layout_height="wrap_content"
android:text="@string/app_name" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.circularreveal.cardview.CircularRevealCardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"

View File

@ -1,21 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true"
tools:context=".BrowserActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/linearProgressIndicator"
android:indeterminate="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:indeterminate="true" />
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginRight="16dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -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" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"

View File

@ -1,11 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="8dp">
android:padding="8dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<TextView
android:id="@+id/titleView"
@ -31,8 +53,8 @@
android:layout_marginTop="8dp">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:id="@+id/inputEditView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/error_description"
android:imeOptions="actionDone"
@ -88,3 +110,4 @@
android:text="@string/restart" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -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">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?android:windowBackground"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="?attr/actionBarStyle"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>

View File

@ -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">
<androidx.coordinatorlayout.widget.CoordinatorLayout
<com.google.android.material.circularreveal.coordinatorlayout.CircularRevealCoordinatorLayout
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:background="?android:windowBackground">
android:fitsSystemWindows="true">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:animateLayoutChanges="true"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax"
app:layout_scrollFlags="scroll|enterAlways" />
@ -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" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/mainButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -56,18 +54,18 @@
android:layout_margin="16dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="24dp"
android:src="@drawable/add"
app:tint="@color/white" />
android:text="@string/create"
app:icon="@drawable/add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</com.google.android.material.circularreveal.coordinatorlayout.CircularRevealCoordinatorLayout>
<com.google.android.material.navigation.NavigationView
android:id="@+id/navaiagtion"
android:layout_width="260dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?android:windowBackground"
android:fitsSystemWindows="true"
app:menu="@menu/menu_drawer_left" />
</androidx.drawerlayout.widget.DrawerLayout>

View File

@ -7,18 +7,13 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?android:windowBackground"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="?attr/actionBarStyle"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>

View File

@ -4,31 +4,19 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="?android:windowBackground">
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="?attr/actionBarStyle"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -18,8 +18,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.rust.Concept.popupTheme" />
app:layout_scrollFlags="scroll|enterAlways" />
</com.google.android.material.appbar.AppBarLayout>

View File

@ -1,26 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?android:windowBackground"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/settings"
android:layout_width="match_parent"

View File

@ -4,17 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer
android:id="@+id/videoView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
@ -243,8 +232,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.rust.Concept.popupTheme" />
app:layout_scrollFlags="scroll|enterAlways" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
@ -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"

View File

@ -2,12 +2,12 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingTop="24dp"
android:paddingLeft="16dp"
android:paddingTop="8dp"
android:paddingRight="16dp"
android:paddingBottom="8dp">
android:paddingBottom="16dp"
android:gravity="center_vertical"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView"
@ -21,7 +21,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/user_name"
android:textSize="16sp" />
android:textSize="24sp" />
<TextView
android:id="@+id/emailView"

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dp">
<com.google.android.material.circularreveal.cardview.CircularRevealCardView
android:id="@+id/cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:padding="8dp"
android:id="@+id/iconView"
android:layout_width="75dp"
android:layout_height="75dp"
android:src="@drawable/image" />
</com.google.android.material.circularreveal.cardview.CircularRevealCardView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/cardView"
android:layout_alignBottom="@id/cardView"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_toStartOf="@id/openView"
android:layout_toEndOf="@id/cardView"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/titleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="标题"
android:textSize="16sp" />
<TextView
android:id="@+id/describeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:text="描述" />
</LinearLayout>
<ImageView
android:id="@+id/openView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_baseline_chevron_right_24" />
</RelativeLayout>

View File

@ -48,7 +48,6 @@
<string name="unit_error">Unable to create, the Unit is exists.</string>
<string name="mod_action9">Rename</string>
<string name="open_action1">Edit text</string>
<string name="open_action2">Import the mod</string>
<string name="open_action3">Unzip</string>
<string name="open_action4">System default mode</string>
<string name="loading_files">Load files...</string>

View File

@ -51,7 +51,6 @@
<string name="unit_error">作成できません。この単位はすでに存在します。</string>
<string name="mod_action9">名前の変更</string>
<string name="open_action1">テキストの編集</string>
<string name="open_action2">モジュールのインポート</string>
<string name="open_action3">ファイルの解凍</string>
<string name="open_action4">システムデフォルトでオン</string>
<string name="loading_files">ファイルをロード...</string>

View File

@ -53,7 +53,6 @@
<string name="mod_action9">Переименование.</string>
<string name="mod_action10">Исправить информационные файлы</string>
<string name="open_action1">Изменить текст.</string>
<string name="open_action2">Импорт модуля.</string>
<string name="open_action3">Извлеките файл.</string>
<string name="open_action4">Система включена по умолчанию.</string>
<string name="not_find_units">Единица не найдена.</string>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.rust.Concept" parent="Base.rust.Concept">
<!-- Transparent system bars for edge-to-edge. -->
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
</style>
</resources>

View File

@ -51,7 +51,6 @@
<string name="folder_error">無法創建,此文件夾已存在。</string>
<string name="mod_action9">重命名</string>
<string name="open_action1">編輯文本</string>
<string name="open_action2">導入模組</string>
<string name="open_action3">解壓文件</string>
<string name="open_action4">系統默認方式打開</string>
<string name="loading_files">加載文件...</string>

View File

@ -30,7 +30,7 @@
<string name="always_allow">始终允许</string>
<string name="pay_yes">是的,确实收到了</string>
<string name="pay_no">不,没有</string>
<string name="creation_wizard">创建向导</string>
<string name="dialog_cancel">取消</string>
<string name="no_longer_prompt">不再提示</string>
<string name="navigation_tip">共%1$d个项目支持快速导航。</string>
@ -81,6 +81,7 @@
<string name="tags_error">请输入标签。</string>
<string name="mod_tags_help">请使用\",\"分割标签,拥有相同标签的作品会被分到一类。</string>
<string name="create_mod_lable">创建模组</string>
<string name="create_mod_describe">创建一个新模组。</string>
<string name="filter">过滤</string>
<string name="activate_the_account">激活账户</string>
<string name="activate_the_account_ok">激活成功,请重新登录。</string>
@ -115,8 +116,14 @@
<string name="mod_action9">重命名</string>
<string name="mod_action10">修复信息文件</string>
<string name="open_action1">编辑文本</string>
<string name="open_action2">导入模组</string>
<string name="import_template">导入模板包</string>
<string name="import_mod">导入模组</string>
<string name="import_mod_from_file_manager_describe">从文件管理导入模组。</string>
<string name="import_mod_from_recycle_bin">回收站</string>
<string name="import_mod_from_recycle_bin_describe">从回收站恢复模组。</string>
<string name="import_mod_from_package_directory">打包目录</string>
<string name="import_mod_from_package_directory_describe">导入之前打包的模组。</string>
<string name="open_action3">解压文件</string>
<string name="open_action4">系统默认方式打开</string>
<string name="not_find_units">没有找到单位</string>

View File

@ -10,39 +10,12 @@
<!--概念主题 -->
<style name="Theme.rust.Concept" parent="Base.rust.Concept">
<!--主色调-->
<!-- <item name="colorPrimary">@color/pink_500</item>-->
<!--主色调变体-->
<!-- <item name="colorPrimaryVariant">@color/pink_200</item>-->
<!--主色调之上-->
<!-- <item name="colorOnPrimary">@color/white</item>-->
<!--次要颜色-->
<!-- <item name="colorSecondary">@color/blue_500</item>-->
<!-- <item name="colorSecondaryVariant">@color/blue_700</item>-->
<!-- <item name="colorOnSecondary">@color/black</item>-->
<!-- <item name="android:statusBarColor">@color/white_200</item>-->
<!-- <item name="android:windowLightStatusBar" tools:targetApi="m">true</item>-->
<!-- <item name="actionBarStyle">@style/ThemeOverlay.rust.Concept.ActionBar</item>-->
<!-- <item name="android:windowBackground">@color/white_200</item>-->
<!-- <item name="android:navigationBarColor">@color/white_200</item>-->
<!-- <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">true</item>-->
</style>
<style name="Theme.rust.Concept" parent="Base.rust.Concept" />
<style name="Base.rust.Concept" parent="Theme.Material3.DayNight.NoActionBar"/>
<!--概念活动栏样式-->
<style name="ThemeOverlay.rust.Concept.ActionBar" parent="ThemeOverlay.Material3.ActionBar">
<item name="android:textColorPrimary">@color/black</item>
<item name="colorPrimary">?android:windowBackground</item>
</style>
<style name="ThemeOverlay.rust.Concept.popupTheme" parent="ThemeOverlay.Material3.Light">
<style name="Base.rust.Concept" parent="Theme.Material3.DynamicColors.DayNight">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
<!--设置标签为小写-->

View File

@ -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
)
}

View File

@ -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
)
}

View File

@ -16,7 +16,6 @@ import java.io.IOException
* @author Cold Mint
* @date 2021/12/22 20:12
*/
@Deprecated("已废弃")
class ActivationApp private constructor() {
companion object {

View File

@ -9,7 +9,6 @@ import com.google.gson.Gson
import okhttp3.*
import java.io.IOException
@Deprecated("已废弃")
class AppUpdate {
/**

View File

@ -12,7 +12,6 @@ import java.io.IOException
/**
* 轮播图管理器
*/
@Deprecated("已废弃")
class BannerManager private constructor() {
companion object {
val instance: BannerManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {

View File

@ -10,7 +10,6 @@ import com.google.gson.Gson
import okhttp3.*
import java.io.IOException
@Deprecated("已废弃")
object Community {
/**

View File

@ -14,7 +14,6 @@ import java.io.IOException
* @author Cold Mint
* @date 2022/1/10 20:17
*/
@Deprecated("已废弃")
class Coupon {
companion object {

View File

@ -14,7 +14,6 @@ import java.io.IOException
/**
* 动态
*/
@Deprecated("已废弃")
class Dynamic private constructor() {
companion object {

View File

@ -15,7 +15,6 @@ import java.io.IOException
* @author Cold Mint
* @date 2022/1/6 19:45
*/
@Deprecated("已废弃")
class Report private constructor() {
companion object {

View File

@ -9,7 +9,6 @@ import com.google.gson.Gson
import okhttp3.*
import java.io.IOException
@Deprecated("已过时")
class Search private constructor() {
companion object {

View File

@ -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<ActivationInfo>
*/
fun getUserActivationInfo(token : String, apiCallBack: ApiCallBack<ActivationInfo>) {
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<WebModData>

View File

@ -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) {

View File

@ -2,4 +2,5 @@
<resources>
<color name="red">#D32F2F</color>
<color name="yellow">#FBC02D</color>
<color name="icon_color">#2196F3</color>
</resources>

View File

@ -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 = "网络管理器"
/**

View File

@ -1,4 +1,3 @@
include ':app'
rootProject.name = "铁锈助手"
include ':assistantCoreLibrary'
include ':networkApi'