Add different background for top unit in converter for visibility
This commit is contained in:
parent
bbf6ba12c6
commit
619b2660d3
|
@ -14,9 +14,7 @@ import com.simplemobiletools.calculator.helpers.DOT
|
|||
import com.simplemobiletools.calculator.helpers.NumberFormatHelper
|
||||
import com.simplemobiletools.calculator.helpers.converters.Converter
|
||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
||||
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.models.RadioItem
|
||||
import me.grantland.widget.AutofitHelper
|
||||
import kotlin.reflect.KMutableProperty0
|
||||
|
@ -46,8 +44,8 @@ class ConverterView @JvmOverloads constructor(
|
|||
|
||||
binding.swapButton.setOnClickListener { switch() }
|
||||
|
||||
binding.topUnitName.setClickListenerForUnitSelector(::topUnit, ::bottomUnit)
|
||||
binding.bottomUnitName.setClickListenerForUnitSelector(::bottomUnit, ::topUnit)
|
||||
binding.topUnitHolder.setClickListenerForUnitSelector(::topUnit, ::bottomUnit)
|
||||
binding.bottomUnitHolder.setClickListenerForUnitSelector(::bottomUnit, ::topUnit)
|
||||
|
||||
updateColors()
|
||||
}
|
||||
|
@ -75,6 +73,7 @@ class ConverterView @JvmOverloads constructor(
|
|||
binding.bottomUnitName,
|
||||
ColorStateList.valueOf(context.getProperPrimaryColor())
|
||||
)
|
||||
binding.topUnitHolder.setBackgroundColor(context.getProperBackgroundColor().lightenColor())
|
||||
|
||||
binding.swapButton.applyColorFilter(context.getProperPrimaryColor())
|
||||
}
|
||||
|
|
|
@ -5,6 +5,14 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top_unit_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="3">
|
||||
<TextView
|
||||
android:id="@+id/top_unit_name"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -24,6 +32,7 @@
|
|||
android:textAlignment="viewEnd"
|
||||
android:layout_weight="2"
|
||||
android:textSize="@dimen/display_text_size" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/swap_button"
|
||||
|
@ -35,6 +44,14 @@
|
|||
android:layout_weight="0.5"
|
||||
android:src="@drawable/ic_swap_vertical_vector" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_unit_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="@dimen/activity_margin"
|
||||
android:paddingEnd="@dimen/activity_margin"
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="3">
|
||||
<TextView
|
||||
android:id="@+id/bottom_unit_name"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -54,5 +71,6 @@
|
|||
android:textAlignment="viewEnd"
|
||||
android:layout_weight="2"
|
||||
android:textSize="@dimen/display_text_size" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.simplemobiletools.calculator.views.ConverterView>
|
||||
|
|
Loading…
Reference in New Issue