评论升级
This commit is contained in:
parent
3a691b33aa
commit
1afe92d237
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -10,7 +10,6 @@ import android.text.style.ClickableSpan
|
|||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
|
|
@ -9,12 +9,10 @@ import android.os.Bundle
|
|||
import android.os.Handler
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import com.coldmint.rust.pro.adapters.ApplicationListAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityApplicationListBinding
|
||||
import com.coldmint.rust.pro.tool.Decoration
|
||||
import java.util.ArrayList
|
||||
|
||||
class ApplicationListActivity : BaseActivity<ActivityApplicationListBinding>() {
|
||||
|
|
|
@ -123,8 +123,7 @@ class CreateModActivity : BaseActivity<ActivityCreateModBinding>() {
|
|||
fileWriter.close()
|
||||
finish()
|
||||
} catch (e: IOException) {
|
||||
Toast.makeText(this@CreateModActivity, e.toString(), Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
e.printStackTrace()
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this@CreateModActivity, "你的手机拒绝创建目录", Toast.LENGTH_SHORT).show()
|
||||
|
|
|
@ -5,12 +5,17 @@ import android.content.Intent
|
|||
import cat.ereza.customactivityoncrash.CustomActivityOnCrash
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.KeyEvent
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import com.coldmint.rust.core.dataBean.ApiResponse
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.tool.FileOperator
|
||||
import com.coldmint.rust.core.web.ErrorReport
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.pro.databean.ErrorInfo
|
||||
import com.coldmint.rust.pro.databinding.ActivityErrorBinding
|
||||
|
@ -47,6 +52,25 @@ class ErrorActivity() : BaseActivity<ActivityErrorBinding>() {
|
|||
}
|
||||
viewBinding.errorInfo.text = errorInfo.allErrorDetails
|
||||
Log.e("错误日志", errorInfo.allErrorDetails)
|
||||
if (appSettings.getValue(AppSettings.Setting.ExperiencePlan, true)) {
|
||||
val info = packageManager.getPackageInfo(packageName, 0)
|
||||
ErrorReport.instance.send(
|
||||
errorInfo.allErrorDetails,
|
||||
info.versionName,
|
||||
info.versionCode,
|
||||
object : ApiCallBack<ApiResponse> {
|
||||
override fun onResponse(t: ApiResponse) {
|
||||
if (t.code == ServerConfiguration.Success_Code) {
|
||||
viewBinding.shareLogButton.isVisible = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
saveLog()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,9 @@ import com.coldmint.rust.pro.tool.AppSettings
|
|||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import android.widget.Toast
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.SearchView
|
||||
import androidx.core.view.GravityCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
|
@ -20,6 +18,7 @@ import androidx.navigation.findNavController
|
|||
import androidx.navigation.ui.*
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.bumptech.glide.Glide
|
||||
import com.coldmint.rust.pro.dialog.CommentDialog
|
||||
import com.coldmint.dialog.CoreDialog
|
||||
import com.coldmint.rust.core.CompressionManager
|
||||
import com.coldmint.rust.core.TemplatePackage
|
||||
|
@ -48,7 +47,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
private var oldLanguage: String? = null
|
||||
private var first = true
|
||||
var tabLayout: TabLayout? = null
|
||||
lateinit var searchView: SearchView
|
||||
val headLayout by lazy {
|
||||
HeadLayoutBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
@ -86,9 +84,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
viewBinding.mainButton.hide()
|
||||
R.id.community_item
|
||||
} else {
|
||||
viewBinding.toolbar.postDelayed({
|
||||
searchView.isVisible = false
|
||||
}, linkInterval)
|
||||
R.id.mod_item
|
||||
}
|
||||
navController.graph = this
|
||||
|
@ -256,11 +251,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
val codeTable = menu.findItem(R.id.code_table)
|
||||
val mod = menu.findItem(R.id.mod_item)
|
||||
val community = menu.findItem(R.id.community_item)
|
||||
val help = menu.findItem(R.id.help)
|
||||
// val help = menu.findItem(R.id.help)
|
||||
//管理可见性
|
||||
dataBase.isVisible = isActive
|
||||
template.isVisible = isActive
|
||||
help.isVisible = isActive
|
||||
// help.isVisible = isActive
|
||||
codeTable.isVisible = isActive
|
||||
if (mod.isChecked) {
|
||||
viewBinding.mainButton.isVisible = isActive
|
||||
|
@ -272,7 +267,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
viewBinding.tabLayout.isVisible = false
|
||||
viewBinding.mainButton.hide()
|
||||
}, hideViewDelay)
|
||||
searchView.isVisible = false
|
||||
false
|
||||
}
|
||||
|
||||
|
@ -281,7 +275,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
viewBinding.tabLayout.isVisible = false
|
||||
viewBinding.mainButton.show()
|
||||
}, hideViewDelay)
|
||||
searchView.isVisible = false
|
||||
false
|
||||
}
|
||||
|
||||
|
@ -307,7 +300,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
startActivity(intent)
|
||||
}
|
||||
else -> {
|
||||
Toast.makeText(this@MainActivity, "请设置事件", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -318,7 +310,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
if (it) {
|
||||
viewBinding.mainButton.postOnAnimationDelayed({
|
||||
viewBinding.tabLayout.isVisible = true
|
||||
searchView.isVisible = false
|
||||
if (isActive) {
|
||||
viewBinding.mainButton.show()
|
||||
}
|
||||
|
@ -330,7 +321,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
|
||||
community.setOnMenuItemClickListener {
|
||||
viewBinding.mainButton.postOnAnimationDelayed({
|
||||
searchView.isVisible = true
|
||||
viewBinding.tabLayout.isVisible = true
|
||||
viewBinding.mainButton.hide()
|
||||
}, hideViewDelay)
|
||||
|
@ -364,18 +354,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
false
|
||||
}
|
||||
|
||||
help.setOnMenuItemClickListener {
|
||||
AppOperator.useBrowserAccessWebPage(
|
||||
this,
|
||||
"https://www.kancloud.cn/coldmint/rust_assistant"
|
||||
)
|
||||
false
|
||||
}
|
||||
|
||||
menu.findItem(R.id.donation).setOnMenuItemClickListener {
|
||||
AppOperator.useBrowserAccessWebPage(this@MainActivity, "https://afdian.net/@coldmint")
|
||||
false
|
||||
}
|
||||
//激活暂时不可用
|
||||
val longTime = appSettings.getValue(
|
||||
AppSettings.Setting.ExpirationTime,
|
||||
|
@ -752,6 +730,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
initNav()
|
||||
observeStartViewModel()
|
||||
checkAppUpdate()
|
||||
CommentDialog(this).show()
|
||||
} else {
|
||||
startViewModel.initAllData()
|
||||
}
|
||||
|
|
|
@ -2,19 +2,19 @@ package com.coldmint.rust.pro
|
|||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.os.Environment
|
||||
import android.util.Log
|
||||
import cat.ereza.customactivityoncrash.config.CaocConfig
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||
import com.google.android.material.color.DynamicColors
|
||||
import com.google.android.material.color.DynamicColorsOptions
|
||||
import com.hjq.language.MultiLanguages
|
||||
import java.util.*
|
||||
|
||||
class RustApplication : Application() {
|
||||
|
||||
// companion object {
|
||||
// val appId = "61853bf9e0f9bb492b4f7eba"
|
||||
// val channel = "Umeng"
|
||||
// }
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
@ -47,6 +47,8 @@ class RustApplication : Application() {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun attachBaseContext(base: Context?) {
|
||||
super.attachBaseContext(MultiLanguages.attach(base))
|
||||
}
|
||||
|
|
|
@ -6,9 +6,11 @@ import android.os.Bundle
|
|||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.core.dataBean.HotSearchData
|
||||
import com.coldmint.rust.core.dataBean.SearchSuggestionsData
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.web.Search
|
||||
import com.coldmint.rust.pro.adapters.HotSearchAdapter
|
||||
import com.coldmint.rust.pro.adapters.SearchSuggestionsAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivitySearchBinding
|
||||
|
@ -21,7 +23,34 @@ class SearchActivity : BaseActivity<ActivitySearchBinding>() {
|
|||
title = getString(R.string.search)
|
||||
setReturnButton()
|
||||
viewBinding.recyclerView.layoutManager = LinearLayoutManager(this)
|
||||
viewBinding.hotSearchView.layoutManager = LinearLayoutManager(this)
|
||||
loadSearchView()
|
||||
loadHotSearch()
|
||||
}
|
||||
|
||||
|
||||
private fun loadHotSearch() {
|
||||
Search.instance.hotSearch(object : ApiCallBack<HotSearchData> {
|
||||
override fun onResponse(t: HotSearchData) {
|
||||
val adapter = HotSearchAdapter(this@SearchActivity, t.data)
|
||||
adapter.setItemEvent { i, itemHotSearchBinding, viewHolder, data ->
|
||||
itemHotSearchBinding.root.setOnClickListener {
|
||||
val intent = Intent(this@SearchActivity, SearchResultActivity::class.java)
|
||||
intent.putExtra("key", data.keyword)
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
viewBinding.hotSearchView.adapter = adapter
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private fun loadSearchView() {
|
||||
viewBinding.searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener,
|
||||
android.widget.SearchView.OnQueryTextListener {
|
||||
override fun onQueryTextSubmit(query: String?): Boolean {
|
||||
|
|
|
@ -147,12 +147,12 @@ class SettingsActivity : BaseActivity<ActivitySettingsBinding>() {
|
|||
val nightMode: SwitchPreference? =
|
||||
manager.findPreference<SwitchPreference>(getString(R.string.setting_night_mode))
|
||||
nightMode?.setOnPreferenceChangeListener { preference, newValue ->
|
||||
val booleanValue = newValue as Boolean
|
||||
if (booleanValue) {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||
} else {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
||||
}
|
||||
val booleanValue = newValue as Boolean
|
||||
if (booleanValue) {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||
} else {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.coldmint.rust.core.dataBean.HotSearchData
|
||||
import com.coldmint.rust.pro.base.BaseAdapter
|
||||
import com.coldmint.rust.pro.databinding.ItemHotSearchBinding
|
||||
|
||||
class HotSearchAdapter(context: Context, dataList: MutableList<HotSearchData.Data>) :
|
||||
BaseAdapter<ItemHotSearchBinding, HotSearchData.Data>(context, dataList) {
|
||||
override fun getViewBindingObject(
|
||||
layoutInflater: LayoutInflater,
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): ItemHotSearchBinding {
|
||||
return ItemHotSearchBinding.inflate(layoutInflater,parent,false)
|
||||
}
|
||||
|
||||
override fun onBingView(
|
||||
data: HotSearchData.Data,
|
||||
viewBinding: ItemHotSearchBinding,
|
||||
viewHolder: ViewHolder<ItemHotSearchBinding>,
|
||||
position: Int
|
||||
) {
|
||||
viewBinding.titleView.text = data.keyword
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.coldmint.rust.pro.dialog
|
||||
|
||||
import android.R
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.*
|
||||
import com.coldmint.dialog.BaseBottomDialog
|
||||
import com.coldmint.rust.pro.databinding.DialogCommentBinding
|
||||
import com.coldmint.rust.pro.tool.LinkAutoCompleteHelper
|
||||
import com.coldmint.rust.pro.tool.TextStyleMaker
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||
|
||||
|
||||
/**
|
||||
* 评论对话框,部分方法与输入对话框逻辑相同
|
||||
* @property autoDismiss Boolean
|
||||
* @property inputCanBeEmpty Boolean
|
||||
* @property errorTipFunction Function2<String, TextInputLayout, Unit>?
|
||||
*/
|
||||
class CommentDialog(context: Context) : BaseBottomDialog<DialogCommentBinding>(context) {
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): DialogCommentBinding {
|
||||
return DialogCommentBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
|
||||
override fun onShowDialog(viewBinding: DialogCommentBinding) {
|
||||
viewBinding.textInputEditText.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun afterTextChanged(p0: Editable?) {
|
||||
if (p0 != null) {
|
||||
TextStyleMaker.instance.setStyle(p0, { type, data ->
|
||||
TextStyleMaker.instance.clickEvent(context, type, data)
|
||||
},context)
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -84,7 +84,7 @@ class RecommendedFragment : BaseFragment<RecommendedFragmentBinding>() {
|
|||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
showToast { e.toString() }
|
||||
e.printStackTrace()
|
||||
viewBinding.randomRecommendedProgressIndicator.isVisible = false
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,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, Token, LoginStatus, DynamicColor
|
||||
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, DynamicColor, ExperiencePlan
|
||||
}
|
||||
|
||||
|
||||
|
@ -289,6 +289,7 @@ class AppSettings private constructor(val mContext: Context) {
|
|||
map[Setting.AutoSave] = mContext.getString(R.string.setting_auto_save)
|
||||
map[Setting.ServerAddress] = mContext.getString(R.string.setting_server_address)
|
||||
map[Setting.DynamicColor] = mContext.getString(R.string.setting_dynamic_color)
|
||||
map[Setting.ExperiencePlan] = mContext.getString(R.string.experience_the_plan)
|
||||
//仅保存不可显示
|
||||
map[Setting.SetGameStorage] = "SetGameStorage"
|
||||
map[Setting.AppID] = "AppId"
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
package com.coldmint.rust.pro.tool
|
||||
|
||||
import android.R
|
||||
import android.content.Context
|
||||
import androidx.recyclerview.widget.RecyclerView.ItemDecoration
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import android.content.res.TypedArray
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
|
||||
/**
|
||||
* 分割线类
|
||||
*/
|
||||
class Decoration(private val mContext: Context, orientation: Int) : ItemDecoration() {
|
||||
private val mDivider: Drawable?
|
||||
private var mOrientation = 0
|
||||
|
||||
//设置屏幕的方向
|
||||
fun setOrientation(orientation: Int) {
|
||||
require(!(orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST)) { "invalid orientation" }
|
||||
mOrientation = orientation
|
||||
}
|
||||
|
||||
override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
|
||||
if (mOrientation == HORIZONTAL_LIST) {
|
||||
drawVerticalLine(c, parent, state)
|
||||
} else {
|
||||
drawHorizontalLine(c, parent, state)
|
||||
}
|
||||
}
|
||||
|
||||
//画横线, 这里的parent其实是显示在屏幕显示的这部分
|
||||
fun drawHorizontalLine(c: Canvas?, parent: RecyclerView, state: RecyclerView.State?) {
|
||||
val left = parent.paddingLeft
|
||||
val right = parent.width - parent.paddingRight
|
||||
val childCount = parent.childCount
|
||||
for (i in 0 until childCount) {
|
||||
val child = parent.getChildAt(i)
|
||||
|
||||
//获得child的布局信息
|
||||
val params = child.layoutParams as RecyclerView.LayoutParams
|
||||
val top = child.bottom + params.bottomMargin
|
||||
val bottom = top + mDivider!!.intrinsicHeight
|
||||
mDivider.setBounds(left, top, right, bottom)
|
||||
mDivider.draw(c!!)
|
||||
//Log.d("wnw", left + " " + top + " "+right+" "+bottom+" "+i);
|
||||
}
|
||||
}
|
||||
|
||||
//画竖线
|
||||
fun drawVerticalLine(c: Canvas?, parent: RecyclerView, state: RecyclerView.State?) {
|
||||
val top = parent.paddingTop
|
||||
val bottom = parent.height - parent.paddingBottom
|
||||
val childCount = parent.childCount
|
||||
for (i in 0 until childCount) {
|
||||
val child = parent.getChildAt(i)
|
||||
|
||||
//获得child的布局信息
|
||||
val params = child.layoutParams as RecyclerView.LayoutParams
|
||||
val left = child.right + params.rightMargin
|
||||
val right = left + mDivider!!.intrinsicWidth
|
||||
mDivider.setBounds(left, top, right, bottom)
|
||||
mDivider.draw(c!!)
|
||||
}
|
||||
}
|
||||
|
||||
//由于Divider也有长宽高,每一个Item需要向下或者向右偏移
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
if (mOrientation == HORIZONTAL_LIST) {
|
||||
//画横线,就是往下偏移一个分割线的高度
|
||||
outRect[0, 0, 0] = mDivider!!.intrinsicHeight
|
||||
} else {
|
||||
//画竖线,就是往右偏移一个分割线的宽度
|
||||
outRect[0, 0, mDivider!!.intrinsicWidth] = 0
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL
|
||||
const val VERTICAL_LIST = LinearLayoutManager.VERTICAL
|
||||
|
||||
//我们通过获取系统属性中的listDivider来添加,在系统中的AppTheme中设置
|
||||
val ATRRS = intArrayOf(
|
||||
R.attr.listDivider
|
||||
)
|
||||
}
|
||||
|
||||
init {
|
||||
val ta = mContext.obtainStyledAttributes(ATRRS)
|
||||
mDivider = ta.getDrawable(0)
|
||||
ta.recycle()
|
||||
setOrientation(orientation)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.coldmint.rust.pro.tool
|
||||
|
||||
import android.content.Context
|
||||
import com.coldmint.rust.pro.base.BaseAppendAutoCompleteHelper
|
||||
|
||||
/**
|
||||
* 链接自动完成帮助
|
||||
* 处理 @ at字符
|
||||
*/
|
||||
class LinkAutoCompleteHelper(context: Context) : BaseAppendAutoCompleteHelper(context) {
|
||||
override fun getDataList(): List<String> {
|
||||
return listOf("@mod{}","@user{}","@tag{}","@link{}","@qqGroup{}","@activate{}")
|
||||
}
|
||||
|
||||
override fun getSymbol(): Char {
|
||||
return '@'
|
||||
}
|
||||
|
||||
}
|
|
@ -2,20 +2,29 @@ package com.coldmint.rust.pro.tool
|
|||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Bundle
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableString
|
||||
import android.text.Spanned
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.text.style.ClickableSpan
|
||||
import android.text.style.ImageSpan
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.target.CustomTarget
|
||||
import com.bumptech.glide.request.transition.Transition
|
||||
import com.coldmint.rust.core.tool.AppOperator
|
||||
import com.coldmint.rust.core.tool.LineParser
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.pro.*
|
||||
import com.google.android.material.chip.ChipDrawable
|
||||
|
||||
|
||||
/**
|
||||
* 字体样式制作器
|
||||
*/
|
||||
class TextStyleMaker private constructor() {
|
||||
companion object {
|
||||
val instance: TextStyleMaker by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
|
@ -23,32 +32,121 @@ class TextStyleMaker private constructor() {
|
|||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 生成可点击的字体
|
||||
// * @param text String
|
||||
// * @param funOnClick Function1<String, Unit>
|
||||
// * @return SpannableString
|
||||
// */
|
||||
// private fun generate(text: String, funOnClick: (String, String) -> Unit): SpannableString {
|
||||
// val spannableString = SpannableString(text)
|
||||
// val start = "@"
|
||||
// val start2 = "{"
|
||||
// val start3 = "}"
|
||||
// var startIndex = text.indexOf(start)
|
||||
// while (startIndex > -1) {
|
||||
// val start2Index = text.indexOf(start2, startIndex)
|
||||
// if (start2Index > -1) {
|
||||
// val start3Index = text.indexOf(start3, start2Index + start2.length)
|
||||
// if (start3Index > -1) {
|
||||
// val num1 = startIndex
|
||||
// val num2 = start2Index
|
||||
// val num3 = start3Index
|
||||
// spannableString.setSpan(
|
||||
// object : ClickableSpan() {
|
||||
// override fun onClick(p0: View) {
|
||||
// funOnClick.invoke(
|
||||
// text.subSequence(num1 + start.length, num2).toString(),
|
||||
// text.subSequence(num2 + start2.length, num3).toString()
|
||||
// )
|
||||
// }
|
||||
// },
|
||||
// startIndex,
|
||||
// start3Index + start3.length,
|
||||
// Spannable.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
// )
|
||||
// } else {
|
||||
// break
|
||||
// }
|
||||
// } else {
|
||||
// break
|
||||
// }
|
||||
// startIndex = text.indexOf(start, startIndex + start.length)
|
||||
// }
|
||||
// return spannableString
|
||||
// }
|
||||
|
||||
/**
|
||||
* 生成可点击的字体
|
||||
* @param text String
|
||||
* @param funOnClick Function1<String, Unit>
|
||||
* @return SpannableString
|
||||
* 对文本设置样式,可用于编辑框
|
||||
* @param editable Editable
|
||||
* @param funOnClick Function2<String, String, Unit>
|
||||
*/
|
||||
private fun generate(text: String, funOnClick: (String, String) -> Unit): SpannableString {
|
||||
val spannableString = SpannableString(text)
|
||||
fun setStyle(
|
||||
spannable: Spannable,
|
||||
funOnClick: (String, String) -> Unit,
|
||||
context: Context
|
||||
) {
|
||||
val start = "@"
|
||||
val start2 = "{"
|
||||
val start3 = "}"
|
||||
var startIndex = text.indexOf(start)
|
||||
var startIndex = spannable.indexOf(start)
|
||||
while (startIndex > -1) {
|
||||
val start2Index = text.indexOf(start2, startIndex)
|
||||
val start2Index = spannable.indexOf(start2, startIndex)
|
||||
if (start2Index > -1) {
|
||||
val start3Index = text.indexOf(start3, start2Index + start2.length)
|
||||
val start3Index = spannable.indexOf(start3, start2Index + start2.length)
|
||||
if (start3Index > -1) {
|
||||
val num1 = startIndex
|
||||
val num2 = start2Index
|
||||
val num3 = start3Index
|
||||
spannableString.setSpan(
|
||||
val type = spannable.subSequence(num1 + start.length, num2).toString()
|
||||
val data: String = spannable.subSequence(num2 + start2.length, num3).toString()
|
||||
val chipDrawable = ChipDrawable.createFromResource(context, R.xml.chip)
|
||||
when (type) {
|
||||
"mod" -> {
|
||||
chipDrawable.chipIcon = context.getDrawable(R.drawable.mod)
|
||||
}
|
||||
"user" -> {
|
||||
Glide.with(context)
|
||||
.load(ServerConfiguration.website + "user/" + data + "/icon.png")
|
||||
.into(
|
||||
object : CustomTarget<Drawable>() {
|
||||
override fun onResourceReady(
|
||||
resource: Drawable,
|
||||
transition: Transition<in Drawable>?
|
||||
) {
|
||||
chipDrawable.chipIcon = resource
|
||||
}
|
||||
|
||||
override fun onLoadCleared(placeholder: Drawable?) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
else -> {
|
||||
R.drawable.image
|
||||
}
|
||||
}
|
||||
chipDrawable.closeIcon = null
|
||||
chipDrawable.text = data
|
||||
chipDrawable.setBounds(
|
||||
0,
|
||||
0,
|
||||
chipDrawable.intrinsicWidth,
|
||||
chipDrawable.intrinsicHeight
|
||||
)
|
||||
val span = ImageSpan(chipDrawable)
|
||||
spannable.setSpan(
|
||||
span, startIndex,
|
||||
start3Index + start3.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
spannable.setSpan(
|
||||
object : ClickableSpan() {
|
||||
override fun onClick(p0: View) {
|
||||
funOnClick.invoke(
|
||||
text.subSequence(num1 + start.length, num2).toString(),
|
||||
text.subSequence(num2 + start2.length, num3).toString()
|
||||
type,
|
||||
data
|
||||
)
|
||||
}
|
||||
},
|
||||
|
@ -62,20 +160,20 @@ class TextStyleMaker private constructor() {
|
|||
} else {
|
||||
break
|
||||
}
|
||||
startIndex = text.indexOf(start, startIndex + start.length)
|
||||
startIndex = spannable.indexOf(start, startIndex + start.length)
|
||||
}
|
||||
return spannableString
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载
|
||||
* 加载文本框文本样式,会重新生成对象。
|
||||
* @param textView TextView
|
||||
* @param funOnClick Function1<String, Unit>
|
||||
*/
|
||||
fun load(textView: TextView, data: String? = null, funOnClick: (String, String) -> Unit) {
|
||||
val text = data ?: textView.text.toString()
|
||||
val sp = generate(text, funOnClick)
|
||||
textView.text = sp
|
||||
val text = data ?: textView.text
|
||||
val spannableString = SpannableString(text)
|
||||
setStyle(spannableString, funOnClick, textView.context)
|
||||
textView.text = spannableString
|
||||
textView.movementMethod = LinkMovementMethod()
|
||||
}
|
||||
|
||||
|
@ -153,10 +251,9 @@ class TextStyleMaker private constructor() {
|
|||
context.startActivity(thisIntent)
|
||||
}
|
||||
"link" -> {
|
||||
val thisIntent = Intent(context,BrowserActivity::class.java)
|
||||
thisIntent.putExtra("link",data)
|
||||
val thisIntent = Intent(context, BrowserActivity::class.java)
|
||||
thisIntent.putExtra("link", data)
|
||||
context.startActivity(thisIntent)
|
||||
// AppOperator.useBrowserAccessWebPage(context, data)
|
||||
}
|
||||
"qqGroup" -> {
|
||||
try {
|
||||
|
|
|
@ -176,6 +176,78 @@ class StartViewModel(application: Application) : BaseAndroidViewModel(applicatio
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化设置
|
||||
*/
|
||||
private fun initSetting() {
|
||||
appSettings.initSetting(AppSettings.Setting.AppLanguage, Locale.getDefault().language)
|
||||
appSettings.initSetting(AppSettings.Setting.DeveloperMode, false)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.DatabaseDirectory,
|
||||
context.filesDir.absolutePath + "/database/"
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.TemplateDirectory,
|
||||
context.filesDir.absolutePath + "/template/"
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.CustomSymbol, "[],:='*_$%@#{}()")
|
||||
appSettings.initSetting(AppSettings.Setting.AutoCreateNomedia, true)
|
||||
appSettings.initSetting(AppSettings.Setting.OnlyLoadConantLanguageTemple, true)
|
||||
appSettings.initSetting(AppSettings.Setting.NightMode, isNightMode())
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.GamePackage,
|
||||
GlobalMethod.DEFAULT_GAME_PACKAGE
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.KeepRwmodFile, true)
|
||||
appSettings.initSetting(AppSettings.Setting.RecoveryStationFileSaveDays, 7)
|
||||
appSettings.initSetting(AppSettings.Setting.EnableRecoveryStation, true)
|
||||
appSettings.initSetting(AppSettings.Setting.UseMobileNetwork, false)
|
||||
appSettings.initSetting(AppSettings.Setting.ExperiencePlan, true)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.RecoveryStationFolder,
|
||||
context.filesDir.absolutePath + "/backup/"
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.PackDirectory,
|
||||
AppSettings.dataRootDirectory + "/bin/"
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.IndependentFolder, true)
|
||||
appSettings.initSetting(AppSettings.Setting.IdentifiersPromptNumber, 40)
|
||||
appSettings.initSetting(AppSettings.Setting.UseJetBrainsMonoFont, true)
|
||||
appSettings.initSetting(AppSettings.Setting.AppID, UUID.randomUUID().toString())
|
||||
appSettings.initSetting(AppSettings.Setting.CheckBetaUpdate, false)
|
||||
appSettings.initSetting(AppSettings.Setting.SetGameStorage, false)
|
||||
appSettings.initSetting(AppSettings.Setting.ShareTip, true)
|
||||
appSettings.initSetting(AppSettings.Setting.EnglishEditingMode, false)
|
||||
appSettings.initSetting(AppSettings.Setting.NightModeFollowSystem, true)
|
||||
appSettings.initSetting(AppSettings.Setting.UseTheCommunityAsTheLaunchPage, true)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.ServerAddress,
|
||||
ServerConfiguration.defaultIp
|
||||
)
|
||||
ServerConfiguration.website =
|
||||
appSettings.getValue(
|
||||
AppSettings.Setting.ServerAddress,
|
||||
ServerConfiguration.defaultIp
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.MapFolder,
|
||||
Environment.getExternalStorageDirectory().absolutePath + "/rustedWarfare/maps/"
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.ModFolder,
|
||||
Environment.getExternalStorageDirectory().absolutePath + "/rustedWarfare/units/"
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.AutoSave, true)
|
||||
appSettings.initSetting(AppSettings.Setting.AgreePolicy, false)
|
||||
appSettings.initSetting(AppSettings.Setting.LoginStatus, false)
|
||||
//如果启用动态颜色
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.DynamicColor,
|
||||
DynamicColors.isDynamicColorAvailable()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化资源
|
||||
*/
|
||||
|
@ -337,76 +409,6 @@ class StartViewModel(application: Application) : BaseAndroidViewModel(applicatio
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化设置
|
||||
*/
|
||||
private fun initSetting() {
|
||||
appSettings.initSetting(AppSettings.Setting.AppLanguage, Locale.getDefault().language)
|
||||
appSettings.initSetting(AppSettings.Setting.DeveloperMode, false)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.DatabaseDirectory,
|
||||
context.filesDir.absolutePath + "/database/"
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.TemplateDirectory,
|
||||
context.filesDir.absolutePath + "/template/"
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.CustomSymbol, "[],:='*_$%@#{}()")
|
||||
appSettings.initSetting(AppSettings.Setting.AutoCreateNomedia, true)
|
||||
appSettings.initSetting(AppSettings.Setting.OnlyLoadConantLanguageTemple, true)
|
||||
appSettings.initSetting(AppSettings.Setting.NightMode, isNightMode())
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.GamePackage,
|
||||
GlobalMethod.DEFAULT_GAME_PACKAGE
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.KeepRwmodFile, true)
|
||||
appSettings.initSetting(AppSettings.Setting.RecoveryStationFileSaveDays, 7)
|
||||
appSettings.initSetting(AppSettings.Setting.EnableRecoveryStation, true)
|
||||
appSettings.initSetting(AppSettings.Setting.UseMobileNetwork, false)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.RecoveryStationFolder,
|
||||
context.filesDir.absolutePath + "/backup/"
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.PackDirectory,
|
||||
AppSettings.dataRootDirectory + "/bin/"
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.IndependentFolder, true)
|
||||
appSettings.initSetting(AppSettings.Setting.IdentifiersPromptNumber, 40)
|
||||
appSettings.initSetting(AppSettings.Setting.UseJetBrainsMonoFont, true)
|
||||
appSettings.initSetting(AppSettings.Setting.AppID, UUID.randomUUID().toString())
|
||||
appSettings.initSetting(AppSettings.Setting.CheckBetaUpdate, false)
|
||||
appSettings.initSetting(AppSettings.Setting.SetGameStorage, false)
|
||||
appSettings.initSetting(AppSettings.Setting.ShareTip, true)
|
||||
appSettings.initSetting(AppSettings.Setting.EnglishEditingMode, false)
|
||||
appSettings.initSetting(AppSettings.Setting.NightModeFollowSystem, true)
|
||||
appSettings.initSetting(AppSettings.Setting.UseTheCommunityAsTheLaunchPage, true)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.ServerAddress,
|
||||
ServerConfiguration.defaultIp
|
||||
)
|
||||
ServerConfiguration.website =
|
||||
appSettings.getValue(
|
||||
AppSettings.Setting.ServerAddress,
|
||||
ServerConfiguration.defaultIp
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.MapFolder,
|
||||
Environment.getExternalStorageDirectory().absolutePath + "/rustedWarfare/maps/"
|
||||
)
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.ModFolder,
|
||||
Environment.getExternalStorageDirectory().absolutePath + "/rustedWarfare/units/"
|
||||
)
|
||||
appSettings.initSetting(AppSettings.Setting.AutoSave, true)
|
||||
appSettings.initSetting(AppSettings.Setting.AgreePolicy, false)
|
||||
appSettings.initSetting(AppSettings.Setting.LoginStatus, false)
|
||||
//如果启用动态颜色
|
||||
appSettings.initSetting(
|
||||
AppSettings.Setting.DynamicColor,
|
||||
DynamicColors.isDynamicColorAvailable()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载夜间设置
|
||||
|
|
|
@ -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="M20,12l-1.41,-1.41L13,16.17V4h-2v12.17l-5.58,-5.59L4,12l8,8 8,-8z"/>
|
||||
</vector>
|
|
@ -29,39 +29,76 @@
|
|||
android:layout_marginRight="8dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Elevated"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:animateLayoutChanges="true"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Elevated"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="vertical">
|
||||
android:layout_margin="8dp">
|
||||
|
||||
<SearchView
|
||||
android:id="@+id/searchView"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:iconifiedByDefault="false"
|
||||
android:queryBackground="@null"
|
||||
android:queryHint="@string/search" />
|
||||
android:layout_margin="8dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
<SearchView
|
||||
android:id="@+id/searchView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:iconifiedByDefault="false"
|
||||
android:queryBackground="@null"
|
||||
android:queryHint="@string/search" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Elevated"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="gone" />
|
||||
android:layout_margin="16dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.HeadlineMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/hotSearch" />
|
||||
|
||||
</LinearLayout>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/hotSearchView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:contentScrim="?android:windowBackground"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
|
||||
app:titleCollapseMode="scale"
|
||||
app:titleEnabled="false">
|
||||
|
@ -54,14 +54,13 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/nameView"
|
||||
style="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/headIconView"
|
||||
android:layout_alignLeft="@id/headIconView"
|
||||
android:layout_alignStart="@id/headIconView"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/name"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
android:text="@string/name" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardView"
|
||||
|
@ -97,38 +96,39 @@
|
|||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_alignBottom="@id/cardView"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/cardView"
|
||||
android:src="@drawable/boy" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/describeView"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/nameView"
|
||||
android:layout_alignLeft="@id/headIconView"
|
||||
android:layout_alignStart="@id/headIconView"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/describe" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/loginTimeView"
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/describeView"
|
||||
android:layout_alignLeft="@id/headIconView"
|
||||
android:layout_alignStart="@id/headIconView"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/user_info"
|
||||
android:textSize="13sp" />
|
||||
android:text="@string/user_info" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@id/baseInfoView"
|
||||
android:layout_alignBottom="@id/headIconView"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_toRightOf="@id/headIconView"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_toEndOf="@id/headIconView"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -146,18 +146,18 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/fansNumView"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="0"
|
||||
android:textSize="16sp" />
|
||||
android:text="0" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/fans"
|
||||
android:textSize="13sp" />
|
||||
android:text="@string/fans" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -170,18 +170,18 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/followNumView"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="0"
|
||||
android:textSize="16sp" />
|
||||
android:text="0" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/follow"
|
||||
android:textSize="13sp" />
|
||||
android:text="@string/follow" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -193,18 +193,18 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/praiseNumView"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="0"
|
||||
android:textSize="16sp" />
|
||||
android:text="0" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/praise_number"
|
||||
android:textSize="13sp" />
|
||||
android:text="@string/praise_number" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -217,8 +217,7 @@
|
|||
android:layout_below="@id/numberLayout"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom"
|
||||
android:text="@string/request_data"
|
||||
android:theme="@style/Theme.rust.Concept" />
|
||||
android:text="@string/request_data" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:fillViewport="true"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
|
@ -55,7 +52,8 @@
|
|||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp" />
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -65,36 +63,32 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="60dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/auditLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/audit"
|
||||
android:textColor="@color/red"
|
||||
android:textSize="16sp" />
|
||||
android:text="@string/audit" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardView"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/auditLayout"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="visible"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/openUserSpace"
|
||||
|
@ -121,164 +115,179 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/userNameView"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/name"
|
||||
android:textSize="16sp" />
|
||||
android:text="@string/name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userInfoView"
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/fans_information"
|
||||
android:textSize="13sp" />
|
||||
android:text="@string/fans_information" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/spaceView"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_margin="8dp"
|
||||
android:src="@drawable/next" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cardView2"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/cardView"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="visible"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp">
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iconView"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/image" />
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignTop="@id/iconView"
|
||||
android:layout_alignBottom="@id/iconView"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_toRightOf="@id/iconView"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="标题"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
<ImageView
|
||||
android:id="@+id/iconView"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/image" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="单位数" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/updateTimeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="上次更新时间" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/iconView"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
style="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="标题" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/numView"
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="单位数" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/updateTimeView"
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="上次更新时间" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.kongzue.stacklabelview.StackLabel
|
||||
android:id="@+id/belongStackLabelView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/iconView"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<com.youth.banner.Banner
|
||||
android:id="@+id/banner"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_below="@id/belongStackLabelView"
|
||||
android:layout_marginTop="8dp" />
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.youth.banner.Banner
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="180dp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/modInfoView"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/banner"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="描述" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/cardView2"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="visible"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/discussion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/discussion"
|
||||
android:textSize="16sp" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sendDiscussion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/discussion"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="@string/send_discussion"
|
||||
android:textColor="?android:attr/colorPrimary" />
|
||||
<TextView
|
||||
android:id="@+id/discussion"
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/discussion" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/sendDiscussion"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/send_discussion" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/commentLinearProgressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/discussion"
|
||||
android:layout_marginTop="8dp"
|
||||
android:indeterminate="true" />
|
||||
|
||||
|
@ -286,25 +295,26 @@
|
|||
android:id="@+id/modCommentRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/commentLinearProgressIndicator"
|
||||
android:layout_marginTop="8dp" />
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<Button
|
||||
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
|
||||
android:id="@+id/button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:text="@string/installation"
|
||||
android:visibility="gone" />
|
||||
android:visibility="visible"
|
||||
app:icon="@drawable/cloud_download" />
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
76
app/src/main/res/layout/dialog_comment.xml
Normal file
76
app/src/main/res/layout/dialog_comment.xml
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="24dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/send_discussion" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/messageView"-->
|
||||
<!-- style="@style/MaterialAlertDialog.Material3.Body.Text"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="16dp"-->
|
||||
<!-- android:text="@string/title"-->
|
||||
<!-- android:visibility="gone" />-->
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInputLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:hint="@string/content"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="255">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/textInputEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top"
|
||||
android:maxLength="255"
|
||||
android:minLines="3" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/buttonContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/negativeButton"
|
||||
style="@style/Widget.Material3.Button.TextButton.Dialog.Flush"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/positiveButton"
|
||||
android:text="@string/dialog_cancel" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/positiveButton"
|
||||
style="@style/Widget.Material3.Button.TextButton.Dialog.Flush"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/dialog_ok" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -5,9 +5,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingRight="12dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -15,84 +12,100 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/highestScoreView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/highest_score"
|
||||
android:textSize="16sp" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/highestScoreActionView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/highestScoreView"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/load_all"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:id="@+id/highestScoreView"
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/highest_score" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/highestScoreActionView"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/load_all" />
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/highestScoreRecycleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/highestScoreView"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/latestWorkView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/latest_work"
|
||||
android:textSize="16sp" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/latestWorkActionView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@id/latestWorkView"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/load_all"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:id="@+id/latestWorkView"
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/latest_work" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/latestWorkActionView"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:text="@string/load_all" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/latestWorkRecycleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/latestWorkView"
|
||||
android:layout_marginTop="8dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
14
app/src/main/res/layout/item_hot_search.xml
Normal file
14
app/src/main/res/layout/item_hot_search.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_margin="16dp"
|
||||
android:id="@+id/titleView"
|
||||
style="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:text="@string/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,13 +1,14 @@
|
|||
<?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">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:id="@+id/titleView"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
style="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:animateLayoutChanges="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
android:paddingHorizontal="8dp">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
|
@ -32,24 +32,28 @@
|
|||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:padding="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.youth.banner.Banner
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<com.youth.banner.Banner
|
||||
android:id="@+id/banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -62,17 +66,20 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="@string/random_recommended"
|
||||
android:textSize="16sp" />
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/random_recommended" />
|
||||
|
||||
<TextView
|
||||
<Button
|
||||
android:id="@+id/changeRandomRecommended"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@string/change_random_recommended" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -92,18 +99,15 @@
|
|||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/latestReleaseCard"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -112,10 +116,10 @@
|
|||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/latest_release"
|
||||
android:textSize="16sp" />
|
||||
android:text="@string/latest_release" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/latestReleaseProgressIndicator"
|
||||
|
@ -135,13 +139,10 @@
|
|||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/soleRecommendedCardView"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:cardElevation="2dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
android:layout_marginTop="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -150,10 +151,10 @@
|
|||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.HeadlineSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pay_attention_new"
|
||||
android:textSize="16sp" />
|
||||
android:text="@string/pay_attention_new" />
|
||||
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
android:id="@+id/soleRecommendedProgressIndicator"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nameView"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,46 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mod_icon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:src="@drawable/image" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mod_icon"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:src="@drawable/image" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mod_name_View"
|
||||
style="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="模组名称"
|
||||
android:textSize="16sp" />
|
||||
android:text="模组名称" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/mod_introduction_view"
|
||||
style="@style/TextAppearance.Material3.TitleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="介绍"
|
||||
android:textSize="14sp" />
|
||||
android:text="介绍" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/modInfo"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/web_mod_info"
|
||||
android:textSize="14dp" />
|
||||
android:text="@string/web_mod_info" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
|
||||
<group>
|
||||
|
||||
<item
|
||||
android:id="@+id/help"
|
||||
android:icon="@drawable/help"
|
||||
android:title="@string/help" />
|
||||
|
||||
<item
|
||||
android:id="@+id/code_table"
|
||||
|
@ -58,15 +54,12 @@
|
|||
android:icon="@drawable/setup"
|
||||
android:title="@string/set_up" />
|
||||
|
||||
<item
|
||||
android:id="@+id/donation"
|
||||
android:icon="@drawable/donation"
|
||||
android:title="@string/donation" />
|
||||
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/feedback"-->
|
||||
<!-- android:icon="@drawable/feedback"-->
|
||||
<!-- android:title="@string/feedback" />-->
|
||||
<!-- android:id="@+id/donation"-->
|
||||
<!-- android:icon="@drawable/donation"-->
|
||||
<!-- android:title="@string/donation" />-->
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/about"
|
||||
|
|
|
@ -636,7 +636,6 @@
|
|||
<string name="activate">The activation</string>
|
||||
<string name="money">¥%1$.2f</string>
|
||||
<string name="discount_prompt">%1$s has saved %2$.2f</string>
|
||||
<string name="setting_night_mode_follow_system">NightModeFollowSystem</string>
|
||||
<string name="night_mode_follow_system">Follow the system to turn on the dark mode</string>
|
||||
<string name="night_mode_follow_system_tip">Follow the system to turn on or off the dark mode</string>
|
||||
<string name="downlod">download</string>
|
||||
|
@ -825,7 +824,7 @@
|
|||
<string name="select_the_image_in_the_album">Select the image in the album</string>
|
||||
<string name="turret_design">Turret design</string>
|
||||
<string name="experience_the_plan">User Experience Plan</string>
|
||||
<string name="experience_the_plan_describe">Send software crash message anonymously (temporarily unavailable).</string>
|
||||
<string name="experience_the_plan_describe">Send software crash message anonymously .</string>
|
||||
<string name="update_and_iteration">Version update and user experience planning</string>
|
||||
<string name="setting_experience_the_plan" translatable="false">experiencePlan</string>
|
||||
<string name="order_timeout" translatable="false">订单超时,无法支付。</string>
|
||||
|
|
|
@ -636,7 +636,6 @@
|
|||
<string name="activate">活性化</string>
|
||||
<string name="money">¥% 1ドル.2f</string>
|
||||
<string name="discount_prompt">%1$s省%2$.2f元</string>
|
||||
<string name="setting_night_mode_follow_system">ナイトモードフォローシステム</string>
|
||||
<string name="night_mode_follow_system">システム追従ダークモード</string>
|
||||
<string name="night_mode_follow_system_tip">ダークモードをオンまたはオフします</string>
|
||||
<string name="downlod">ダウンロード</string>
|
||||
|
@ -825,7 +824,7 @@
|
|||
<string name="select_the_image_in_the_album">アルバムで画像を選択する</string>
|
||||
<string name="turret_design">砲塔の設計</string>
|
||||
<string name="experience_the_plan">ユーザー体験プログラム</string>
|
||||
<string name="experience_the_plan_describe">匿名送信ソフト奔砕情報(利用不可)。</string>
|
||||
<string name="experience_the_plan_describe">匿名送信ソフト奔砕情報。</string>
|
||||
<string name="update_and_iteration">アップデートとユーザー体験プログラム</string>
|
||||
<string name="setting_experience_the_plan" translatable="false">experiencePlan</string>
|
||||
<string name="order_timeout" translatable="false">订单超时,无法支付。</string>
|
||||
|
|
11
app/src/main/res/values-night-v23/themes.xml
Normal file
11
app/src/main/res/values-night-v23/themes.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?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>
|
|
@ -1,14 +1,6 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--概念主题 -->
|
||||
<style name="Theme.rust.Concept" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<style name="Theme.rust.Concept" parent="Base.rust.Concept">
|
||||
</style>
|
||||
|
||||
|
||||
<!--概念活动栏样式-->
|
||||
<!-- <style name="ThemeOverlay.rust.Concept.ActionBar" parent="ThemeOverlay.Material3.ActionBar">-->
|
||||
<!-- <item name="colorPrimary">@color/dark_background</item>-->
|
||||
<!-- <item name="android:textColorPrimary">@color/white</item>-->
|
||||
<!-- </style>-->
|
||||
|
||||
</resources>
|
|
@ -636,7 +636,6 @@
|
|||
<string name="activate">активирова</string>
|
||||
<string name="money">1$.2f</string>
|
||||
<string name="discount_prompt">$1 % сэкономлено $2%2f</string>
|
||||
<string name="setting_night_mode_follow_system">Ночной РежимПодключениеСистема</string>
|
||||
<string name="night_mode_follow_system">Следуйте за системой в темном режиме</string>
|
||||
<string name="night_mode_follow_system_tip">Следуйте за системой включения или выключения темного режима</string>
|
||||
<string name="downlod">загрузк</string>
|
||||
|
@ -825,7 +824,7 @@
|
|||
<string name="select_the_image_in_the_album">Выберите фотографии в фотоальбоме</string>
|
||||
<string name="turret_design">Проектирование башни</string>
|
||||
<string name="experience_the_plan">Программа пользовательского опыта</string>
|
||||
<string name="experience_the_plan_describe">Анонимная отправка программного обеспечения для уничтожения информации (временно недоступной).</string>
|
||||
<string name="experience_the_plan_describe">Анонимная отправка программного обеспечения для уничтожения информации.</string>
|
||||
<string name="update_and_iteration">Обновление версии с программой пользовательского опыта</string>
|
||||
<string name="setting_experience_the_plan" translatable="false">experiencePlan</string>
|
||||
<string name="order_timeout" translatable="false">订单超时,无法支付。</string>
|
||||
|
|
|
@ -444,7 +444,7 @@
|
|||
<string name="view_the_report_object">查看(%1$s)</string>
|
||||
<string name="bookmark_already_exists">此书签已存在,请更换路径。</string>
|
||||
<string name="feedback">意见反馈</string>
|
||||
<string name="setting_use_jetBrains_mono_font">UseJetBrainsMonoFont</string>
|
||||
<string name="setting_use_jetBrains_mono_font" translatable="false">UseJetBrainsMonoFont</string>
|
||||
<string name="use_jetBrains_mono_font">使用JetBrains Mono字体</string>
|
||||
<string name="use_jetBrains_mono_font_describe">助手内置的字体,强烈推荐使用。</string>
|
||||
<string name="directory_does_not_exist">目录不存在。</string>
|
||||
|
@ -455,7 +455,7 @@
|
|||
<string name="please_login_first">请先登录。</string>
|
||||
<string name="network_error">网络错误。</string>
|
||||
<string name="check_update_failure">检查更新失败。</string>
|
||||
<string name="setting_check_beta_update">CheckBetaUpdate</string>
|
||||
<string name="setting_check_beta_update" translatable="false">CheckBetaUpdate</string>
|
||||
<string name="check_beta_update">检查Beta更新</string>
|
||||
<string name="check_beta_update_describe">仅在Release版本生效,Beta版本,采用强制更新。</string>
|
||||
<string name="loading_values">加载数值...</string>
|
||||
|
@ -531,7 +531,7 @@
|
|||
<string name="file_type_define">默认创建ini文件。</string>
|
||||
<string name="file_type_tip2">您可能想输入\"%1$s\"?</string>
|
||||
<string name="is_building">正在加载单位数据,请尝试加载完毕后使用此功能。</string>
|
||||
<string name="setting_english_editing_mode">EnglishEditingMode</string>
|
||||
<string name="setting_english_editing_mode" translatable="false">EnglishEditingMode</string>
|
||||
<string name="english_editing_mode_describe">使用英文编写您的模组,并带有中文提示,语法高亮。</string>
|
||||
<string name="english_editing_mode">原生开发模式</string>
|
||||
<string name="mt_installed">您是否使用英文作为您的开发语言?相比在\"MT管理器\"上工作,助手有英文代码提示功能,以及针对模组环境的智能提示。</string>
|
||||
|
@ -607,11 +607,6 @@
|
|||
<string name="mod_package">模组包</string>
|
||||
<string name="restart_to_take_effect">检查到您更换了图像,由于Glide缓存机制,助手需要重启才能展示新图像。很抱歉给您带来的不便。</string>
|
||||
<string name="extension">扩展</string>
|
||||
<string name="use_adm">Adm多线程下载</string>
|
||||
<string name="use_adm_tip">允许调用Adm下载器,进行多线程下载。</string>
|
||||
<string name="setting_use_adm">useAdm</string>
|
||||
<string name="no_adm_installed">请先安装Adm。</string>
|
||||
<string name="from_adm">Adm下载目录</string>
|
||||
<string name="word_wrap">自动换行</string>
|
||||
<string name="database_error">json结果集长度为0</string>
|
||||
<string name="mod_icon_transition">ModIconTransition</string>
|
||||
|
@ -636,7 +631,7 @@
|
|||
<string name="activate">激活</string>
|
||||
<string name="money">¥%1$.2f</string>
|
||||
<string name="discount_prompt">%1$s 已省%2$.2f元</string>
|
||||
<string name="setting_night_mode_follow_system">NightModeFollowSystem</string>
|
||||
<string name="setting_night_mode_follow_system" translatable="false">NightModeFollowSystem</string>
|
||||
<string name="night_mode_follow_system">跟随系统开启深色模式</string>
|
||||
<string name="night_mode_follow_system_tip">跟随系统开启或关闭深色模式</string>
|
||||
<string name="downlod">下载</string>
|
||||
|
@ -670,7 +665,7 @@
|
|||
<string name="edit_map">编辑地图</string>
|
||||
<string name="edit_map_tip">我们推荐使用NotTiled作为地图编辑工具。</string>
|
||||
<string name="downlod_nottiled">下载NotTiled</string>
|
||||
<string name="setting_use_the_community_as_the_launch_page">UseTheCommunityAsTheLaunchPage</string>
|
||||
<string name="setting_use_the_community_as_the_launch_page" translatable="false">UseTheCommunityAsTheLaunchPage</string>
|
||||
<string name="use_the_community_as_the_launch_page">使用社区作为启动页面</string>
|
||||
<string name="use_the_community_as_the_launch_page_tip">默认启用</string>
|
||||
<string name="renewal">续费</string>
|
||||
|
@ -723,7 +718,7 @@
|
|||
<string name="delete_source_file_check">删除源文件</string>
|
||||
<string name="init_all_units">初始化单位列表...</string>
|
||||
<string name="clear_cache">清理缓存</string>
|
||||
<string name="setting_clear_cache">ClearCache</string>
|
||||
<string name="setting_clear_cache" translatable="false">ClearCache</string>
|
||||
<string name="clear_cache_description">缓存在应用使用过程中产生,助手通过读取缓存加速。</string>
|
||||
<string name="cache">缓存与存储空间</string>
|
||||
<string name="history_cache">文件打开记录</string>
|
||||
|
@ -737,7 +732,7 @@
|
|||
<string name="search_unit_name">欲搜索单位名</string>
|
||||
<string name="auto_save_describe">当您切换到其他程序时,自动保存代码。</string>
|
||||
<string name="auto_save">自动保存</string>
|
||||
<string name="setting_auto_save">AutoSave</string>
|
||||
<string name="setting_auto_save" translatable="false">AutoSave</string>
|
||||
<string name="auto_save_toast">已自动保存。</string>
|
||||
<string name="is_code">是代码</string>
|
||||
<string name="search_tip">撤销搜索</string>
|
||||
|
@ -757,13 +752,13 @@
|
|||
<string name="synchronous_ok">同步成功。</string>
|
||||
<string name="synchronous_failure">同步失败。</string>
|
||||
<string name="synchronous_ing">正在同步...</string>
|
||||
<string name="setting_server_address">ServerAddress</string>
|
||||
<string name="setting_server_address" translatable="false">ServerAddress</string>
|
||||
<string name="server_address_configuration">服务器地址配置</string>
|
||||
<string name="associated_tip">来自%1$s的关联提示</string>
|
||||
<string name="login_tip">登录后,您可以:\n-上传,下载模组。\n-在社区内与朋友们畅聊。\n-使用中文编辑您的模组!\n-关注您喜爱的创作者</string>
|
||||
<string name="error_description">那时您正在做什么?</string>
|
||||
<string name="no_error">没有错误</string>
|
||||
<string name="setting_see_error_info">SeeErrorInfo</string>
|
||||
<string name="setting_see_error_info" translatable="false">SeeErrorInfo</string>
|
||||
<string name="see_error_info">崩溃日志</string>
|
||||
<string name="see_error_info_tip">查看此设备上的崩溃记录。</string>
|
||||
<string name="can_not_tip_value">抱歉,目前无法提示值。</string>
|
||||
|
@ -825,7 +820,7 @@
|
|||
<string name="select_the_image_in_the_album">在相册选择图像</string>
|
||||
<string name="turret_design">炮塔设计</string>
|
||||
<string name="experience_the_plan">用户体验计划</string>
|
||||
<string name="experience_the_plan_describe">匿名发送软件奔溃信息(暂不可用)。</string>
|
||||
<string name="experience_the_plan_describe">匿名发送软件奔溃信息。</string>
|
||||
<string name="update_and_iteration">版本更新与用户体验计划</string>
|
||||
<string name="setting_experience_the_plan" translatable="false">experiencePlan</string>
|
||||
<string name="order_timeout" translatable="false">订单超时,无法支付。</string>
|
||||
|
@ -853,5 +848,6 @@
|
|||
<string name="search_type_mod_versions">模组更新日志</string>
|
||||
<string name="search_type_purchase_plan">套餐</string>
|
||||
<string name="search_type_mod_all">全部</string>
|
||||
<string name="hotSearch">热门搜索</string>
|
||||
|
||||
</resources>
|
8
app/src/main/res/xml/chip.xml
Normal file
8
app/src/main/res/xml/chip.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<chip xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:text="@string/title"
|
||||
app:chipIcon="@drawable/image"
|
||||
style="@style/Widget.Material3.Chip.Input"/>
|
||||
|
||||
|
|
@ -216,8 +216,7 @@
|
|||
app:title="@string/check_beta_update" />
|
||||
|
||||
<SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:enabled="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/setting_experience_the_plan"
|
||||
app:summary="@string/experience_the_plan_describe"
|
||||
app:title="@string/experience_the_plan" />
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.coldmint.rust.core.dataBean
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class HotSearchData(
|
||||
@SerializedName("code")
|
||||
val code: Int,
|
||||
@SerializedName("data")
|
||||
val `data`: MutableList<Data>,
|
||||
@SerializedName("message")
|
||||
val message: String
|
||||
) {
|
||||
data class Data(
|
||||
@SerializedName("keyword")
|
||||
val keyword: String,
|
||||
@SerializedName("number")
|
||||
val number: String
|
||||
)
|
||||
}
|
|
@ -143,7 +143,6 @@ object FileOperator {
|
|||
intent.setDataAndType(uri, type)
|
||||
context.startActivity(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(context, e.toString(), Toast.LENGTH_SHORT).show()
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.coldmint.rust.core.web
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import com.coldmint.rust.core.dataBean.ApiResponse
|
||||
import com.coldmint.rust.core.dataBean.CouponListDataBean
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.google.gson.Gson
|
||||
import okhttp3.*
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
* 错误报告
|
||||
*/
|
||||
class ErrorReport {
|
||||
|
||||
companion object {
|
||||
val instance: ErrorReport by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
ErrorReport()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送错误报告
|
||||
* @param message String 消息
|
||||
* @param versionName 版本名
|
||||
* @param versionNumber 版本号
|
||||
* @param apiCallBack ApiCallBack<CouponListDataBean>
|
||||
*/
|
||||
fun send(
|
||||
message: String,
|
||||
versionName: String,
|
||||
versionNumber: Int,
|
||||
apiCallBack: ApiCallBack<ApiResponse>
|
||||
) {
|
||||
val okHttpClient = ServerConfiguration.initOkHttpClient()
|
||||
val requestBodyBuilder: FormBody.Builder =
|
||||
FormBody.Builder().add("message", message).add("versionName", versionName)
|
||||
.add("versionNumber", versionNumber.toString())
|
||||
val requestBody = requestBodyBuilder.build()
|
||||
val request =
|
||||
Request.Builder()
|
||||
.url(ServerConfiguration.website + "php/error.php?action=send")
|
||||
.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()
|
||||
Log.d("错误反馈数据",data)
|
||||
val finalApiResponse =
|
||||
gson.fromJson(data, ApiResponse::class.java)
|
||||
handler.post {
|
||||
apiCallBack.onResponse(finalApiResponse)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
handler.post {
|
||||
apiCallBack.onFailure(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.coldmint.rust.core.web
|
|||
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.coldmint.rust.core.dataBean.HotSearchData
|
||||
import com.coldmint.rust.core.dataBean.SearchSuggestionsData
|
||||
import com.coldmint.rust.core.dataBean.user.SearchResultDataBean
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
|
@ -100,5 +101,42 @@ class Search private constructor() {
|
|||
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取热门搜索
|
||||
* @param apiCallBack ApiCallBack<HotSearchData>
|
||||
*/
|
||||
fun hotSearch(apiCallBack: ApiCallBack<HotSearchData>) {
|
||||
val okHttpClient = ServerConfiguration.initOkHttpClient()
|
||||
val request =
|
||||
Request.Builder()
|
||||
.url(ServerConfiguration.website + "php/search.php?action=hotSearch")
|
||||
.get().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 finalHotSearchData =
|
||||
gson.fromJson(data, HotSearchData::class.java)
|
||||
handler.post {
|
||||
apiCallBack.onResponse(finalHotSearchData)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
handler.post {
|
||||
apiCallBack.onFailure(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
}
|
72
dialog/src/main/java/com/coldmint/dialog/BaseBottomDialog.kt
Normal file
72
dialog/src/main/java/com/coldmint/dialog/BaseBottomDialog.kt
Normal file
|
@ -0,0 +1,72 @@
|
|||
package com.coldmint.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
|
||||
|
||||
/**
|
||||
* 基础底部对话框
|
||||
* @param ViewBindingType : ViewBinding
|
||||
* @property viewBinding ViewBindingType
|
||||
*/
|
||||
abstract class BaseBottomDialog<ViewBindingType : ViewBinding>(val context: Context) :
|
||||
BottomDialog {
|
||||
|
||||
|
||||
protected val bottomSheetDialog: BottomSheetDialog by lazy {
|
||||
BottomSheetDialog(context)
|
||||
|
||||
}
|
||||
|
||||
protected val layoutInflater by lazy {
|
||||
LayoutInflater.from(context)
|
||||
}
|
||||
|
||||
protected val viewBinding by lazy {
|
||||
getViewBindingObject(layoutInflater)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取布局绑定对象
|
||||
* @param layoutInflater LayoutInflater
|
||||
* @return ViewBindingType
|
||||
*/
|
||||
abstract fun getViewBindingObject(layoutInflater: LayoutInflater): ViewBindingType
|
||||
|
||||
/**
|
||||
* 当显示对话框
|
||||
*/
|
||||
abstract fun onShowDialog(viewBinding:ViewBindingType)
|
||||
|
||||
@Deprecated("不建议这样设置,请继承BaseBottomDialog类")
|
||||
override fun setContentView(view: View): BottomDialog {
|
||||
bottomSheetDialog.setContentView(view)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun setCancelable(cancelable: Boolean): BottomDialog {
|
||||
bottomSheetDialog.setCancelable(cancelable)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
override fun dismiss() {
|
||||
bottomSheetDialog.dismiss()
|
||||
}
|
||||
|
||||
override fun show(): BottomDialog {
|
||||
setContentView(viewBinding.root)
|
||||
onShowDialog(viewBinding)
|
||||
bottomSheetDialog.show()
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
}
|
15
dialog/src/main/java/com/coldmint/dialog/BottomDialog.kt
Normal file
15
dialog/src/main/java/com/coldmint/dialog/BottomDialog.kt
Normal file
|
@ -0,0 +1,15 @@
|
|||
package com.coldmint.dialog
|
||||
|
||||
import android.view.View
|
||||
|
||||
interface BottomDialog {
|
||||
|
||||
fun setContentView(view:View): BottomDialog
|
||||
|
||||
fun setCancelable(cancelable:Boolean):BottomDialog
|
||||
|
||||
fun dismiss()
|
||||
|
||||
fun show():BottomDialog
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user