Improve experience with editing places
- Use background tints for buttons - Display margins around stats - Correct bug not accounting for negative group id's in stats
This commit is contained in:
parent
f772ba0fb5
commit
01020bdc5c
@ -11,7 +11,6 @@ import androidx.fragment.app.FragmentActivity
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.google.android.material.checkbox.MaterialCheckBox
|
import com.google.android.material.checkbox.MaterialCheckBox
|
||||||
import com.google.android.material.checkbox.MaterialCheckBox.CheckedState
|
|
||||||
import net.helcel.beendroid.R
|
import net.helcel.beendroid.R
|
||||||
import net.helcel.beendroid.activity.fragment.EditPlaceColorFragment
|
import net.helcel.beendroid.activity.fragment.EditPlaceColorFragment
|
||||||
import net.helcel.beendroid.countries.GeoLoc
|
import net.helcel.beendroid.countries.GeoLoc
|
||||||
@ -69,16 +68,12 @@ class GeolocListAdapter(
|
|||||||
|
|
||||||
textView.text = el.first.fullName
|
textView.text = el.first.fullName
|
||||||
if (el.first.children.isEmpty()) {
|
if (el.first.children.isEmpty()) {
|
||||||
|
textView.backgroundTintList = ColorStateList.valueOf(colorWrapper(ctx, android.R.attr.colorBackground).color)
|
||||||
textView.backgroundTintList = null
|
|
||||||
textView.background = colorWrapper(ctx, android.R.attr.colorBackground)
|
|
||||||
textView.isActivated = false
|
|
||||||
} else {
|
} else {
|
||||||
textView.setTypeface(null, Typeface.BOLD)
|
textView.setTypeface(null, Typeface.BOLD)
|
||||||
progressView.text = ctx.getString(R.string.rate,(el.first.children.map { visits!!.getVisited(it)>0 }.count { it }),el.first.children.size)
|
progressView.text = ctx.getString(R.string.rate,(el.first.children.map { visits!!.getVisited(it) != 0 }.count { it }), el.first.children.size)
|
||||||
|
|
||||||
textView.background = colorWrapper(ctx, android.R.attr.panelColorBackground)
|
textView.backgroundTintList = ColorStateList.valueOf(colorWrapper(ctx, android.R.attr.panelColorBackground).color).withAlpha(128)
|
||||||
textView.background.alpha = 128
|
|
||||||
|
|
||||||
list.adapter = GeolocListAdapter(ctx, el.first.children)
|
list.adapter = GeolocListAdapter(ctx, el.first.children)
|
||||||
textView.parent.parent.requestChildFocus(textView, textView)
|
textView.parent.parent.requestChildFocus(textView, textView)
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@color/white"
|
android:fillColor="?attr/colorOnBackground"
|
||||||
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
|
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
android:id="@+id/name"
|
android:id="@+id/name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
|
android:gravity="start|center_vertical"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/checkBox"
|
app:layout_constraintBottom_toBottomOf="@id/checkBox"
|
||||||
app:layout_constraintEnd_toStartOf="@id/checkBox"
|
app:layout_constraintEnd_toStartOf="@id/checkBox"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user