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