mirror of
https://github.com/fumiama/simple-dict-android.git
synced 2026-06-05 00:30:24 +08:00
v5.0.2
设置添加“不显示Nisi”选项
This commit is contained in:
@@ -10,8 +10,8 @@ android {
|
||||
applicationId "top.fumiama.simpledict"
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 34
|
||||
versionCode 21
|
||||
versionName '5.0.1'
|
||||
versionCode 22
|
||||
versionName '5.0.2'
|
||||
resConfigs "zh", "zh-rCN"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -44,6 +44,7 @@ class MainActivity : AppCompatActivity() {
|
||||
private var spwd: String? = null
|
||||
private var dict: SimpleDict? = null
|
||||
private var cm: ClipboardManager? = null
|
||||
private var noShowNisi = false
|
||||
private var mViewPagerPosition = 0
|
||||
private val mControlBarStates = arrayOf(ControlBarState(visibleThreshold+8), ControlBarState(visibleThreshold+8))
|
||||
private val mVPAdapter get() = fmvp.adapter as MainFragment.PagerAdapter
|
||||
@@ -58,7 +59,9 @@ class MainActivity : AppCompatActivity() {
|
||||
if(contains("port")) getInt("port", port).apply { port = this }
|
||||
if(contains("pwd")) getString("pwd", pwd)?.apply { pwd = this }
|
||||
if(contains("spwd")) getString("spwd", spwd)?.apply { spwd = this }
|
||||
if(contains("noNisi")) getBoolean("noNisi", noShowNisi).apply { noShowNisi = this }
|
||||
}
|
||||
Log.d("MyMain", "noNisi: $noShowNisi")
|
||||
dict = SimpleDict(Client(host, port), pwd, externalCacheDir, spwd)
|
||||
|
||||
cm = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
@@ -164,6 +167,7 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
putString("pwd", w)
|
||||
putBoolean("noNisi", t.dis.isChecked)
|
||||
apply()
|
||||
Toast.makeText(this@MainActivity, R.string.toast_take_effect_next_time, Toast.LENGTH_SHORT).show()
|
||||
return@setPositiveButton
|
||||
@@ -422,8 +426,10 @@ class MainActivity : AppCompatActivity() {
|
||||
//Log.d("MyMain", "Like status of $key is $like")
|
||||
holder.itemView.apply {
|
||||
runOnUiThread {
|
||||
ta.visibility = View.VISIBLE
|
||||
tn.text = key
|
||||
if (!noShowNisi) {
|
||||
tn.visibility = View.VISIBLE
|
||||
tn.text = key
|
||||
}
|
||||
ta.text = key
|
||||
tb.text = data
|
||||
vl.setBackgroundResource(if(like) R.drawable.ic_like_filled else R.drawable.ic_like)
|
||||
|
||||
@@ -42,6 +42,14 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Switch
|
||||
android:id="@+id/dis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/alert_input_no_show_nisi"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/dit" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/diet"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -11,26 +11,27 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:fontFamily="@font/nisi"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold" />
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ta"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:fontFamily="@font/gotham"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textSize="18sp" />
|
||||
@@ -38,10 +39,7 @@
|
||||
<TextView
|
||||
android:id="@+id/tb"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="10dp" />
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
@@ -50,9 +48,9 @@
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/desc_image_like"
|
||||
android:focusable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/desc_image_like"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<string name="alert_word_button_reset">重设</string>
|
||||
<string name="alert_word_button_new">添加</string>
|
||||
<string name="alert_word_button_delete">删除</string>
|
||||
<string name="alert_input_no_show_nisi">不显示Nisi</string>
|
||||
|
||||
<string name="tab_all_words">zenbi</string>
|
||||
<string name="tab_liked_words">eujuno</string>
|
||||
|
||||
Reference in New Issue
Block a user