lets make the history items a bit nicer

This commit is contained in:
tibbi
2022-03-21 22:22:34 +01:00
parent af7204acd1
commit 7952075862
2 changed files with 6 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ class HistoryAdapter(val activity: SimpleActivity, val items: List<History>, val
fun bindView(item: History): View { fun bindView(item: History): View {
itemView.apply { itemView.apply {
item_formula.text = item.formula item_formula.text = item.formula
item_result.text = "= ${item.result}" item_result.text = item.result
item_formula.setTextColor(textColor) item_formula.setTextColor(textColor)
item_result.setTextColor(textColor) item_result.setTextColor(textColor)
@@ -40,6 +40,7 @@ class HistoryAdapter(val activity: SimpleActivity, val items: List<History>, val
calc.addNumberToFormula(item.result) calc.addNumberToFormula(item.result)
itemClick() itemClick()
} }
setOnLongClickListener { setOnLongClickListener {
activity.baseContext.copyToClipboard(item.result) activity.baseContext.copyToClipboard(item.result)
true true

View File

@@ -15,10 +15,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/medium_margin" android:layout_marginEnd="@dimen/medium_margin"
android:alpha="0.8"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:paddingStart="@dimen/small_margin" android:paddingStart="@dimen/small_margin"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/bigger_text_size"
tools:text="2 + 2" /> tools:text="2 + 2" />
<TextView <TextView
@@ -30,7 +31,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:paddingStart="@dimen/small_margin" android:paddingStart="@dimen/small_margin"
android:textSize="@dimen/normal_text_size" android:textSize="@dimen/big_text_size"
tools:text="= 4" /> tools:text="4" />
</RelativeLayout> </RelativeLayout>