mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
lets make the history items a bit nicer
This commit is contained in:
@@ -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
|
||||||
|
@@ -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>
|
||||||
|
Reference in New Issue
Block a user