1
0
mirror of https://github.com/fumiama/simple-dict-android.git synced 2026-06-09 04:29:50 +08:00
This commit is contained in:
fumiama
2021-03-11 23:28:46 +08:00
parent 1367c96d0d
commit 750f071e1f
8 changed files with 40 additions and 57 deletions

View File

@@ -166,6 +166,7 @@ class MainActivity : AppCompatActivity() {
delKey.setSpan(StrikethroughSpan(), 0, key.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
delData.setSpan(StrikethroughSpan(), 0, (data?.length?:0), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
ta.text = delKey
tn.text = delKey
tb.text = delData
}
}.start()
@@ -228,6 +229,7 @@ class MainActivity : AppCompatActivity() {
Log.d("MyMain", "Like status of $key is $like")
holder.itemView.apply {
runOnUiThread {
tn.text = key
ta.text = key
tb.text = data
vl.setBackgroundResource(if(like) R.drawable.ic_like_filled else R.drawable.ic_like)

Binary file not shown.

View File

@@ -12,25 +12,35 @@
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="10dp"
android:fontFamily="@font/nisi"
android:textColor="?attr/colorOnSurface"
android:textSize="30sp"
android:textStyle="bold" />
<TextView
android:id="@+id/ta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:fontFamily="@font/gotham"
android:textColor="?attr/colorOnSurface"
android:textSize="22sp" />
android:textSize="18sp" />
<TextView
android:id="@+id/tb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp" />
android:layout_marginBottom="10dp" />
</LinearLayout>
<View