diff --git a/app/src/main/java/net/helcel/beendroid/activity/FoldingListAdapter.kt b/app/src/main/java/net/helcel/beendroid/activity/FoldingListAdapter.kt index c7cca73..42f4914 100644 --- a/app/src/main/java/net/helcel/beendroid/activity/FoldingListAdapter.kt +++ b/app/src/main/java/net/helcel/beendroid/activity/FoldingListAdapter.kt @@ -1,6 +1,7 @@ package net.helcel.beendroid.activity import android.content.Context +import android.graphics.Typeface import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -12,6 +13,7 @@ import androidx.recyclerview.widget.RecyclerView import com.google.android.material.checkbox.MaterialCheckBox import net.helcel.beendroid.R import net.helcel.beendroid.countries.GeoLoc +import net.helcel.beendroid.countries.LocType import net.helcel.beendroid.countries.Visited import java.util.* @@ -79,11 +81,14 @@ class FoldingListAdapter( fun bind(el: Pair, parentLambda: () -> Unit) { expand.rotation = if(el.second) 90f else 0f subItemView.visibility = if (el.second) View.VISIBLE else View.GONE - expand.visibility = if(!el.first.isEnd) View.VISIBLE else View.GONE + expand.visibility = if(!el.first.isEnd) View.VISIBLE else View.INVISIBLE textView.text = el.first.fullName + if (el.first.type == LocType.GROUP) { + textView.setTypeface(null, Typeface.BOLD) + } checkBox.checkedState = - if(visited.visited(el.first)) MaterialCheckBox.STATE_CHECKED + if (visited.visited(el.first)) MaterialCheckBox.STATE_CHECKED else if (el.first.children.any { visited.visited(it) }) MaterialCheckBox.STATE_INDETERMINATE else MaterialCheckBox.STATE_UNCHECKED @@ -93,12 +98,12 @@ class FoldingListAdapter( fun addListeners(expandLambda: ()->Boolean, visitedLambda: (Boolean)->Unit) { - textView.setOnClickListener { checkBox.toggle() } + textView.setOnClickListener { expandLambda() } checkBox.addOnCheckedStateChangedListener { _, e -> visitedLambda(e == MaterialCheckBox.STATE_CHECKED) } - textView.setOnLongClickListener{ expandLambda() } + //textView.setOnLongClickListener{ checkBox.toggle(); true } expand.setOnClickListener { expandLambda() } } diff --git a/app/src/main/res/drawable/edit.xml b/app/src/main/res/drawable/edit.xml new file mode 100644 index 0000000..a4df5f3 --- /dev/null +++ b/app/src/main/res/drawable/edit.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index ea24711..30c760d 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -5,7 +5,48 @@ android:layout_width="fill_parent" android:layout_height="fill_parent"> - + + + + + + + + + + + + + + + - - - Beendroid + BeenDroid Settings Welcome!