在主页加入铁锈核心api网页链接,修改作品管理页面,修改审核模组按钮看不见的问题,改善个人主页封面动画。
This commit is contained in:
parent
2222ba6fec
commit
17ad7d561c
|
@ -28,6 +28,9 @@ class BrowserActivity : BaseActivity<ActivityBrowserBinding>() {
|
||||||
}
|
}
|
||||||
setReturnButton()
|
setReturnButton()
|
||||||
viewBinding.webView.loadUrl(link)
|
viewBinding.webView.loadUrl(link)
|
||||||
|
//是否启用Js
|
||||||
|
val enableJs = intent.getBooleanExtra("javaScriptEnabled",false);
|
||||||
|
viewBinding.webView.settings.javaScriptEnabled = enableJs
|
||||||
viewBinding.webView.webViewClient = object : WebViewClient() {
|
viewBinding.webView.webViewClient = object : WebViewClient() {
|
||||||
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
|
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
|
||||||
viewBinding.linearProgressIndicator.isVisible = true
|
viewBinding.linearProgressIndicator.isVisible = true
|
||||||
|
|
|
@ -361,6 +361,14 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu.findItem(R.id.rust_api).setOnMenuItemClickListener {
|
||||||
|
val thisIntent = Intent(this, BrowserActivity::class.java)
|
||||||
|
thisIntent.putExtra("link", "https://rustedwarfareapicode.top/")
|
||||||
|
thisIntent.putExtra("javaScriptEnabled", true)
|
||||||
|
startActivity(thisIntent)
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
menu.findItem(R.id.about).setOnMenuItemClickListener {
|
menu.findItem(R.id.about).setOnMenuItemClickListener {
|
||||||
startActivity(Intent(this@MainActivity, AboutActivity::class.java))
|
startActivity(Intent(this@MainActivity, AboutActivity::class.java))
|
||||||
false
|
false
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.coldmint.rust.pro
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.graphics.BitmapFactory
|
import android.graphics.BitmapFactory
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
@ -88,6 +89,19 @@ class ReleaseModActivity : BaseActivity<ActivityReleaseModBinding>() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载默认图像
|
||||||
|
*/
|
||||||
|
fun loadDefaultImage() {
|
||||||
|
val drawable = getDrawable(R.drawable.image)
|
||||||
|
viewBinding.iconView.setImageDrawable(
|
||||||
|
GlobalMethod.tintDrawable(
|
||||||
|
drawable,
|
||||||
|
ColorStateList.valueOf(GlobalMethod.getColorPrimary(this))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun initData() {
|
private fun initData() {
|
||||||
lineParser.symbol = ","
|
lineParser.symbol = ","
|
||||||
|
@ -179,13 +193,16 @@ class ReleaseModActivity : BaseActivity<ActivityReleaseModBinding>() {
|
||||||
viewBinding.modIdEdit.setText(
|
viewBinding.modIdEdit.setText(
|
||||||
Pinyin.toPinyin(temModClass.modName, "_").lowercase(Locale.getDefault())
|
Pinyin.toPinyin(temModClass.modName, "_").lowercase(Locale.getDefault())
|
||||||
)
|
)
|
||||||
|
viewBinding.versionNameEdit.setText("1.0")
|
||||||
viewBinding.modNameEdit.setText(temModClass.modName)
|
viewBinding.modNameEdit.setText(temModClass.modName)
|
||||||
val description = temModClass.readValueFromInfoSection("description", "mod")
|
val description = temModClass.readValueFromInfoSection("description", "mod")
|
||||||
if (description != null) {
|
if (description != null) {
|
||||||
viewBinding.modDescribeEdit.setText(description)
|
viewBinding.modDescribeEdit.setText(description)
|
||||||
}
|
}
|
||||||
val finalLink = temModClass.readResourceFromInfo("thumbnail")?.absolutePath
|
val finalLink = temModClass.readResourceFromInfo("thumbnail")?.absolutePath
|
||||||
if (finalLink != null) {
|
if (finalLink == null) {
|
||||||
|
loadDefaultImage()
|
||||||
|
} else {
|
||||||
loadIcon(finalLink)
|
loadIcon(finalLink)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,6 +241,8 @@ class ReleaseModActivity : BaseActivity<ActivityReleaseModBinding>() {
|
||||||
val icon = t.data.icon
|
val icon = t.data.icon
|
||||||
if (icon != null && icon.isNotBlank()) {
|
if (icon != null && icon.isNotBlank()) {
|
||||||
loadIcon(ServerConfiguration.getRealLink(icon))
|
loadIcon(ServerConfiguration.getRealLink(icon))
|
||||||
|
} else {
|
||||||
|
loadDefaultImage()
|
||||||
}
|
}
|
||||||
|
|
||||||
val screenshots = t.data.screenshots
|
val screenshots = t.data.screenshots
|
||||||
|
@ -390,7 +409,7 @@ class ReleaseModActivity : BaseActivity<ActivityReleaseModBinding>() {
|
||||||
bundle.putString("tag", lineData)
|
bundle.putString("tag", lineData)
|
||||||
bundle.putString(
|
bundle.putString(
|
||||||
"title",
|
"title",
|
||||||
String.format(getString(R.string.tag_title), s)
|
String.format(getString(R.string.tag_title), lineData)
|
||||||
)
|
)
|
||||||
bundle.putString("action", "tag")
|
bundle.putString("action", "tag")
|
||||||
val thisIntent =
|
val thisIntent =
|
||||||
|
@ -490,7 +509,7 @@ class ReleaseModActivity : BaseActivity<ActivityReleaseModBinding>() {
|
||||||
if (link != null) {
|
if (link != null) {
|
||||||
needIcon = false
|
needIcon = false
|
||||||
}
|
}
|
||||||
viewBinding.iconView.setImageResource(R.drawable.image)
|
loadDefaultImage()
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ class SearchResultActivity : BaseActivity<ActivitySearchResultBinding>() {
|
||||||
map["mod_comments"] = R.string.search_type_mod_comments
|
map["mod_comments"] = R.string.search_type_mod_comments
|
||||||
map["mod_versions"] = R.string.search_type_mod_versions
|
map["mod_versions"] = R.string.search_type_mod_versions
|
||||||
map["purchase_plan"] = R.string.search_type_purchase_plan
|
map["purchase_plan"] = R.string.search_type_purchase_plan
|
||||||
|
map["template_package"] = R.string.search_type_template_package
|
||||||
map
|
map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ import android.app.ActivityOptions
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.graphics.Shader
|
||||||
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
|
@ -13,6 +15,7 @@ import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
import androidx.core.view.drawToBitmap
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.coldmint.dialog.CoreDialog
|
import com.coldmint.dialog.CoreDialog
|
||||||
|
@ -25,6 +28,7 @@ import com.coldmint.rust.pro.adapters.UserHomeStateAdapter
|
||||||
import com.coldmint.rust.pro.base.BaseActivity
|
import com.coldmint.rust.pro.base.BaseActivity
|
||||||
import com.coldmint.rust.pro.databinding.ActivityUserHomePageBinding
|
import com.coldmint.rust.pro.databinding.ActivityUserHomePageBinding
|
||||||
import com.coldmint.rust.pro.dialog.CommentDialog
|
import com.coldmint.rust.pro.dialog.CommentDialog
|
||||||
|
import com.coldmint.rust.pro.tool.AnimUtil
|
||||||
import com.coldmint.rust.pro.tool.AppSettings
|
import com.coldmint.rust.pro.tool.AppSettings
|
||||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||||
import com.google.android.material.appbar.AppBarLayout
|
import com.google.android.material.appbar.AppBarLayout
|
||||||
|
@ -45,7 +49,7 @@ class UserHomePageActivity : BaseActivity<ActivityUserHomePageBinding>() {
|
||||||
val userHomeStateAdapter by lazy {
|
val userHomeStateAdapter by lazy {
|
||||||
UserHomeStateAdapter(this, userId)
|
UserHomeStateAdapter(this, userId)
|
||||||
}
|
}
|
||||||
|
var needShowFab = false
|
||||||
|
|
||||||
//旧的备份数据
|
//旧的备份数据
|
||||||
var oldSpaceInfoData: SpaceInfoData? = null
|
var oldSpaceInfoData: SpaceInfoData? = null
|
||||||
|
@ -120,7 +124,7 @@ class UserHomePageActivity : BaseActivity<ActivityUserHomePageBinding>() {
|
||||||
if (account == null) {
|
if (account == null) {
|
||||||
viewBinding.button.text = getString(R.string.please_login_first)
|
viewBinding.button.text = getString(R.string.please_login_first)
|
||||||
viewBinding.button.isEnabled = false
|
viewBinding.button.isEnabled = false
|
||||||
}else{
|
} else {
|
||||||
if (account == userId) {
|
if (account == userId) {
|
||||||
viewBinding.button.text = getString(R.string.editData)
|
viewBinding.button.text = getString(R.string.editData)
|
||||||
} else {
|
} else {
|
||||||
|
@ -131,7 +135,8 @@ class UserHomePageActivity : BaseActivity<ActivityUserHomePageBinding>() {
|
||||||
if (data != null && ServerConfiguration.isEvent(data)) {
|
if (data != null && ServerConfiguration.isEvent(data)) {
|
||||||
when (data) {
|
when (data) {
|
||||||
"@event:已互粉" -> {
|
"@event:已互粉" -> {
|
||||||
viewBinding.button.text = getString(R.string.each_other_follow)
|
viewBinding.button.text =
|
||||||
|
getString(R.string.each_other_follow)
|
||||||
}
|
}
|
||||||
"@event:已关注" -> {
|
"@event:已关注" -> {
|
||||||
viewBinding.button.text = getString(R.string.followed)
|
viewBinding.button.text = getString(R.string.followed)
|
||||||
|
@ -237,20 +242,53 @@ class UserHomePageActivity : BaseActivity<ActivityUserHomePageBinding>() {
|
||||||
if (cover != null) {
|
if (cover != null) {
|
||||||
Glide.with(this).load(ServerConfiguration.getRealLink(cover))
|
Glide.with(this).load(ServerConfiguration.getRealLink(cover))
|
||||||
.into(viewBinding.coverView)
|
.into(viewBinding.coverView)
|
||||||
|
Glide.with(this).load(ServerConfiguration.getRealLink(cover))
|
||||||
|
.into(viewBinding.fullCoverView)
|
||||||
}
|
}
|
||||||
|
|
||||||
viewBinding.viewPager.adapter = userHomeStateAdapter
|
viewBinding.viewPager.adapter = userHomeStateAdapter
|
||||||
|
|
||||||
|
|
||||||
viewBinding.coverView.setOnClickListener {
|
viewBinding.coverView.setOnClickListener {
|
||||||
if (cover != null) {
|
if (cover == null) {
|
||||||
val intent = Intent(this@UserHomePageActivity, FullScreenCoverActivity::class.java)
|
return@setOnClickListener
|
||||||
val name = getString(R.string.transition_cover)
|
|
||||||
val options =
|
|
||||||
ActivityOptions.makeSceneTransitionAnimation(this, viewBinding.coverView, name)
|
|
||||||
intent.putExtra("iconLink", cover)
|
|
||||||
this@UserHomePageActivity.startActivity(intent, options.toBundle())
|
|
||||||
}
|
}
|
||||||
|
viewBinding.coverView.visibility = View.INVISIBLE
|
||||||
|
AnimUtil.doAnim(
|
||||||
|
this,
|
||||||
|
R.anim.overall_drop,
|
||||||
|
listOf(viewBinding.appBar, viewBinding.viewPager)
|
||||||
|
) { views ->
|
||||||
|
views.forEach {
|
||||||
|
it.isVisible = false
|
||||||
|
}
|
||||||
|
needShowFab = viewBinding.fab.isShown
|
||||||
|
if (needShowFab) {
|
||||||
|
viewBinding.fab.hide()
|
||||||
|
}
|
||||||
|
viewBinding.fullCoverView.isVisible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
viewBinding.fullCoverView.setOnClickListener {
|
||||||
|
if (cover == null) {
|
||||||
|
return@setOnClickListener
|
||||||
|
}
|
||||||
|
viewBinding.fullCoverView.isVisible = false
|
||||||
|
AnimUtil.doAnim(
|
||||||
|
this,
|
||||||
|
R.anim.overall_up,
|
||||||
|
listOf(viewBinding.appBar, viewBinding.viewPager)
|
||||||
|
) { views ->
|
||||||
|
views.forEach {
|
||||||
|
it.isVisible = true
|
||||||
|
}
|
||||||
|
if (needShowFab) {
|
||||||
|
viewBinding.fab.show()
|
||||||
|
}
|
||||||
|
viewBinding.coverView.isVisible = true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fans = spaceInfoData.data.fans
|
fans = spaceInfoData.data.fans
|
||||||
|
|
|
@ -11,6 +11,8 @@ import androidx.core.view.isVisible
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import com.afollestad.materialdialogs.MaterialDialog
|
import com.afollestad.materialdialogs.MaterialDialog
|
||||||
|
import com.coldmint.dialog.CoreDialog
|
||||||
|
import com.coldmint.dialog.databinding.DialogCoreBinding
|
||||||
import com.coldmint.rust.core.dataBean.ApiResponse
|
import com.coldmint.rust.core.dataBean.ApiResponse
|
||||||
import com.coldmint.rust.core.dataBean.mod.WebModAllInfoData
|
import com.coldmint.rust.core.dataBean.mod.WebModAllInfoData
|
||||||
import com.coldmint.rust.core.dataBean.mod.WebModListData
|
import com.coldmint.rust.core.dataBean.mod.WebModListData
|
||||||
|
@ -70,30 +72,27 @@ class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||||
val adapter =
|
val adapter =
|
||||||
WebModAllInfoAdapter(this@WorkManagementActivity, data)
|
WebModAllInfoAdapter(this@WorkManagementActivity, data)
|
||||||
adapter.setItemEvent { i, itemWebmodAllInfoBinding, viewHolder, data ->
|
adapter.setItemEvent { i, itemWebmodAllInfoBinding, viewHolder, data ->
|
||||||
|
|
||||||
itemWebmodAllInfoBinding.more.setOnClickListener {
|
itemWebmodAllInfoBinding.more.setOnClickListener {
|
||||||
val popupMenu = GlobalMethod.createPopMenu(it)
|
val popupMenu = GlobalMethod.createPopMenu(it)
|
||||||
when (data.hidden) {
|
when (data.hidden) {
|
||||||
0 -> {
|
0 -> {
|
||||||
|
//上架状态
|
||||||
popupMenu.menu.add(R.string.sold_out_mod)
|
popupMenu.menu.add(R.string.sold_out_mod)
|
||||||
}
|
|
||||||
1 -> {
|
|
||||||
//等待审核
|
|
||||||
itemWebmodAllInfoBinding.modIntroductionView.setText(
|
|
||||||
R.string.not_audit
|
|
||||||
)
|
|
||||||
}
|
|
||||||
-1 -> {
|
|
||||||
popupMenu.menu.add(R.string.review_audit)
|
|
||||||
}
|
|
||||||
-2 -> {
|
|
||||||
//被管理员举报下架
|
|
||||||
itemWebmodAllInfoBinding.modIntroductionView.setText(
|
|
||||||
R.string.banned_mod
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
popupMenu.menu.add(R.string.work_of_home_page)
|
popupMenu.menu.add(R.string.work_of_home_page)
|
||||||
popupMenu.menu.add(R.string.submit_the_update)
|
popupMenu.menu.add(R.string.submit_the_update)
|
||||||
|
}
|
||||||
|
|
||||||
|
-1 -> {
|
||||||
|
//用户手动隐藏
|
||||||
|
popupMenu.menu.add(R.string.review_audit)
|
||||||
|
popupMenu.menu.add(R.string.work_of_home_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
popupMenu.menu.add(R.string.update_record)
|
popupMenu.menu.add(R.string.update_record)
|
||||||
popupMenu.show()
|
popupMenu.show()
|
||||||
popupMenu.setOnMenuItemClickListener {
|
popupMenu.setOnMenuItemClickListener {
|
||||||
|
@ -128,10 +127,10 @@ class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||||
startActivity(intent)
|
startActivity(intent)
|
||||||
}
|
}
|
||||||
getString(R.string.sold_out_mod) -> {
|
getString(R.string.sold_out_mod) -> {
|
||||||
MaterialDialog(this@WorkManagementActivity).show {
|
CoreDialog(this@WorkManagementActivity).setTitle(
|
||||||
title(R.string.sold_out_mod).message(R.string.sold_out_mod_tip)
|
R.string.sold_out_mod
|
||||||
.positiveButton(R.string.dialog_ok)
|
).setMessage(R.string.sold_out_mod_tip)
|
||||||
.positiveButton {
|
.setPositiveButton(R.string.dialog_ok) {
|
||||||
WebMod.instance.soldOutMod(
|
WebMod.instance.soldOutMod(
|
||||||
data.developer,
|
data.developer,
|
||||||
data.id,
|
data.id,
|
||||||
|
@ -142,6 +141,7 @@ class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||||
) {
|
) {
|
||||||
if (t.code == ServerConfiguration.Success_Code) {
|
if (t.code == ServerConfiguration.Success_Code) {
|
||||||
data.hidden = -1
|
data.hidden = -1
|
||||||
|
adapter.notifyItemChanged(i)
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.recyclerView,
|
viewBinding.recyclerView,
|
||||||
|
@ -160,21 +160,20 @@ class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.negativeButton(R.string.dialog_cancel)
|
.setNegativeButton(R.string.dialog_cancel) {
|
||||||
.cancelable(false)
|
|
||||||
}
|
}
|
||||||
|
.setCancelable(false).show()
|
||||||
}
|
}
|
||||||
getString(R.string.review_audit) -> {
|
getString(R.string.review_audit) -> {
|
||||||
MaterialDialog(this@WorkManagementActivity).show {
|
CoreDialog(this@WorkManagementActivity).setTitle(
|
||||||
title(R.string.review_audit).message(
|
R.string.review_audit
|
||||||
text =
|
).setMessage(
|
||||||
String.format(
|
String.format(
|
||||||
getString(R.string.review_audit_mod_tip),
|
getString(R.string.review_audit_mod_tip),
|
||||||
data.name
|
data.name
|
||||||
)
|
)
|
||||||
)
|
).setPositiveButton(R.string.dialog_ok) {
|
||||||
.positiveButton(R.string.dialog_ok)
|
|
||||||
.positiveButton {
|
|
||||||
WebMod.instance.afreshAuditMod(
|
WebMod.instance.afreshAuditMod(
|
||||||
AppSettings
|
AppSettings
|
||||||
.getValue(
|
.getValue(
|
||||||
|
@ -189,6 +188,7 @@ class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||||
) {
|
) {
|
||||||
if (t.code == ServerConfiguration.Success_Code) {
|
if (t.code == ServerConfiguration.Success_Code) {
|
||||||
data.hidden = 1
|
data.hidden = 1
|
||||||
|
adapter.notifyItemChanged(i)
|
||||||
} else {
|
} else {
|
||||||
Snackbar.make(
|
Snackbar.make(
|
||||||
viewBinding.recyclerView,
|
viewBinding.recyclerView,
|
||||||
|
@ -206,10 +206,9 @@ class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}.setNegativeButton(R.string.dialog_cancel) {
|
||||||
.negativeButton(R.string.dialog_cancel)
|
|
||||||
.cancelable(false)
|
}.setCancelable(false).show()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
|
|
@ -54,7 +54,7 @@ class ReportAdapter(
|
||||||
viewBinding.timeView.text = data.time
|
viewBinding.timeView.text = data.time
|
||||||
viewBinding.nameView.text = data.userName
|
viewBinding.nameView.text = data.userName
|
||||||
viewBinding.openView.text =
|
viewBinding.openView.text =
|
||||||
String.format(context.getString(R.string.view_the_report_object), data.target)
|
context.getString(R.string.view_the_report_object)
|
||||||
when (data.type) {
|
when (data.type) {
|
||||||
"mod" -> {
|
"mod" -> {
|
||||||
viewBinding.typeView.setText(R.string.report_mod)
|
viewBinding.typeView.setText(R.string.report_mod)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import android.content.ServiceConnection
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.PopupMenu
|
import android.widget.PopupMenu
|
||||||
|
import androidx.core.view.isVisible
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.coldmint.rust.core.dataBean.ApiResponse
|
import com.coldmint.rust.core.dataBean.ApiResponse
|
||||||
import com.coldmint.rust.core.dataBean.mod.WebModAllInfoData
|
import com.coldmint.rust.core.dataBean.mod.WebModAllInfoData
|
||||||
|
@ -41,10 +42,35 @@ class WebModAllInfoAdapter(
|
||||||
position: Int
|
position: Int
|
||||||
) {
|
) {
|
||||||
viewBinding.modNameView.text = data.name
|
viewBinding.modNameView.text = data.name
|
||||||
viewBinding.modIntroductionView.text = data.describe
|
when (data.hidden) {
|
||||||
|
1 -> {
|
||||||
|
//等待审核
|
||||||
|
viewBinding.modIntroductionView.setText(
|
||||||
|
R.string.not_audit
|
||||||
|
)
|
||||||
|
viewBinding.more.isVisible = false
|
||||||
|
}
|
||||||
|
-2 -> {
|
||||||
|
//被管理员举报下架
|
||||||
|
viewBinding.modIntroductionView.setText(
|
||||||
|
R.string.banned_mod
|
||||||
|
)
|
||||||
|
viewBinding.more.isVisible = false
|
||||||
|
}
|
||||||
|
0 -> {
|
||||||
|
viewBinding.modIntroductionView.setText(R.string.public_mod)
|
||||||
|
viewBinding.more.isVisible = true
|
||||||
|
}
|
||||||
|
else->{
|
||||||
|
viewBinding.modIntroductionView.setText(R.string.private_mod)
|
||||||
|
viewBinding.more.isVisible = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val icon = data.icon
|
val icon = data.icon
|
||||||
if (icon != null && icon.isNotBlank()) {
|
if (icon != null && icon.isNotBlank()) {
|
||||||
Glide.with(context).load(ServerConfiguration.getRealLink(icon)).apply(GlobalMethod.getRequestOptions())
|
Glide.with(context).load(ServerConfiguration.getRealLink(icon))
|
||||||
|
.apply(GlobalMethod.getRequestOptions(grayscale = data.hidden == -2))
|
||||||
.into(viewBinding.modIcon)
|
.into(viewBinding.modIcon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
40
app/src/main/java/com/coldmint/rust/pro/tool/AnimUtil.kt
Normal file
40
app/src/main/java/com/coldmint/rust/pro/tool/AnimUtil.kt
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
package com.coldmint.rust.pro.tool
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.View
|
||||||
|
import android.view.animation.Animation
|
||||||
|
import android.view.animation.AnimationUtils
|
||||||
|
|
||||||
|
object AnimUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 播放动画资产文件
|
||||||
|
*/
|
||||||
|
fun doAnim(
|
||||||
|
context: Context,
|
||||||
|
animRes: Int,
|
||||||
|
views: List<View>,
|
||||||
|
func: (views: List<View>) -> Unit
|
||||||
|
) {
|
||||||
|
val animation = AnimationUtils.loadAnimation(context, animRes)
|
||||||
|
animation.setAnimationListener(object : Animation.AnimationListener {
|
||||||
|
override fun onAnimationStart(animation: Animation?) {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAnimationEnd(animation: Animation?) {
|
||||||
|
views.forEach {
|
||||||
|
it.clearAnimation()
|
||||||
|
}
|
||||||
|
func.invoke(views)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onAnimationRepeat(animation: Animation?) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
views.forEach {
|
||||||
|
it.startAnimation(animation)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -348,7 +348,6 @@ object GlobalMethod {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//打开指定app
|
|
||||||
//图像着色
|
//图像着色
|
||||||
fun tintDrawable(drawable: Drawable?, colors: ColorStateList?): Drawable {
|
fun tintDrawable(drawable: Drawable?, colors: ColorStateList?): Drawable {
|
||||||
val wrappedDrawable = DrawableCompat.wrap(drawable!!)
|
val wrappedDrawable = DrawableCompat.wrap(drawable!!)
|
||||||
|
|
7
app/src/main/res/anim/overall_drop.xml
Normal file
7
app/src/main/res/anim/overall_drop.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:duration="350">
|
||||||
|
<translate
|
||||||
|
android:fromYDelta="0%p"
|
||||||
|
android:toYDelta="100%p" />
|
||||||
|
</set>
|
7
app/src/main/res/anim/overall_up.xml
Normal file
7
app/src/main/res/anim/overall_up.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:duration="350">
|
||||||
|
<translate
|
||||||
|
android:fromYDelta="100%p"
|
||||||
|
android:toYDelta="0%p" />
|
||||||
|
</set>
|
5
app/src/main/res/drawable/outline_book_24.xml
Normal file
5
app/src/main/res/drawable/outline_book_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M18,2L6,2c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,4c0,-1.1 -0.9,-2 -2,-2zM9,4h2v5l-1,-0.75L9,9L9,4zM18,20L6,20L6,4h1v9l3,-2.25L13,13L13,4h5v16z"/>
|
||||||
|
</vector>
|
|
@ -221,13 +221,22 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/mod_icon" />
|
android:text="@string/mod_icon" />
|
||||||
|
|
||||||
|
<com.google.android.material.card.MaterialCardView
|
||||||
|
style="@style/Widget.Material3.CardView.Filled"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iconView"
|
android:id="@+id/iconView"
|
||||||
android:layout_width="80dp"
|
android:layout_width="72dp"
|
||||||
android:layout_height="80dp"
|
android:layout_height="72dp"
|
||||||
android:layout_margin="8dp"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/image" />
|
android:src="@drawable/image" />
|
||||||
|
|
||||||
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -325,7 +334,7 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="8dp"
|
android:layout_margin="16dp"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/fullCoverView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="matrix"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appBar"
|
android:id="@+id/appBar"
|
||||||
|
@ -135,7 +141,6 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/numberLayout"
|
android:id="@+id/numberLayout"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="46dp">
|
android:layout_height="46dp">
|
||||||
|
|
||||||
|
@ -266,4 +271,5 @@
|
||||||
android:src="@drawable/add"
|
android:src="@drawable/add"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -59,6 +59,10 @@
|
||||||
android:id="@+id/user_group"
|
android:id="@+id/user_group"
|
||||||
android:icon="@drawable/ic_outline_free_breakfast_24"
|
android:icon="@drawable/ic_outline_free_breakfast_24"
|
||||||
android:title="@string/user_group" />
|
android:title="@string/user_group" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/rust_api"
|
||||||
|
android:icon="@drawable/outline_book_24"
|
||||||
|
android:title="@string/rust_api" />
|
||||||
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
|
|
@ -439,7 +439,7 @@
|
||||||
<string name="user_name">The user name</string>
|
<string name="user_name">The user name</string>
|
||||||
<string name="report_mod">Report mod</string>
|
<string name="report_mod">Report mod</string>
|
||||||
<string name="report_user">To report the user</string>
|
<string name="report_user">To report the user</string>
|
||||||
<string name="view_the_report_object">Check (%1$s)</string>
|
<string name="view_the_report_object">Check</string>
|
||||||
<string name="bookmark_already_exists">The book label already exists. Please change the path.</string>
|
<string name="bookmark_already_exists">The book label already exists. Please change the path.</string>
|
||||||
<string name="feedback">feedback</string>
|
<string name="feedback">feedback</string>
|
||||||
<string name="please_set_main_image">Please set the main image.</string>
|
<string name="please_set_main_image">Please set the main image.</string>
|
||||||
|
@ -687,7 +687,6 @@
|
||||||
<string name="girl">female</string>
|
<string name="girl">female</string>
|
||||||
<string name="search_hint">Please enter your search content</string>
|
<string name="search_hint">Please enter your search content</string>
|
||||||
<string name="report_to_deal">To report to deal with</string>
|
<string name="report_to_deal">To report to deal with</string>
|
||||||
<string name="banned_mod">Because of the report, was removed by the administrator.</string>
|
|
||||||
<string name="unable_to_report">This mod is hidden and cannot be reported.</string>
|
<string name="unable_to_report">This mod is hidden and cannot be reported.</string>
|
||||||
<string name="unable_to_report2">You cannot report your own mods. If you want to remove a mod, please go to \"Work Management\".</string>
|
<string name="unable_to_report2">You cannot report your own mods. If you want to remove a mod, please go to \"Work Management\".</string>
|
||||||
<string name="admin">The administrator</string>
|
<string name="admin">The administrator</string>
|
||||||
|
|
|
@ -439,7 +439,7 @@
|
||||||
<string name="user_name">ユーザー名</string>
|
<string name="user_name">ユーザー名</string>
|
||||||
<string name="report_mod">通報モジュール</string>
|
<string name="report_mod">通報モジュール</string>
|
||||||
<string name="report_user">ユーザーを通報する</string>
|
<string name="report_user">ユーザーを通報する</string>
|
||||||
<string name="view_the_report_object">(%1$s)を見る</string>
|
<string name="view_the_report_object">を見る</string>
|
||||||
<string name="bookmark_already_exists">サインがありますので、パスを変更してください。</string>
|
<string name="bookmark_already_exists">サインがありますので、パスを変更してください。</string>
|
||||||
<string name="feedback">意見のフィードバック</string>
|
<string name="feedback">意見のフィードバック</string>
|
||||||
<string name="please_set_main_image">本体画像を設定してください。</string>
|
<string name="please_set_main_image">本体画像を設定してください。</string>
|
||||||
|
@ -687,7 +687,6 @@
|
||||||
<string name="girl">女</string>
|
<string name="girl">女</string>
|
||||||
<string name="search_hint">検索内容を入力してください</string>
|
<string name="search_hint">検索内容を入力してください</string>
|
||||||
<string name="report_to_deal">通報処理</string>
|
<string name="report_to_deal">通報処理</string>
|
||||||
<string name="banned_mod">通報され、管理人に撤去された。</string>
|
|
||||||
<string name="unable_to_report">このモジュールは隠れていて、通報することができません。</string>
|
<string name="unable_to_report">このモジュールは隠れていて、通報することができません。</string>
|
||||||
<string name="unable_to_report2">自分のモジュールを通報することはできません、もしモジュールを降ろすことを希望するならば\「作品管理\」に行ってください。</string>
|
<string name="unable_to_report2">自分のモジュールを通報することはできません、もしモジュールを降ろすことを希望するならば\「作品管理\」に行ってください。</string>
|
||||||
<string name="admin">管理人</string>
|
<string name="admin">管理人</string>
|
||||||
|
|
|
@ -438,7 +438,7 @@
|
||||||
<string name="user_name">Имя пользователя.</string>
|
<string name="user_name">Имя пользователя.</string>
|
||||||
<string name="report_mod">Группа доноров</string>
|
<string name="report_mod">Группа доноров</string>
|
||||||
<string name="report_user">Сообщать о потребителе</string>
|
<string name="report_user">Сообщать о потребителе</string>
|
||||||
<string name="view_the_report_object">Смотрите.</string>
|
<string name="view_the_report_object">Смотрите</string>
|
||||||
<string name="bookmark_already_exists">Подписание книги уже существует.</string>
|
<string name="bookmark_already_exists">Подписание книги уже существует.</string>
|
||||||
<string name="feedback">Обратная связь мнений</string>
|
<string name="feedback">Обратная связь мнений</string>
|
||||||
<string name="please_set_main_image">Пожалуйста, установите основные изображения.</string>
|
<string name="please_set_main_image">Пожалуйста, установите основные изображения.</string>
|
||||||
|
@ -686,7 +686,6 @@
|
||||||
<string name="girl">женщин</string>
|
<string name="girl">женщин</string>
|
||||||
<string name="search_hint">Введите, пожалуйста, содержимое поиска</string>
|
<string name="search_hint">Введите, пожалуйста, содержимое поиска</string>
|
||||||
<string name="report_to_deal">Отчет.</string>
|
<string name="report_to_deal">Отчет.</string>
|
||||||
<string name="banned_mod">Был снят с крючка администратором за жалобу.</string>
|
|
||||||
<string name="unable_to_report">Этот модуль скрыт и не может быть донесён.</string>
|
<string name="unable_to_report">Этот модуль скрыт и не может быть донесён.</string>
|
||||||
<string name="unable_to_report2">Не могу сообщить о своей группе моделей, и если вы хотите, чтобы она ушла с подиума, пожалуйста, пройдите в/управление работами /.</string>
|
<string name="unable_to_report2">Не могу сообщить о своей группе моделей, и если вы хотите, чтобы она ушла с подиума, пожалуйста, пройдите в/управление работами /.</string>
|
||||||
<string name="admin">Администратор.</string>
|
<string name="admin">Администратор.</string>
|
||||||
|
|
|
@ -461,7 +461,7 @@
|
||||||
<string name="user_name">用户名</string>
|
<string name="user_name">用户名</string>
|
||||||
<string name="report_mod">举报模组</string>
|
<string name="report_mod">举报模组</string>
|
||||||
<string name="report_user">举报用户</string>
|
<string name="report_user">举报用户</string>
|
||||||
<string name="view_the_report_object">查看(%1$s)</string>
|
<string name="view_the_report_object">查看</string>
|
||||||
<string name="bookmark_already_exists">此书签已存在,请更换路径。</string>
|
<string name="bookmark_already_exists">此书签已存在,请更换路径。</string>
|
||||||
<string name="feedback">意见反馈</string>
|
<string name="feedback">意见反馈</string>
|
||||||
<string name="please_set_main_image">请设置主体图像。</string>
|
<string name="please_set_main_image">请设置主体图像。</string>
|
||||||
|
@ -717,7 +717,7 @@
|
||||||
<string name="girl">女</string>
|
<string name="girl">女</string>
|
||||||
<string name="search_hint">请输入搜索内容</string>
|
<string name="search_hint">请输入搜索内容</string>
|
||||||
<string name="report_to_deal">举报处理</string>
|
<string name="report_to_deal">举报处理</string>
|
||||||
<string name="banned_mod">因举报,被管理员下架。</string>
|
<string name="banned_mod">因举报,被管理员下架</string>
|
||||||
<string name="unable_to_report">此模组是隐藏的,无法举报。</string>
|
<string name="unable_to_report">此模组是隐藏的,无法举报。</string>
|
||||||
<string name="unable_to_report2">不能举报自己的模组,若希望下架模组请前往\"作品管理\"。</string>
|
<string name="unable_to_report2">不能举报自己的模组,若希望下架模组请前往\"作品管理\"。</string>
|
||||||
<string name="admin">管理员</string>
|
<string name="admin">管理员</string>
|
||||||
|
@ -951,4 +951,8 @@
|
||||||
<string name="obtain_source_code_msg">在Github上查看铁锈助手的源代码,助手已开源,欢迎二次开发。</string>
|
<string name="obtain_source_code_msg">在Github上查看铁锈助手的源代码,助手已开源,欢迎二次开发。</string>
|
||||||
<string name="obtain_source_code">获取源代码</string>
|
<string name="obtain_source_code">获取源代码</string>
|
||||||
<string name="setting_obtain_source_code" translatable="false">ObtainSourceCode</string>
|
<string name="setting_obtain_source_code" translatable="false">ObtainSourceCode</string>
|
||||||
|
<string name="rust_api">铁锈Api-Code</string>
|
||||||
|
<string name="search_type_template_package">模板包</string>
|
||||||
|
<string name="public_mod">公开</string>
|
||||||
|
<string name="private_mod">私有</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user