diff --git a/app/src/main/java/net/helcel/beendroid/activity/adapter/GeolocListAdapter.kt b/app/src/main/java/net/helcel/beendroid/activity/adapter/GeolocListAdapter.kt index f3f5b5d..0381eb9 100644 --- a/app/src/main/java/net/helcel/beendroid/activity/adapter/GeolocListAdapter.kt +++ b/app/src/main/java/net/helcel/beendroid/activity/adapter/GeolocListAdapter.kt @@ -11,7 +11,6 @@ import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.google.android.material.checkbox.MaterialCheckBox -import com.google.android.material.checkbox.MaterialCheckBox.CheckedState import net.helcel.beendroid.R import net.helcel.beendroid.activity.fragment.EditPlaceColorFragment import net.helcel.beendroid.countries.GeoLoc @@ -69,16 +68,12 @@ class GeolocListAdapter( textView.text = el.first.fullName if (el.first.children.isEmpty()) { - - textView.backgroundTintList = null - textView.background = colorWrapper(ctx, android.R.attr.colorBackground) - textView.isActivated = false - }else { + textView.backgroundTintList = ColorStateList.valueOf(colorWrapper(ctx, android.R.attr.colorBackground).color) + } else { 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.background.alpha = 128 + textView.backgroundTintList = ColorStateList.valueOf(colorWrapper(ctx, android.R.attr.panelColorBackground).color).withAlpha(128) list.adapter = GeolocListAdapter(ctx, el.first.children) textView.parent.parent.requestChildFocus(textView, textView) diff --git a/app/src/main/res/drawable/edit.xml b/app/src/main/res/drawable/edit.xml index 5cd1ea2..c4b2d4b 100644 --- a/app/src/main/res/drawable/edit.xml +++ b/app/src/main/res/drawable/edit.xml @@ -5,6 +5,6 @@ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> diff --git a/app/src/main/res/layout/item_list_geoloc.xml b/app/src/main/res/layout/item_list_geoloc.xml index 507ff44..d88456e 100644 --- a/app/src/main/res/layout/item_list_geoloc.xml +++ b/app/src/main/res/layout/item_list_geoloc.xml @@ -32,6 +32,9 @@ android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="50dp" + android:gravity="start|center_vertical" + android:paddingStart="20dp" + android:paddingEnd="20dp" app:layout_constraintBottom_toBottomOf="@id/checkBox" app:layout_constraintEnd_toStartOf="@id/checkBox" app:layout_constraintTop_toTopOf="parent" />