更新了代码表
This commit is contained in:
parent
36643ae2d2
commit
a2c71a5e15
|
@ -25,17 +25,14 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.rust.Concept"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:screenOrientation="portrait"
|
||||
tools:targetApi="tiramisu">
|
||||
<activity
|
||||
android:name=".FeedbackActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity" />
|
||||
<activity
|
||||
android:name=".ChangePasswordActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity" />
|
||||
<activity
|
||||
android:name=".NetworkTemplatePackageDetailsActivity"
|
||||
|
@ -141,6 +138,9 @@
|
|||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.app.shortcuts"
|
||||
android:resource="@xml/shortcuts" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ImporterActivity"
|
||||
|
@ -283,7 +283,12 @@
|
|||
android:name=".CreateTemplateActivity"/>
|
||||
<activity
|
||||
android:name=".CodeTableActivity"
|
||||
android:exported="false"/>
|
||||
android:launchMode="singleTask"
|
||||
android:icon="@drawable/table"
|
||||
android:taskAffinity="@string/code_table"
|
||||
android:documentLaunchMode="intoExisting"
|
||||
android:exported="false">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:exported="false"/>
|
||||
|
|
|
@ -13,6 +13,7 @@ import android.view.Menu
|
|||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.Toast
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.core.database.code.CodeDataBase
|
||||
|
@ -21,7 +22,6 @@ import com.coldmint.rust.core.database.code.SectionInfo
|
|||
import com.coldmint.rust.pro.adapters.CodeTableAdapter
|
||||
import com.coldmint.rust.pro.base.BaseActivity
|
||||
import com.coldmint.rust.pro.databinding.ActivityCodeTableBinding
|
||||
import com.muqing.gj
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
||||
|
@ -38,11 +38,15 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
|||
override fun beforeTextChanged(a: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
||||
}
|
||||
override fun onTextChanged(a: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
||||
if (a.isNullOrEmpty()) {
|
||||
/* if (a.isNullOrEmpty()) {
|
||||
loadData()
|
||||
return
|
||||
}
|
||||
loadData(a.toString())
|
||||
loadData(a.toString())*/
|
||||
if (a.isNullOrEmpty()) {
|
||||
viewBinding.searchPick.isVisible = false
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
override fun afterTextChanged(a: Editable?) {
|
||||
}
|
||||
|
@ -51,8 +55,16 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
|||
if (p1 == EditorInfo.IME_ACTION_SEARCH) {
|
||||
if (v?.text.isNullOrEmpty()) {
|
||||
loadData()
|
||||
}else
|
||||
loadData(v?.text.toString())
|
||||
}else{
|
||||
var toString = v?.text.toString()
|
||||
if (toString.startsWith("/")) {
|
||||
toString = toString.substring(1)
|
||||
loadData(toString)
|
||||
}else{
|
||||
viewBinding.searchPick.isVisible = true
|
||||
adapter.item?.search(toString)
|
||||
}
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
@ -86,6 +98,7 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
|||
* @param section String? 节
|
||||
*/
|
||||
fun loadData(key: String? = null, section: String? = null) {
|
||||
//如果 key start 有 / 则取后的string
|
||||
executorService.submit {
|
||||
filterMode = key != null || section != null
|
||||
val sectionMap = HashMap<String, String>()
|
||||
|
@ -175,7 +188,6 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
|||
spannableString.setSpan(
|
||||
object : ClickableSpan() {
|
||||
override fun onClick(p0: View) {
|
||||
editisVisible(false)
|
||||
loadData()
|
||||
}
|
||||
}, start, start + action.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
|
@ -195,63 +207,9 @@ class CodeTableActivity : BaseActivity<ActivityCodeTableBinding>() {
|
|||
return true
|
||||
}
|
||||
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
R.id.filter_units -> {
|
||||
if (viewBinding.edittext.isVisible) {
|
||||
if (viewBinding.edittext.text.isNullOrEmpty()) {
|
||||
loadData()
|
||||
} else {
|
||||
loadData(viewBinding.edittext.text.toString())
|
||||
}
|
||||
} else {
|
||||
editisVisible(true)
|
||||
}
|
||||
/*
|
||||
InputDialog(this).setTitle(R.string.filter).setMessage(R.string.filter_tip)
|
||||
.setInputCanBeEmpty(false).setMaxNumber(20)
|
||||
.setPositiveButton(R.string.dialog_ok) { text ->
|
||||
var key = text
|
||||
if (key.length > 20) {
|
||||
key = key.substring(0, 20)
|
||||
}
|
||||
loadData(key)
|
||||
true
|
||||
}.setNegativeButton(R.string.dialog_close) {
|
||||
|
||||
}.show()*/
|
||||
}
|
||||
|
||||
android.R.id.home -> {
|
||||
if (viewBinding.edittext.isVisible) {
|
||||
editisVisible(false)
|
||||
return true
|
||||
}
|
||||
ifNeedFinish()
|
||||
return true
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
private fun editisVisible(b: Boolean) {
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onBackPressed() {
|
||||
if (viewBinding.expandableListView.adapter !is CodeTableAdapter) {
|
||||
viewBinding.expandableListView.adapter = adapter
|
||||
return
|
||||
}
|
||||
if (viewBinding.edittext.text.isNotEmpty()) {
|
||||
viewBinding.edittext.setText("")
|
||||
gj.ycjp(viewBinding.edittext)
|
||||
} else {
|
||||
gj.tcjp(viewBinding.edittext)
|
||||
finish()
|
||||
// ifNeedFinish()
|
||||
}
|
||||
}
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): ActivityCodeTableBinding {
|
||||
return ActivityCodeTableBinding.inflate(layoutInflater)
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.ShortcutInfo
|
||||
import android.content.pm.ShortcutManager
|
||||
import android.graphics.drawable.Icon
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
|
@ -42,6 +47,7 @@ import com.google.android.material.snackbar.Snackbar
|
|||
import com.google.gson.Gson
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import java.util.Arrays
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.zip.ZipEntry
|
||||
|
||||
|
@ -300,7 +306,34 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||
}*/
|
||||
|
||||
codeTable.setOnMenuItemClickListener {
|
||||
startActivity(Intent(this@MainActivity, CodeTableActivity::class.java))
|
||||
/* // 获取上下文,通常是Activity的this或者Application的getApplicationContext()
|
||||
val context: Context = this@MainActivity // 假设在Activity内部
|
||||
// 创建Intent,指定目标Activity
|
||||
val shortcutIntent = Intent(context, CodeTableActivity::class.java)
|
||||
shortcutIntent.setAction("com.coldmint.rust.pro.ACTION_CODE_TABLE") // 自定义Action,可选
|
||||
shortcutIntent.putExtra("extra", "value") // 可选的额外数据
|
||||
// 添加标志,确保快捷方式启动新任务
|
||||
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT)
|
||||
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
||||
// 构建ShortcutInfo
|
||||
val info = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
|
||||
ShortcutInfo.Builder(context, "code_table_shortcut_id")
|
||||
.setShortLabel(context.getString(com.coldmint.rust.pro.R.string.code_table))
|
||||
.setLongLabel(context.getString(com.coldmint.rust.pro.R.string.code_table))
|
||||
.setIcon(Icon.createWithResource(context, com.coldmint.rust.pro.R.drawable.table))
|
||||
.setIntent(shortcutIntent)
|
||||
.build()
|
||||
} else {
|
||||
TODO("VERSION.SDK_INT < N_MR1")
|
||||
}
|
||||
// 获取ShortcutManager
|
||||
val shortcutManager: ShortcutManager = context.getSystemService(ShortcutManager::class.java)
|
||||
// 添加动态快捷方式
|
||||
shortcutManager.addDynamicShortcuts(listOf(info))*/
|
||||
val intent = Intent(this@MainActivity, CodeTableActivity::class.java)
|
||||
/* intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT)*/
|
||||
startActivity(intent)
|
||||
false
|
||||
}
|
||||
/*重要部分
|
||||
|
|
|
@ -5,11 +5,17 @@ import android.content.Context
|
|||
import android.graphics.Color
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.Spanned
|
||||
import android.text.style.BackgroundColorSpan
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.coldmint.rust.core.database.code.CodeDataBase
|
||||
|
@ -19,10 +25,11 @@ import com.coldmint.rust.core.tool.LineParser
|
|||
import com.coldmint.rust.pro.R
|
||||
import com.coldmint.rust.pro.databinding.CodeTableItemBinding
|
||||
import com.coldmint.rust.pro.databinding.ItemCodetableBinding
|
||||
import com.coldmint.rust.pro.dialog.MaterialBottomDialog
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.pro.tool.GlobalMethod
|
||||
import com.google.android.gms.common.internal.Objects
|
||||
import com.google.android.material.chip.Chip
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.muqing.VH
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
|
@ -204,7 +211,13 @@ class CodeTableAdapter(
|
|||
lineParser.symbol = ","
|
||||
}
|
||||
|
||||
var i: Int = -1
|
||||
companion object {
|
||||
var i: String = null.toString()
|
||||
var pick: Int = -1
|
||||
var pickString: String = ""
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
override fun onBindViewHolder(holder: VH<ItemCodetableBinding>, position: Int) {
|
||||
holder.binging.title.text = group[position].translate
|
||||
|
@ -214,19 +227,14 @@ class CodeTableAdapter(
|
|||
)
|
||||
holder.binging.message.text = format
|
||||
holder.itemView.setOnClickListener {
|
||||
val p: Int = holder.absoluteAdapterPosition
|
||||
i = if (i == p) {
|
||||
-1
|
||||
} else {
|
||||
p
|
||||
}
|
||||
recyclerView.adapter = ITEM(itemList[position])
|
||||
i = group[position].translate
|
||||
item = ITEM(itemList[position])
|
||||
recyclerView.adapter = item
|
||||
notifyDataSetChanged()
|
||||
// notifyItemChanged(p)
|
||||
}
|
||||
if (i == position) {
|
||||
if (Objects.equal(group[position].translate, i)) {
|
||||
//背景高亮
|
||||
//
|
||||
holder.binging.root.setCardBackgroundColor(ContextCompat.getColor(context, R.color.md_theme_dark_onSecondaryContainer))
|
||||
} else {
|
||||
//背景恢复
|
||||
|
@ -234,8 +242,26 @@ class CodeTableAdapter(
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
var item: ITEM? = null
|
||||
|
||||
inner class ITEM(val list: List<CodeInfo>) : RecyclerView.Adapter<VH<CodeTableItemBinding>>() {
|
||||
|
||||
//在list查找是否有这个关键字
|
||||
fun search(keyword: String) {
|
||||
pickString = keyword
|
||||
for (i in list.indices) {
|
||||
if (list[i].translate.contains(keyword) || list[i].description.contains(keyword) || list[i].code.contains(keyword)) {
|
||||
//找到后列表定位 到顶部
|
||||
pick = i
|
||||
(recyclerView.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(i, 0)
|
||||
notifyDataSetChanged()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH<CodeTableItemBinding> {
|
||||
return VH(CodeTableItemBinding.inflate(LayoutInflater.from(parent.context), parent, false))
|
||||
}
|
||||
|
@ -244,34 +270,57 @@ class CodeTableAdapter(
|
|||
return list.size
|
||||
}
|
||||
|
||||
private fun contains(string: String, textView: TextView) {
|
||||
if (string.contains(pickString)) {
|
||||
val spannableText = SpannableStringBuilder(string)
|
||||
val highlightWord = pickString
|
||||
val start = string.indexOf(highlightWord)
|
||||
val end = start + highlightWord.length
|
||||
if (start != -1) {
|
||||
// 设置文字颜色
|
||||
val colorSpan = ForegroundColorSpan(Color.RED)
|
||||
spannableText.setSpan(colorSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
// 设置背景颜色
|
||||
val backgroundSpan = BackgroundColorSpan(Color.YELLOW)
|
||||
spannableText.setSpan(backgroundSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
}
|
||||
textView.text = spannableText
|
||||
} else {
|
||||
textView.text = string
|
||||
}
|
||||
com.muqing.gj.sc(pickString)
|
||||
}
|
||||
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
override fun onBindViewHolder(holder: VH<CodeTableItemBinding>, position: Int) {
|
||||
val resultView: CodeTableItemBinding = holder.binging
|
||||
val codeInfo = list[position]
|
||||
resultView.descriptionView.text = codeInfo.description
|
||||
|
||||
contains(codeInfo.description, resultView.descriptionView)
|
||||
resultView.descriptionView.setOnClickListener {
|
||||
GlobalMethod.copyText(it.context, codeInfo.description, it)
|
||||
}
|
||||
resultView.titleView.text = codeInfo.translate
|
||||
|
||||
contains(codeInfo.translate, resultView.titleView)
|
||||
resultView.titleView.setOnClickListener {
|
||||
GlobalMethod.copyText(it.context, codeInfo.translate, it)
|
||||
}
|
||||
val demo = codeInfo.demo
|
||||
resultView.imageView.isVisible = demo.isNotBlank()
|
||||
resultView.imageView.setOnClickListener {
|
||||
val dialog = MaterialAlertDialogBuilder(it.context)
|
||||
dialog.setTitle(R.string.code_demo)
|
||||
dialog.setMessage(demo)
|
||||
dialog.setPositiveButton(R.string.dialog_ok, null)
|
||||
dialog.show()
|
||||
val materialBottomDialog = MaterialBottomDialog(it.context)
|
||||
materialBottomDialog.setTitle(R.string.code_demo)
|
||||
materialBottomDialog.setMessage(demo)
|
||||
materialBottomDialog.show()
|
||||
}
|
||||
|
||||
resultView.subTitleView.text = codeInfo.code
|
||||
contains(codeInfo.code, resultView.subTitleView)
|
||||
resultView.subTitleView.setOnClickListener {
|
||||
GlobalMethod.copyText(it.context, codeInfo.code, it)
|
||||
}
|
||||
resultView.valueTypeView.text = typeNameMap?.get(codeInfo.type) ?: codeInfo.type
|
||||
lineParser.text = codeInfo.section
|
||||
|
||||
// resultView.chipGroup.removeAllViews()
|
||||
var isNotEmpty = false
|
||||
lineParser.analyse { lineNum, lineData, isEnd ->
|
||||
|
@ -292,6 +341,7 @@ class CodeTableAdapter(
|
|||
executorService.submit {
|
||||
val codeDataBase = CodeDataBase.getInstance(context)
|
||||
val typeInfo = codeDataBase.getValueTypeDao().findTypeByType(codeInfo.type)
|
||||
|
||||
if (typeInfo == null) {
|
||||
handler.post {
|
||||
handler.post {
|
||||
|
@ -350,6 +400,8 @@ class CodeTableAdapter(
|
|||
}
|
||||
resultView.versionView.text =
|
||||
versionMap?.get(codeInfo.addVersion) ?: codeInfo.addVersion.toString()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,14 +37,13 @@ class DesignAdapter(private val onclick: Click) : RecyclerView.Adapter<VH<ItemTa
|
|||
|
||||
if (string == list[position]) {
|
||||
holder.binging.root.isEnabled = false
|
||||
holder.binging.root.setCardBackgroundColor(ContextCompat.getColor(holder.itemView.context, R.color.material_grey_200))
|
||||
} else {
|
||||
holder.binging.root.isEnabled = true
|
||||
val typedValue = TypedValue()
|
||||
holder.itemView.context.theme.resolveAttribute(R.attr.colorPrimaryContainer, typedValue, true)
|
||||
val colorPrimary = typedValue.data
|
||||
holder.binging.root.setCardBackgroundColor(colorPrimary)
|
||||
|
||||
} else {
|
||||
holder.binging.root.isEnabled = true
|
||||
holder.binging.root.setCardBackgroundColor(ContextCompat.getColor(holder.itemView.context, R.color.material_grey_200))
|
||||
}
|
||||
holder.binging.root.setOnClickListener {
|
||||
string = list[holder.absoluteAdapterPosition]
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
package com.coldmint.rust.pro.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import com.coldmint.rust.pro.R
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||
|
||||
class MaterialBottomDialog(context: Context) : BottomSheetDialog(context) {
|
||||
init {
|
||||
setContentView(R.layout.dialog_bottom)
|
||||
}
|
||||
|
||||
fun setMessage(string: String) {
|
||||
val findViewById = findViewById<TextView>(R.id.message)
|
||||
findViewById?.text = string
|
||||
}
|
||||
fun setTitle(string: String) {
|
||||
val findViewById = findViewById<TextView>(R.id.title)
|
||||
findViewById?.text = string
|
||||
}
|
||||
|
||||
override fun setTitle(titleId: Int) {
|
||||
super.setTitle(titleId)
|
||||
val string = context.getString(titleId)
|
||||
delegate.setTitle(string)
|
||||
val findViewById = findViewById<TextView>(R.id.title)
|
||||
findViewById?.text = string
|
||||
}
|
||||
}
|
|
@ -14,44 +14,74 @@
|
|||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/materialCardView"
|
||||
style="?attr/materialCardViewElevatedStyle"
|
||||
style="@style/Widget.Material3.CardView.Elevated"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_margin="12dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:gravity="center">
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/md_nav_back"
|
||||
android:tint="?android:attr/colorForeground"
|
||||
tools:ignore="ContentDescription" />
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:gravity="center">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edittext"
|
||||
android:layout_width="0dp"
|
||||
<ImageView
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/md_nav_back"
|
||||
android:tint="?android:attr/colorForeground"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edittext"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:autofillHints="text"
|
||||
android:background="@null"
|
||||
android:drawableEnd="@drawable/ic_search_black_24dp"
|
||||
android:hint="@string/search"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
android:minHeight="48dp"
|
||||
android:padding="10dp"
|
||||
android:singleLine="true"
|
||||
tools:ignore="TextContrastCheck,VisualLintTextFieldSize" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/search_pick"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:autofillHints="text"
|
||||
android:background="@null"
|
||||
android:drawableEnd="@drawable/ic_search_black_24dp"
|
||||
android:hint="@string/search"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
android:minHeight="48dp"
|
||||
android:padding="10dp"
|
||||
android:singleLine="true"
|
||||
tools:ignore="TextContrastCheck,VisualLintTextFieldSize" />
|
||||
android:layout_marginHorizontal="6dp"
|
||||
android:gravity="end"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:padding="9dp"
|
||||
android:src="@drawable/animator_expand_on" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="9dp"
|
||||
android:src="@drawable/animator_expand_off" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
@ -103,7 +133,8 @@
|
|||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="9dp"/>
|
||||
android:layout_marginHorizontal="3dp"
|
||||
android:layout_marginVertical="3dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/code_recycler_b"
|
||||
|
|
42
app/src/main/res/layout/dialog_bottom.xml
Normal file
42
app/src/main/res/layout/dialog_bottom.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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">
|
||||
<!-- Drag handle for accessibility -->
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:id="@+id/drag_handle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="9dp"
|
||||
android:layout_marginBottom="26dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drag_handle">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/TextAppearance.Material3.TitleLarge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World!" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="Hello World!" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -27,7 +27,7 @@
|
|||
android:id="@+id/imageview"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:src="@drawable/visibility" />
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
16
app/src/main/res/xml-v25/shortcuts.xml
Normal file
16
app/src/main/res/xml-v25/shortcuts.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shortcut
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/table"
|
||||
android:shortcutDisabledMessage="@string/code_table"
|
||||
android:shortcutId="id1"
|
||||
android:shortcutLongLabel="@string/code_table"
|
||||
android:shortcutShortLabel="@string/code_table">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetClass="com.coldmint.rust.pro.CodeTableActivity"
|
||||
android:targetPackage="com.coldmint.rust.pro" />
|
||||
<categories android:name="android.shortcut.conversation" />
|
||||
</shortcut>
|
||||
</shortcuts>
|
|
@ -18,7 +18,6 @@ abstract class BaseBottomDialog<ViewBindingType : ViewBinding>(val context: Cont
|
|||
|
||||
protected val bottomSheetDialog: BottomSheetDialog by lazy {
|
||||
BottomSheetDialog(context)
|
||||
|
||||
}
|
||||
|
||||
protected val layoutInflater by lazy {
|
||||
|
|
Loading…
Reference in New Issue
Block a user