refactor(app): 移除关于页面相关代码
- 删除了 AboutActivity 中的菜单选项和处理逻辑 - 移除了 LibraryActivity、PayActivity 等多个 Activity 的实现 - 删除了相关的布局文件和菜单资源 - 移除了 LibAdapter、LibInfo 等数据类
This commit is contained in:
parent
39a4913a32
commit
6985c2b4ca
|
@ -1,11 +1,8 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.core.text.HtmlCompat
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityAboutBinding
|
||||
|
@ -73,25 +70,6 @@ class AboutActivity : BaseActivity<ActivityAboutBinding>() {
|
|||
|
||||
}
|
||||
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_about, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.thanks -> {
|
||||
startActivity(Intent(this, ThanksActivity::class.java))
|
||||
}
|
||||
|
||||
R.id.libs -> {
|
||||
startActivity(Intent(this, LibraryActivity::class.java))
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityAboutBinding {
|
||||
return ActivityAboutBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
|
|
@ -1,199 +0,0 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.pro.adapters.LibAdapter
|
||||
import com.coldmint.rust.pro.databean.LibInfo
|
||||
import com.coldmint.rust.pro.databinding.ActivityLibraryBinding
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
import com.google.android.material.divider.MaterialDividerItemDecoration
|
||||
import java.util.ArrayList
|
||||
|
||||
class LibraryActivity : BaseActivity<ActivityLibraryBinding>() {
|
||||
|
||||
/**
|
||||
* 获取库信息列表
|
||||
* @return ArrayList<LibInfo>
|
||||
*/
|
||||
private fun getLibInfoList(): ArrayList<LibInfo> {
|
||||
val libInfoArrayList = ArrayList<LibInfo>()
|
||||
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"Kotlin",
|
||||
"A modern programming language that makes developers happier.\n让开发人员更快乐的一门现代编程语言。",
|
||||
"https://kotlinlang.org/",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
// libInfoArrayList.add(
|
||||
// LibInfo(
|
||||
// "Light",
|
||||
// "The usual Snackbar, but elegant",
|
||||
// "https://github.com/TonnyL/Light",
|
||||
// "MIT"
|
||||
// )
|
||||
// )
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"FloatingActionButtonSpeedDial",
|
||||
"A Floating Action Button Speed Dial implementation for Android that follows the Material Design specification",
|
||||
"https://github.com/leinardi/FloatingActionButtonSpeedDial",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"Banner",
|
||||
"Banner 2.0 来了!Android广告图片轮播控件,内部基于ViewPager2实现,Indicator和UI都可以自定义。",
|
||||
"https://github.com/youth5201314/banner",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"TinyPinyin",
|
||||
"适用于Java和Android的快速、低内存占用的汉字转拼音库。",
|
||||
"https://github.com/promeG/TinyPinyin",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"RikkaX",
|
||||
"Rikka's Android libraries.",
|
||||
"https://github.com/RikkaApps/RikkaX",
|
||||
"MIT License"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"uCrop",
|
||||
"Image Cropping Library for Android",
|
||||
"https://github.com/Yalantis/uCrop",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
// libInfoArrayList.add(
|
||||
// LibInfo(
|
||||
// "Kongzue StackLabel",
|
||||
// "空祖家的堆叠标签(以下碎念:一开始起名字“StackLabel”没想太多结果被人吐槽Stack是整齐堆叠的意思...........好吧这是我的锅不过现在要改也来不及了,好用就行了...吧?",
|
||||
// "https://github.com/kongzue/StackLabel",
|
||||
// "Apache License 2.0"
|
||||
// )
|
||||
// )
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"sora-editor",
|
||||
"A cool code editor library on Android with syntax-highlighting and auto-completion. (aka CodeEditor)",
|
||||
"https://github.com/Rosemoe/sora-editor",
|
||||
"LGPL 2.1"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"ColorPicker",
|
||||
"color picker for android",
|
||||
"https://github.com/QuadFlask/colorpicker",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"OkHttp",
|
||||
"Square’s meticulous HTTP client for the JVM, Android, and GraalVM.",
|
||||
"https://github.com/square/okhttp",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"Gson",
|
||||
"A Java serialization/deserialization library to convert Java Objects into JSON and back",
|
||||
"https://github.com/google/gson",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"Glide",
|
||||
"An image loading and caching library for Android focused on smooth scrolling",
|
||||
"https://github.com/bumptech/glide",
|
||||
"BSD, part MIT and Apache 2.0."
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"Glide Transformations",
|
||||
"An Android transformation library providing a variety of image transformations for Glide.",
|
||||
"https://github.com/wasabeef/glide-transformations",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"CustomActivityOnCrash",
|
||||
"Android library that allows launching a custom activity when your app crashes, instead of showing the hated \"Unfortunately, X has stopped\" dialog.",
|
||||
"https://github.com/Ereza/CustomActivityOnCrash",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"ImmersionBar",
|
||||
"android 4.4以上沉浸式状态栏和沉浸式导航栏管理,适配横竖屏切换、刘海屏、软键盘弹出等问题,可以修改状态栏字体颜色和导航栏图标颜色,以及不可修改字体颜色手机的适配,适用于Activity、Fragment、DialogFragment、Dialog,PopupWindow。",
|
||||
"https://github.com/gyf-dev/ImmersionBar",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"PermissionX",
|
||||
"An open source Android library that makes handling runtime permissions extremely easy.",
|
||||
"https://github.com/guolindev/PermissionX",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
libInfoArrayList.add(
|
||||
LibInfo(
|
||||
"MultiLanguages",
|
||||
"Android 多语种适配框架,兼容高版本,适配第三方库语种",
|
||||
"https://github.com/getActivity/MultiLanguages",
|
||||
"Apache License 2.0"
|
||||
)
|
||||
)
|
||||
// libInfoArrayList.add(
|
||||
// LibInfo(
|
||||
// "material-dialogs",
|
||||
// "A beautiful, fluid, and extensible dialogs API for Kotlin & Android.",
|
||||
// "https://github.com/afollestad/material-dialogs",
|
||||
// "Apache License 2.0"
|
||||
// )
|
||||
// )
|
||||
return libInfoArrayList
|
||||
}
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityLibraryBinding {
|
||||
return ActivityLibraryBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
|
||||
if (canUseView) {
|
||||
setReturnButton()
|
||||
title = getString(R.string.libs)
|
||||
val divider = MaterialDividerItemDecoration(
|
||||
this,
|
||||
MaterialDividerItemDecoration.VERTICAL
|
||||
)
|
||||
viewBinding.libsView.addItemDecoration(
|
||||
divider
|
||||
)
|
||||
viewBinding.libsView.layoutManager = StableLinearLayoutManager(this@LibraryActivity)
|
||||
val libAdapter = LibAdapter(this@LibraryActivity, getLibInfoList())
|
||||
viewBinding.libsView.adapter = libAdapter
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,373 +0,0 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.graphics.Typeface
|
||||
import android.os.Bundle
|
||||
import android.os.CountDownTimer
|
||||
import android.text.Editable
|
||||
import android.text.SpannableString
|
||||
import android.text.Spanned
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.widget.AdapterView
|
||||
import android.widget.Toast
|
||||
import com.bumptech.glide.Glide
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityPayBinding
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.text.style.StyleSpan
|
||||
import android.util.Log
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import androidx.core.view.isVisible
|
||||
import com.coldmint.dialog.CoreDialog
|
||||
import com.coldmint.rust.core.dataBean.OrderDataBean
|
||||
import com.coldmint.rust.core.debug.LogCat
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.tool.AppOperator
|
||||
import com.coldmint.rust.core.tool.FileOperator
|
||||
import com.coldmint.rust.core.web.ActivationApp
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import okhttp3.*
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2022/1/11 13:38
|
||||
*/
|
||||
class PayActivity : BaseActivity<ActivityPayBinding>() {
|
||||
val hashMap: HashMap<String, String> = HashMap()
|
||||
|
||||
//是否超时了
|
||||
var past: Boolean = false
|
||||
|
||||
//是否第一次启动
|
||||
var first = true
|
||||
|
||||
//优惠的价格(用于询问退出时使用)
|
||||
var difference = 0.toDouble()
|
||||
|
||||
//倒计时器
|
||||
var countDownTimer: CountDownTimer? = null
|
||||
|
||||
val color by lazy {
|
||||
GlobalMethod.getColorPrimary(this)
|
||||
}
|
||||
|
||||
|
||||
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
|
||||
if (canUseView) {
|
||||
title = getText(R.string.pay)
|
||||
setReturnButton()
|
||||
val thisIntent = intent
|
||||
val uuid = thisIntent.getStringExtra("uuid")
|
||||
val account = thisIntent.getStringExtra("account")
|
||||
if (uuid == null || account == null) {
|
||||
showError("启动错误")
|
||||
return
|
||||
}
|
||||
hashMap[getString(R.string.qq_pay)] =
|
||||
ServerConfiguration.getRealLink("/resources/image/Payment/QQ.png")
|
||||
hashMap[getString(R.string.alipay)] =
|
||||
ServerConfiguration.getRealLink("/resources/image/Payment/Alipay.png")
|
||||
hashMap[getString(R.string.wechat_pay)] =
|
||||
ServerConfiguration.getRealLink("/resources/image/Payment/WeChat.png")
|
||||
Glide.with(this@PayActivity)
|
||||
.load(hashMap[getString(R.string.wechat_pay)]).apply(GlobalMethod.getRequestOptions())
|
||||
.into(viewBinding.baseImageView)
|
||||
viewBinding.typeAutoCompleteTextView.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
val type = s.toString()
|
||||
when (type) {
|
||||
getString(R.string.qq_pay), getString(R.string.alipay), getString(R.string.wechat_pay) -> {
|
||||
viewBinding.saveCode.text = getString(R.string.sava_code_and_copy_id)
|
||||
viewBinding.cardView.isVisible = true
|
||||
Glide.with(this@PayActivity)
|
||||
.load(hashMap[type]).apply(GlobalMethod.getRequestOptions())
|
||||
.into(viewBinding.baseImageView)
|
||||
}
|
||||
// getString(R.string.paypal) -> {
|
||||
// viewBinding.cardView.isVisible = false
|
||||
// viewBinding.saveCode.text = getString(R.string.paypal_payment)
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
viewBinding.saveCode.setOnClickListener {
|
||||
val text = viewBinding.saveCode.text.toString()
|
||||
if (text == getString(R.string.paypal_payment)) {
|
||||
//启动paypal
|
||||
// val intent = Intent(this, BrowserActivity::class.java)
|
||||
// intent.putExtra("link", "https://paypal.me/coldmint")
|
||||
// startActivity(intent)
|
||||
} else {
|
||||
GlobalMethod.copyText(this, uuid)
|
||||
val type = viewBinding.typeAutoCompleteTextView.text.toString()
|
||||
val link = hashMap[type]
|
||||
val appName = when (type) {
|
||||
getString(R.string.qq_pay) -> {
|
||||
getString(R.string.qq)
|
||||
}
|
||||
getString(R.string.wechat_pay) -> {
|
||||
getString(R.string.wechat)
|
||||
}
|
||||
else -> {
|
||||
getString(R.string.alipay)
|
||||
}
|
||||
}
|
||||
val targetFile = File(AppSettings.dataRootDirectory + "/pay/" + type + ".png")
|
||||
//获取下载链接,保存二维码(如果二维码存在则不会保存)
|
||||
if (link != null && !targetFile.exists()) {
|
||||
val okHttpClient = ServerConfiguration.initOkHttpClient()
|
||||
val request = Request.Builder()
|
||||
.url(link).build()
|
||||
val call = okHttpClient.newCall(request)
|
||||
call.enqueue(object : Callback {
|
||||
override fun onFailure(call: Call, e: IOException) {
|
||||
Snackbar.make(
|
||||
viewBinding.saveCode,
|
||||
R.string.file_download_fail,
|
||||
Snackbar.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
|
||||
override fun onResponse(call: Call, response: Response) {
|
||||
val body = response.body
|
||||
if (body != null) {
|
||||
val inputStream = body.byteStream()
|
||||
FileOperator.copyFile(
|
||||
inputStream,
|
||||
targetFile
|
||||
)
|
||||
} else {
|
||||
Snackbar.make(
|
||||
viewBinding.saveCode,
|
||||
R.string.file_download_fail,
|
||||
Snackbar.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
AppOperator.updateTheAlbum(this, targetFile)
|
||||
CoreDialog(this).setTitle(R.string.pay).setMessage(String.format(
|
||||
getString(R.string.pay_tip2),
|
||||
appName
|
||||
)).setPositiveButton(R.string.dialog_ok){
|
||||
val packName = when (type) {
|
||||
getString(R.string.qq_pay) -> {
|
||||
"com.tencent.mobileqq"
|
||||
}
|
||||
getString(R.string.wechat_pay) -> {
|
||||
"com.tencent.mm"
|
||||
}
|
||||
else -> {
|
||||
"com.eg.android.AlipayGphone"
|
||||
}
|
||||
}
|
||||
if (AppOperator.isAppInstalled(this@PayActivity, packName)) {
|
||||
AppOperator.openApp(this@PayActivity, packName)
|
||||
} else {
|
||||
Snackbar.make(
|
||||
viewBinding.saveCode,
|
||||
String.format(
|
||||
getString(R.string.no_app_installed),
|
||||
appName
|
||||
),
|
||||
Snackbar.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}.setNegativeButton(R.string.dialog_cancel){
|
||||
|
||||
}.setCancelable(false).show()
|
||||
}
|
||||
}
|
||||
|
||||
ActivationApp.instance.getOrderInfo(account, uuid, object : ApiCallBack<OrderDataBean> {
|
||||
override fun onResponse(t: OrderDataBean) {
|
||||
if (t.code == ServerConfiguration.Success_Code) {
|
||||
val data = t.data
|
||||
val stringBuilder = StringBuilder()
|
||||
stringBuilder.append("订单名:")
|
||||
stringBuilder.append(data.name)
|
||||
stringBuilder.append("\n订单号:")
|
||||
stringBuilder.append(data.flag)
|
||||
stringBuilder.append("\n创建日期:")
|
||||
stringBuilder.append(data.createTime)
|
||||
stringBuilder.append("\n应付款:")
|
||||
stringBuilder.append(data.price)
|
||||
stringBuilder.append("元")
|
||||
if (data.originalPrice != data.price) {
|
||||
stringBuilder.append("\n原价:")
|
||||
stringBuilder.append(data.originalPrice)
|
||||
stringBuilder.append("元")
|
||||
difference = data.originalPrice - data.price
|
||||
}
|
||||
viewBinding.info.text = stringBuilder.toString()
|
||||
val timeBuilder = StringBuilder()
|
||||
countDownTimer = object : CountDownTimer(600000, 1000) {
|
||||
override fun onTick(p0: Long) {
|
||||
//秒
|
||||
timeBuilder.clear()
|
||||
val second = p0 / 1000
|
||||
if (second >= 60) {
|
||||
val minute = second / 60
|
||||
timeBuilder.append(minute)
|
||||
timeBuilder.append("分钟")
|
||||
timeBuilder.append(second % 60)
|
||||
timeBuilder.append("秒")
|
||||
} else {
|
||||
timeBuilder.append(second)
|
||||
timeBuilder.append("秒")
|
||||
}
|
||||
setMoney(timeBuilder.toString(), t.data.price)
|
||||
LogCat.d("秒", timeBuilder.toString())
|
||||
}
|
||||
|
||||
override fun onFinish() {
|
||||
past = true
|
||||
viewBinding.typeAutoCompleteTextView.isEnabled = false
|
||||
viewBinding.baseImageView.isVisible = false
|
||||
viewBinding.payMoneyView.text = getString(R.string.order_timeout)
|
||||
viewBinding.saveCode.isEnabled = false
|
||||
}
|
||||
}
|
||||
countDownTimer!!.start()
|
||||
} else {
|
||||
showError(t.message)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
showInternetError(viewBinding.saveCode, e)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (first) {
|
||||
first = false
|
||||
} else {
|
||||
if (!past) {
|
||||
CoreDialog(this).setTitle(R.string.pay).setMessage(R.string.is_paid).setPositiveButton(R.string.paid_yes){
|
||||
finish()
|
||||
}.setNegativeButton(R.string.paid_no){
|
||||
askingQuit()
|
||||
}.setNeutralButton(R.string.paid_continue){
|
||||
|
||||
}.setCancelable(false).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) {
|
||||
askingQuit()
|
||||
return true
|
||||
}
|
||||
return super.onKeyDown(keyCode, event)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
val id = item.itemId
|
||||
if (id == android.R.id.home) {
|
||||
askingQuit()
|
||||
return true
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
/**
|
||||
* 询问是否退出
|
||||
*/
|
||||
fun askingQuit() {
|
||||
if (difference == 0.toDouble()) {
|
||||
countDownTimer?.cancel()
|
||||
finish()
|
||||
} else {
|
||||
CoreDialog(this).setTitle(R.string.paid_no).setMessage(String.format(
|
||||
getString(R.string.preferential_price),
|
||||
difference
|
||||
)).setPositiveButton(R.string.dialog_ok){
|
||||
countDownTimer?.cancel()
|
||||
finish()
|
||||
}.setNegativeButton(R.string.dialog_cancel){
|
||||
|
||||
}.setCancelable(false).show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置显示的钱数以及剩余时间
|
||||
* @param time String
|
||||
* @param money Double
|
||||
*/
|
||||
fun setMoney(time: String, money: Double) {
|
||||
val payMoney = getString(R.string.pay_tip)
|
||||
val tipMoney = money.toString()
|
||||
val tip = String.format(payMoney, time, tipMoney)
|
||||
val start = tip.indexOf("在") + 1
|
||||
val end = tip.indexOf("内")
|
||||
val start2 = tip.indexOf("付") + 1
|
||||
val end2 = tip.indexOf("元")
|
||||
val spannableString = SpannableString(tip)
|
||||
val colorSpan = ForegroundColorSpan(color)
|
||||
val colorSpan2 = ForegroundColorSpan(color)
|
||||
spannableString.setSpan(
|
||||
colorSpan,
|
||||
start,
|
||||
end,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
spannableString.setSpan(
|
||||
StyleSpan(Typeface.BOLD),
|
||||
start,
|
||||
end,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
spannableString.setSpan(
|
||||
colorSpan2,
|
||||
start2,
|
||||
end2,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
spannableString.setSpan(
|
||||
StyleSpan(Typeface.BOLD),
|
||||
start2,
|
||||
end2,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
viewBinding.payMoneyView.text = spannableString
|
||||
}
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityPayBinding {
|
||||
return ActivityPayBinding.inflate(layoutInflater)
|
||||
}
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.core.dataBean.ApiResponse
|
||||
import com.coldmint.rust.core.dataBean.report.ReportItemDataBean
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.web.Report
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.pro.adapters.ReportAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityReportListBinding
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2022/1/9 10:39
|
||||
*/
|
||||
class ReportListActivity : BaseActivity<ActivityReportListBinding>() {
|
||||
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
|
||||
if (canUseView) {
|
||||
title = getText(R.string.report_to_deal)
|
||||
setReturnButton()
|
||||
val account = AppSettings.getValue(AppSettings.Setting.Account, "")
|
||||
if (account.isBlank()) {
|
||||
showInfoToView(R.string.please_login_first)
|
||||
return
|
||||
}
|
||||
viewBinding.recyclerView.layoutManager = StableLinearLayoutManager(this)
|
||||
loadList(account)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载列表
|
||||
* @param account String
|
||||
*/
|
||||
fun loadList(account: String) {
|
||||
Report.instance.list(object : ApiCallBack<ReportItemDataBean> {
|
||||
override fun onResponse(t: ReportItemDataBean) {
|
||||
if (t.code == ServerConfiguration.Success_Code) {
|
||||
val dataList = t.data
|
||||
if (dataList != null && dataList.isNotEmpty()) {
|
||||
val adapter = ReportAdapter(this@ReportListActivity, dataList)
|
||||
adapter.setItemEvent { i, itemReportBinding, viewHolder, data ->
|
||||
|
||||
itemReportBinding.actionView.setOnClickListener {
|
||||
Report.instance.dispose(
|
||||
account,
|
||||
data.id,
|
||||
true,
|
||||
object : ApiCallBack<ApiResponse> {
|
||||
override fun onResponse(t: ApiResponse) {
|
||||
if (t.code == ServerConfiguration.Success_Code) {
|
||||
val index = dataList.indexOf(data)
|
||||
dataList.removeAt(index)
|
||||
adapter.notifyItemRemoved(index)
|
||||
if (dataList.isEmpty()) {
|
||||
loadList(account)
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(
|
||||
this@ReportListActivity,
|
||||
t.message,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
Toast.makeText(
|
||||
this@ReportListActivity,
|
||||
R.string.network_error,
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
.show()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
itemReportBinding.ignoreView.setOnClickListener {
|
||||
Report.instance.dispose(
|
||||
account,
|
||||
data.id,
|
||||
false,
|
||||
object : ApiCallBack<ApiResponse> {
|
||||
override fun onResponse(t: ApiResponse) {
|
||||
if (t.code == ServerConfiguration.Success_Code) {
|
||||
val index = dataList.indexOf(data)
|
||||
dataList.removeAt(index)
|
||||
adapter.notifyItemRemoved(index)
|
||||
if (dataList.isEmpty()) {
|
||||
loadList(account)
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(
|
||||
this@ReportListActivity,
|
||||
t.message,
|
||||
Toast.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
Toast.makeText(
|
||||
this@ReportListActivity,
|
||||
R.string.network_error,
|
||||
Toast.LENGTH_SHORT
|
||||
)
|
||||
.show()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
viewBinding.tipView.isVisible = false
|
||||
viewBinding.progressBar.isVisible = false
|
||||
viewBinding.recyclerView.isVisible = true
|
||||
viewBinding.recyclerView.adapter = adapter
|
||||
} else {
|
||||
showInfoToView(str = t.message)
|
||||
}
|
||||
} else {
|
||||
showInfoToView(str = t.message)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
showInfoToView(R.string.network_error)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示错误在视图上
|
||||
* @param resID Int?
|
||||
* @param str String?
|
||||
*/
|
||||
fun showInfoToView(resID: Int? = null, str: String? = null) {
|
||||
viewBinding.recyclerView.isVisible = false
|
||||
viewBinding.progressBar.isVisible = false
|
||||
viewBinding.tipView.isVisible = true
|
||||
if (resID != null) {
|
||||
viewBinding.tipView.setText(resID)
|
||||
}
|
||||
if (str != null) {
|
||||
viewBinding.tipView.text = str
|
||||
}
|
||||
}
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityReportListBinding {
|
||||
return ActivityReportListBinding.inflate(layoutInflater)
|
||||
}
|
||||
}
|
|
@ -1,172 +0,0 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.core.dataBean.mod.WebModListData
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.core.web.WebMod
|
||||
import com.coldmint.rust.pro.adapters.WebModAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityTagBinding
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2021/12/10 17:27
|
||||
*/
|
||||
class TagActivity : BaseActivity<ActivityTagBinding>() {
|
||||
var titleStr: String? = null
|
||||
|
||||
|
||||
/**
|
||||
* 加载标签
|
||||
* @param tag String
|
||||
*/
|
||||
fun loadTag(tag: String) {
|
||||
WebMod.instance.list(object : ApiCallBack<WebModListData> {
|
||||
override fun onResponse(t: WebModListData) {
|
||||
onEventResponse(t)
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
onEventFailure()
|
||||
}
|
||||
|
||||
}, "[${tag}]")
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载用户模组
|
||||
* @param account String 账号
|
||||
* @param sortMode SortMode? 排序模式
|
||||
*/
|
||||
fun loadUser(account: String, sortMode: WebMod.SortMode?) {
|
||||
WebMod.instance.getUserModList(account, object : ApiCallBack<WebModListData> {
|
||||
override fun onResponse(t: WebModListData) {
|
||||
onEventResponse(t)
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
onEventFailure()
|
||||
}
|
||||
|
||||
}, sortMode)
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索模式
|
||||
* @param keyWord String
|
||||
*/
|
||||
fun loadKeyWord(keyWord: String) {
|
||||
WebMod.instance.search(keyWord, object : ApiCallBack<WebModListData> {
|
||||
override fun onResponse(t: WebModListData) {
|
||||
onEventResponse(t)
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
onEventFailure()
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 当网络请求成功
|
||||
* @param t WebModListData
|
||||
*/
|
||||
fun onEventResponse(t: WebModListData) {
|
||||
val dataList = t.data
|
||||
if (t.code == ServerConfiguration.Success_Code && dataList != null) {
|
||||
val adapter = WebModAdapter(this, dataList)
|
||||
adapter.setItemEvent { i, webModItemBinding, viewHolder, data ->
|
||||
|
||||
}
|
||||
viewBinding.recyclerView.adapter = adapter
|
||||
viewBinding.recyclerView.isVisible = true
|
||||
viewBinding.progressBar.isVisible = false
|
||||
} else {
|
||||
viewBinding.progressBar.isVisible = false
|
||||
viewBinding.tipView.isVisible = true
|
||||
viewBinding.tipView.text = t.message
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当网络加载失败
|
||||
*/
|
||||
fun onEventFailure() {
|
||||
viewBinding.progressBar.isVisible = false
|
||||
viewBinding.tipView.isVisible = true
|
||||
viewBinding.tipView.text = getString(R.string.network_error)
|
||||
}
|
||||
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityTagBinding {
|
||||
return ActivityTagBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
|
||||
if (canUseView) {
|
||||
setReturnButton()
|
||||
val thisIntent = intent
|
||||
val bundle = thisIntent.getBundleExtra("data")
|
||||
if (bundle == null) {
|
||||
showError("启动错误")
|
||||
return
|
||||
}
|
||||
titleStr = bundle.getString("title")
|
||||
val action = bundle.getString("action")
|
||||
viewBinding.recyclerView.layoutManager = StableLinearLayoutManager(this)
|
||||
|
||||
if (action == null) {
|
||||
showError("错误,action为空")
|
||||
return
|
||||
} else {
|
||||
when (action) {
|
||||
"tag" -> {
|
||||
val tag = bundle.getString("tag")
|
||||
if (tag == null) {
|
||||
showError("错误,tag为空")
|
||||
return
|
||||
}
|
||||
title = titleStr ?: tag
|
||||
loadTag(tag)
|
||||
}
|
||||
"user-download" -> {
|
||||
val account = bundle.getString("account")
|
||||
if (account == null) {
|
||||
showError("错误,account为空")
|
||||
return
|
||||
}
|
||||
title = titleStr ?: account
|
||||
loadUser(account, WebMod.SortMode.Download_Number)
|
||||
}
|
||||
"user-time" -> {
|
||||
val account = bundle.getString("account")
|
||||
if (account == null) {
|
||||
showError("错误,account为空")
|
||||
return
|
||||
}
|
||||
title = titleStr ?: account
|
||||
loadUser(account, WebMod.SortMode.Latest_Time)
|
||||
}
|
||||
"search-mod" -> {
|
||||
val keyWord = bundle.getString("keyword")
|
||||
if (keyWord == null) {
|
||||
showError("错误,keyword为空")
|
||||
return
|
||||
}
|
||||
title = titleStr ?: keyWord
|
||||
loadKeyWord(keyWord)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,43 +1,17 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.json.JSONObject
|
||||
import android.os.Bundle
|
||||
import android.content.Intent
|
||||
import org.json.JSONException
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.*
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.get
|
||||
import com.coldmint.dialog.CoreDialog
|
||||
import com.coldmint.rust.core.LocalTemplatePackage
|
||||
import com.coldmint.rust.core.interfaces.LineParserEvent
|
||||
import com.coldmint.rust.core.tool.FileOperator
|
||||
import com.coldmint.rust.core.tool.LineParser
|
||||
import com.coldmint.rust.pro.adapters.AttachFileAdapter
|
||||
import com.coldmint.rust.pro.adapters.TemplateActionAdapter
|
||||
import com.coldmint.rust.pro.adapters.TemplateMakerAdapter
|
||||
import com.coldmint.rust.pro.adapters.TemplateMakerPagerAdapter
|
||||
import com.coldmint.rust.pro.databean.CodeData
|
||||
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityTemplateMakerBinding
|
||||
import com.coldmint.rust.pro.databinding.AttachFilesBinding
|
||||
import com.coldmint.rust.pro.fragments.EditTurretInfoFragment
|
||||
import com.coldmint.rust.pro.fragments.SaveTemplateFragment
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
import com.coldmint.rust.pro.viewmodel.TemplateMakerViewModel
|
||||
import com.google.gson.Gson
|
||||
import org.json.JSONArray
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
//模板制作器
|
||||
class TemplateMakerActivity : BaseActivity<ActivityTemplateMakerBinding>() {
|
||||
|
|
|
@ -1,56 +1,30 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import org.json.JSONObject
|
||||
import android.os.Bundle
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.Log
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import org.json.JSONException
|
||||
import org.json.JSONArray
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.coldmint.rust.core.SourceFile
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.*
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.coldmint.dialog.CoreDialog
|
||||
import com.coldmint.rust.core.LocalTemplatePackage
|
||||
import com.coldmint.rust.core.dataBean.InputParserDataBean
|
||||
import com.coldmint.rust.core.dataBean.IntroducingDataBean
|
||||
import com.coldmint.rust.core.dataBean.ListParserDataBean
|
||||
import com.coldmint.rust.core.dataBean.template.LocalTemplateFile
|
||||
import com.coldmint.rust.core.dataBean.template.TemplatePackage
|
||||
import com.coldmint.rust.core.dataBean.template.WebTemplateData
|
||||
import com.coldmint.rust.core.debug.LogCat
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.interfaces.TemplateParser
|
||||
import com.coldmint.rust.core.templateParser.InputParser
|
||||
import com.coldmint.rust.core.templateParser.IntroducingParser
|
||||
import com.coldmint.rust.core.templateParser.ListParser
|
||||
import com.coldmint.rust.core.tool.FileOperator
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.core.web.TemplatePhp
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityTemplateParserBinding
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.tool.UnitAutoCompleteHelper
|
||||
import com.coldmint.rust.pro.viewmodel.TemplateParserViewModel
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.dialog.MaterialDialogs
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
import com.google.gson.Gson
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.concurrent.thread
|
||||
import java.util.Locale
|
||||
|
||||
class TemplateParserActivity : BaseActivity<ActivityTemplateParserBinding>() {
|
||||
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.pro.adapters.ThanksAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databean.ThanksDataBean
|
||||
import com.coldmint.rust.pro.databinding.ActivityThanksBinding
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
import com.google.android.material.divider.MaterialDividerItemDecoration
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2022/1/3 19:37
|
||||
*/
|
||||
class ThanksActivity : BaseActivity<ActivityThanksBinding>() {
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityThanksBinding {
|
||||
return ActivityThanksBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
|
||||
if (canUseView) {
|
||||
title = getString(R.string.special_thanks_to)
|
||||
setReturnButton()
|
||||
val divider = MaterialDividerItemDecoration(
|
||||
this,
|
||||
MaterialDividerItemDecoration.VERTICAL
|
||||
)
|
||||
|
||||
viewBinding.recyclerView.addItemDecoration(
|
||||
divider
|
||||
)
|
||||
viewBinding.recyclerView.layoutManager = StableLinearLayoutManager(this)
|
||||
val list = ArrayList<ThanksDataBean>()
|
||||
list.add(ThanksDataBean("空调大郎", "帮助翻译俄语版本。", 1491779490))
|
||||
list.add(ThanksDataBean("JDSA Ling", "制作助手新手模板,已被整合至助手内置模版。跟随助手更新。", 2735951230))
|
||||
list.add(ThanksDataBean("Alice's Dream", "帮助薄荷优化代码表。", 3372003670))
|
||||
list.add(ThanksDataBean("克鲁鲁.采佩西", "帮助薄荷制作教程。", 2275140013))
|
||||
list.add(ThanksDataBean("慕青","帮助薄荷修复助手bug,优化助手功能。",1966944300))
|
||||
viewBinding.recyclerView.adapter = ThanksAdapter(this, list)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -11,7 +11,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import com.coldmint.dialog.CoreDialog
|
||||
import com.coldmint.rust.core.ModClass
|
||||
import com.coldmint.rust.core.SourceFile
|
||||
import com.coldmint.rust.core.turret.CoordinateData
|
||||
import com.coldmint.rust.core.turret.TurretManager
|
||||
import com.coldmint.rust.pro.adapters.DesignAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.core.ModClass
|
||||
import com.coldmint.rust.core.SourceFile
|
||||
import android.os.Bundle
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.core.view.isVisible
|
||||
import com.coldmint.dialog.InputDialog
|
||||
import com.coldmint.rust.core.ModClass
|
||||
import com.coldmint.rust.core.SourceFile
|
||||
import com.coldmint.rust.core.database.code.CodeDataBase
|
||||
import com.coldmint.rust.core.tool.FileOperator
|
||||
import com.coldmint.rust.pro.adapters.ModPageAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityUnitsBinding
|
||||
import com.coldmint.rust.pro.databinding.DialogSearchUnitsBinding
|
||||
import com.coldmint.rust.pro.fragments.AllUnitsFragment
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
|
|
|
@ -2,31 +2,27 @@ package com.coldmint.rust.pro
|
|||
|
||||
|
||||
import android.os.Bundle
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.core.dataBean.ValueTypeDataBean
|
||||
import com.google.gson.Gson
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import android.widget.ArrayAdapter
|
||||
import android.text.TextWatcher
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.ArrayAdapter
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.view.isVisible
|
||||
import com.coldmint.rust.core.dataBean.ValueTypeDataBean
|
||||
import com.coldmint.rust.core.database.file.FileDataBase
|
||||
import com.coldmint.rust.core.tool.FileOperator
|
||||
import com.coldmint.rust.pro.adapters.ValueAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityValueTypeBinding
|
||||
import com.coldmint.rust.pro.databinding.EditValueBinding
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.gson.Gson
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.json.JSONException
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
import org.json.JSONObject
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
|
|
|
@ -1,230 +0,0 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.PopupMenu
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
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.mod.WebModAllInfoData
|
||||
import com.coldmint.rust.core.dataBean.mod.WebModListData
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.core.web.WebMod
|
||||
import com.coldmint.rust.pro.adapters.WebModAdapter
|
||||
import com.coldmint.rust.pro.adapters.WebModAllInfoAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityWorkmangementBinding
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||
import com.coldmint.rust.pro.ui.StableLinearLayoutManager
|
||||
import com.google.android.material.divider.MaterialDividerItemDecoration
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2022/1/4 9:34
|
||||
*/
|
||||
class WorkManagementActivity : BaseActivity<ActivityWorkmangementBinding>() {
|
||||
/**
|
||||
* 显示错误
|
||||
* @param stringRes Int 字符串资源id
|
||||
* @param str String 字符串
|
||||
*/
|
||||
fun showErrorInView(stringRes: Int? = null, str: String? = null) {
|
||||
viewBinding.recyclerView.isVisible = false
|
||||
viewBinding.progressBar.isVisible = false
|
||||
viewBinding.textview.isVisible = true
|
||||
if (stringRes != null) {
|
||||
viewBinding.textview.setText(stringRes)
|
||||
}
|
||||
if (str != null) {
|
||||
viewBinding.textview.text = str
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityWorkmangementBinding {
|
||||
return ActivityWorkmangementBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
val account = AppSettings.getValue(AppSettings.Setting.Account, "")
|
||||
if (account.isBlank()) {
|
||||
showErrorInView(R.string.please_login_first)
|
||||
} else {
|
||||
WebMod.instance.getUserModListAllInfo(
|
||||
account,
|
||||
object : ApiCallBack<WebModAllInfoData> {
|
||||
override fun onResponse(t: WebModAllInfoData) {
|
||||
val data = t.data?.toMutableList()
|
||||
if (t.code == ServerConfiguration.Success_Code && data != null && data.isNotEmpty()) {
|
||||
try {
|
||||
val adapter =
|
||||
WebModAllInfoAdapter(this@WorkManagementActivity, data)
|
||||
adapter.setItemEvent { i, itemWebmodAllInfoBinding, viewHolder, data ->
|
||||
|
||||
itemWebmodAllInfoBinding.more.setOnClickListener {
|
||||
val popupMenu = GlobalMethod.createPopMenu(it)
|
||||
when (data.hidden) {
|
||||
0 -> {
|
||||
//上架状态
|
||||
popupMenu.menu.add(R.string.sold_out_mod)
|
||||
popupMenu.menu.add(R.string.work_of_home_page)
|
||||
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.show()
|
||||
popupMenu.setOnMenuItemClickListener {
|
||||
val title = it.title.toString()
|
||||
when (title) {
|
||||
getString(R.string.work_of_home_page) -> {
|
||||
}
|
||||
|
||||
getString(R.string.update_record) -> {
|
||||
GlobalMethod.showUpdateLog(
|
||||
this@WorkManagementActivity,
|
||||
data.id
|
||||
)
|
||||
}
|
||||
|
||||
getString(R.string.submit_the_update) -> {
|
||||
}
|
||||
|
||||
getString(R.string.sold_out_mod) -> {
|
||||
CoreDialog(this@WorkManagementActivity).setTitle(
|
||||
R.string.sold_out_mod
|
||||
).setMessage(R.string.sold_out_mod_tip)
|
||||
.setPositiveButton(R.string.dialog_ok) {
|
||||
WebMod.instance.soldOutMod(
|
||||
data.developer,
|
||||
data.id,
|
||||
object :
|
||||
ApiCallBack<ApiResponse> {
|
||||
override fun onResponse(
|
||||
t: ApiResponse
|
||||
) {
|
||||
if (t.code == ServerConfiguration.Success_Code) {
|
||||
data.hidden = -1
|
||||
adapter.notifyItemChanged(
|
||||
i
|
||||
)
|
||||
} else {
|
||||
Snackbar.make(
|
||||
viewBinding.recyclerView,
|
||||
t.message,
|
||||
Snackbar.LENGTH_SHORT
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
showInternetError(
|
||||
view = viewBinding.recyclerView,
|
||||
exception = e
|
||||
)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
.setNegativeButton(R.string.dialog_cancel) {
|
||||
|
||||
}
|
||||
.setCancelable(false).show()
|
||||
}
|
||||
|
||||
getString(R.string.review_audit) -> {
|
||||
CoreDialog(this@WorkManagementActivity).setTitle(
|
||||
R.string.review_audit
|
||||
).setMessage(
|
||||
String.format(
|
||||
getString(R.string.review_audit_mod_tip),
|
||||
data.name
|
||||
)
|
||||
).setPositiveButton(R.string.dialog_ok) {
|
||||
|
||||
}.setNegativeButton(R.string.dialog_cancel) {
|
||||
|
||||
}.setCancelable(false).show()
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
/*itemWebmodAllInfoBinding.soldOutModView.setOnClickListener {
|
||||
when (itemWebmodAllInfoBinding.soldOutModView.text.toString()) {
|
||||
getString(R.string.not_audit) -> {
|
||||
|
||||
}
|
||||
getString(R.string.review_audit) -> {
|
||||
|
||||
}
|
||||
getString(R.string.sold_out_mod) -> {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
viewBinding.textview.isVisible = false
|
||||
viewBinding.progressBar.isVisible = false
|
||||
viewBinding.recyclerView.isVisible = true
|
||||
viewBinding.recyclerView.adapter = adapter
|
||||
} catch (e: Exception) {
|
||||
showError(e.toString())
|
||||
}
|
||||
} else {
|
||||
showErrorInView(str = t.message)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(e: Exception) {
|
||||
showErrorInView(R.string.network_error)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
super.onResume()
|
||||
}
|
||||
|
||||
override fun whenCreateActivity(savedInstanceState: Bundle?, canUseView: Boolean) {
|
||||
if (canUseView) {
|
||||
title = getString(R.string.work_management)
|
||||
setReturnButton()
|
||||
viewBinding.recyclerView.layoutManager = StableLinearLayoutManager(this)
|
||||
val divider = MaterialDividerItemDecoration(
|
||||
this,
|
||||
MaterialDividerItemDecoration.VERTICAL
|
||||
)
|
||||
|
||||
viewBinding.recyclerView.addItemDecoration(
|
||||
divider
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
import android.content.Context
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import android.view.ViewGroup
|
||||
import android.view.LayoutInflater
|
||||
import com.coldmint.rust.pro.R
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.view.isVisible
|
||||
import com.coldmint.rust.pro.base.BaseAdapter
|
||||
import com.coldmint.rust.pro.databean.LibInfo
|
||||
import com.coldmint.rust.pro.databinding.ItemLibBinding
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import java.util.ArrayList
|
||||
|
||||
class LibAdapter(context: Context, dataList: ArrayList<LibInfo>) :
|
||||
BaseAdapter<ItemLibBinding, LibInfo>(context, dataList) {
|
||||
|
||||
override fun getViewBindingObject(
|
||||
layoutInflater: LayoutInflater,
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): ItemLibBinding {
|
||||
return ItemLibBinding.inflate(layoutInflater, parent, false)
|
||||
}
|
||||
|
||||
override fun onBingView(
|
||||
data: LibInfo,
|
||||
viewBinding: ItemLibBinding,
|
||||
viewHolder: BaseAdapter.ViewHolder<ItemLibBinding>,
|
||||
position: Int
|
||||
) {
|
||||
viewBinding.titleView.text = data.title
|
||||
viewBinding.descriptionView.text = data.description
|
||||
viewBinding.linkView.setOnClickListener {
|
||||
val intent = Intent()
|
||||
intent.action = "android.intent.action.VIEW"
|
||||
val content_url = Uri.parse(data.link)
|
||||
intent.data = content_url
|
||||
context.startActivity(intent)
|
||||
}
|
||||
val agreement = data.agreement
|
||||
if (agreement.isEmpty()) {
|
||||
viewBinding.agreementView.isVisible = false
|
||||
} else {
|
||||
viewBinding.agreementView.text = agreement
|
||||
}
|
||||
val tip = data.tip
|
||||
if (tip != null) {
|
||||
viewBinding.tipView.isVisible = true
|
||||
viewBinding.tipView.setOnClickListener {
|
||||
MaterialAlertDialogBuilder(context).setTitle(R.string.about).setMessage(tip)
|
||||
.setPositiveButton(R.string.close) { i, tab ->
|
||||
}.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.pro.base.BaseAdapter
|
||||
import com.coldmint.rust.pro.databean.ThanksDataBean
|
||||
import com.coldmint.rust.pro.databinding.ItemThanksBinding
|
||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2022/1/3 19:39
|
||||
*/
|
||||
class ThanksAdapter(context: Context, dataList: MutableList<ThanksDataBean>) :
|
||||
BaseAdapter<ItemThanksBinding, ThanksDataBean>(context, dataList) {
|
||||
|
||||
override fun getViewBindingObject(
|
||||
layoutInflater: LayoutInflater,
|
||||
parent: ViewGroup,
|
||||
viewType: Int
|
||||
): ItemThanksBinding {
|
||||
return ItemThanksBinding.inflate(layoutInflater, parent, false)
|
||||
}
|
||||
|
||||
override fun onBingView(
|
||||
data: ThanksDataBean,
|
||||
viewBinding: ItemThanksBinding,
|
||||
viewHolder: ViewHolder<ItemThanksBinding>,
|
||||
position: Int
|
||||
) {
|
||||
viewBinding.titleView.text = data.title
|
||||
viewBinding.descriptionView.text = data.description
|
||||
Glide.with(context).load(data.getIconLink())
|
||||
.apply(GlobalMethod.getRequestOptions(true))
|
||||
.into(viewBinding.headIconView)
|
||||
}
|
||||
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
package com.coldmint.rust.pro.databean
|
||||
|
||||
data class LibInfo
|
||||
/**
|
||||
* 构造库信息类
|
||||
*
|
||||
* @param title 标题
|
||||
* @param description 描述
|
||||
* @param link 链接
|
||||
* @param agreement 开源协议
|
||||
*/(
|
||||
/**
|
||||
* 获取标题
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val title: String,
|
||||
/**
|
||||
* 获取描述
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val description: String,
|
||||
/**
|
||||
* 获取链接
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val link: String,
|
||||
/**
|
||||
* 获取开源协议
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val agreement: String
|
||||
) {
|
||||
|
||||
/**
|
||||
* 获取提示
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 设置提示
|
||||
* @param tip
|
||||
*/
|
||||
var tip: String? = null
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.coldmint.rust.pro.databean
|
||||
|
||||
/**
|
||||
* @author Cold Mint
|
||||
* @date 2022/1/3 19:42
|
||||
*/
|
||||
data class ThanksDataBean(val title: String, val description: String, val qq: Long) {
|
||||
|
||||
//https://r.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?uins=2923268971
|
||||
/**
|
||||
* 获取qq头像链接
|
||||
* @return String
|
||||
*/
|
||||
fun getIconLink(): String {
|
||||
return "https://q1.qlogo.cn/g?b=qq&nk=${qq}&s=640"
|
||||
}
|
||||
}
|
|
@ -1,33 +1,20 @@
|
|||
package com.coldmint.rust.pro.fragments
|
||||
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.ImageView
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.bumptech.glide.Glide
|
||||
import com.coldmint.rust.core.dataBean.mod.WebModInfoData
|
||||
import com.coldmint.rust.core.dataBean.user.SpaceInfoData
|
||||
import com.coldmint.rust.core.interfaces.ApiCallBack
|
||||
import com.coldmint.rust.core.tool.LineParser
|
||||
import com.coldmint.rust.core.web.ServerConfiguration
|
||||
import com.coldmint.rust.core.web.User
|
||||
import com.coldmint.rust.core.web.WebMod
|
||||
import com.coldmint.rust.pro.R
|
||||
import com.coldmint.rust.pro.TagActivity
|
||||
import com.coldmint.rust.pro.base.BaseFragment
|
||||
import com.coldmint.rust.pro.databinding.FragmentWebModDetailsBinding
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||
import com.coldmint.rust.pro.tool.TextStyleMaker
|
||||
import com.coldmint.rust.pro.viewmodel.WebModDetailsViewModel
|
||||
import com.google.android.material.chip.Chip
|
||||
import com.youth.banner.adapter.BannerImageAdapter
|
||||
import com.youth.banner.holder.BannerImageHolder
|
||||
import com.youth.banner.indicator.CircleIndicator
|
||||
|
||||
/**
|
||||
* 模组详情碎片
|
||||
|
|
|
@ -245,20 +245,6 @@ class TextStyleMaker private constructor() {
|
|||
*/
|
||||
fun clickEvent(context: Context, type: String, data: String) {
|
||||
when (type) {
|
||||
|
||||
"tag" -> {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("tag", data)
|
||||
bundle.putString(
|
||||
"title",
|
||||
String.format(context.getString(R.string.tag_title), data)
|
||||
)
|
||||
bundle.putString("action", "tag")
|
||||
val thisIntent =
|
||||
Intent(context, TagActivity::class.java)
|
||||
thisIntent.putExtra("data", bundle)
|
||||
context.startActivity(thisIntent)
|
||||
}
|
||||
"link" -> {
|
||||
val thisIntent = Intent(context, BrowserActivity::class.java)
|
||||
thisIntent.putExtra("link", data)
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ActivateActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/libsView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -1,104 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".OrderListActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="80dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/payment_reminders" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/info" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="@string/pay_type">
|
||||
|
||||
<com.google.android.material.textfield.MaterialAutoCompleteTextView
|
||||
android:id="@+id/typeAutoCompleteTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="none"
|
||||
android:text="@string/wechat_pay"
|
||||
app:simpleItems="@array/pay_type_entries" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<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_marginTop="8dp">
|
||||
|
||||
<ImageView
|
||||
android:scaleType="centerCrop"
|
||||
android:id="@+id/baseImageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="450dp"
|
||||
android:src="@drawable/image" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/payMoneyView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/pay_tip"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/saveCode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/sava_code_and_copy_id" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ActivateActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tipView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/network_error"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -1,55 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ActivateActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tipView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/loading_data"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ActivateActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -1,60 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:card_view="http://schemas.android.com/tools"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".ActivateActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/no_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -1,60 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
style="@style/TextAppearance.Material3.TitleMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="标题" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/descriptionView"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/titleView"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="描述" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/agreementView"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/descriptionView"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="开源协议" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/linkView"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignBottom="@id/titleView"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:padding="2dp"
|
||||
android:src="@drawable/link" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tipView"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignBottom="@id/titleView"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_toEndOf="@id/titleView"
|
||||
android:src="@drawable/tip"
|
||||
android:visibility="gone"
|
||||
app:tint="?colorPrimary" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
|
@ -1,38 +0,0 @@
|
|||
<?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:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/headIconView"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:src="@drawable/head_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/mod_title"
|
||||
style="@style/TextAppearance.Material3.TitleMedium" />
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:id="@+id/descriptionView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/no_content" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/libs"
|
||||
android:title="@string/libs" />
|
||||
<item
|
||||
android:id="@+id/thanks"
|
||||
android:title="@string/special_thanks_to" />
|
||||
</menu>
|
Loading…
Reference in New Issue
Block a user