working on menu changes

This commit is contained in:
PWRxPSYCHO 2022-10-19 09:38:07 -04:00
parent ee388db491
commit acc529f53f
4 changed files with 69 additions and 71 deletions

View file

@ -1,39 +1,43 @@
package com.geeksville.mesh.ui
import android.R
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.geeksville.mesh.databinding.AdapterMapStyleMenuBinding
import com.geeksville.mesh.databinding.AdapterMapMenuSelectionBinding
class MapStyleAdapter(itemView: AdapterMapMenuSelectionBinding) :
RecyclerView.ViewHolder(itemView.root) {
val card = itemView.cardview
val text = itemView.textview1
}
class MapStyleAdapter(itemView: AdapterMapStyleMenuBinding) {
var list = mutableListOf<String>()
inner class MyView(view: View) : RecyclerView.ViewHolder(view) {
var textView: TextView
init {
textView = view.findViewById<View>(R.id.text1) as TextView
}
}
fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
): MapStyleAdapter {
private val mapStyleAdapater = object : RecyclerView.Adapter<MapStyleAdapter>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MapStyleAdapter {
val inflater = LayoutInflater.from(parent.context)
val mapStyleMenuBinding = AdapterMapStyleMenuBinding.inflate(inflater, parent, false)
return MapStyleAdapter(mapStyleMenuBinding)
val mapMenuBinding = AdapterMapMenuSelectionBinding.inflate(inflater, parent, false)
return MapStyleAdapter(mapMenuBinding)
}
fun onBindViewHolder(holder: MyView, position: Int) {
holder.textView.text = list[position]
override fun onBindViewHolder(holder: MapStyleAdapter, position: Int) {
TODO("Not yet implemented")
}
fun getItemCount(): Int {
return list.size
val list = listOf<String>()
override fun getItemCount() = list.size
}
private val mapLayerAdapater = object : RecyclerView.Adapter<MapStyleAdapter>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MapStyleAdapter {
val inflater = LayoutInflater.from(parent.context)
val mapMenuBinding = AdapterMapMenuSelectionBinding.inflate(inflater, parent, false)
return MapStyleAdapter(mapMenuBinding)
}
override fun onBindViewHolder(holder: MapStyleAdapter, position: Int) {
TODO("Not yet implemented")
}
val list = listOf<String>()
override fun getItemCount() = list.size
}

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBaseline_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Map Type"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colourGrey" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mapTypeRecyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Map Layer"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colourGrey" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mapLayerRecyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintBaseline_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Map Type"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colourGrey" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mapTypeRecyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="horizontal" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Map Layer"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/colourGrey" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/mapLayerRecyclerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</LinearLayout>