mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Trying to update map style menu
This commit is contained in:
parent
42cba353fa
commit
e22c7f8c35
4 changed files with 109 additions and 6 deletions
39
app/src/main/java/com/geeksville/mesh/ui/MapStyleAdapter.kt
Normal file
39
app/src/main/java/com/geeksville/mesh/ui/MapStyleAdapter.kt
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
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
|
||||
|
||||
|
||||
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 {
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
val mapStyleMenuBinding = AdapterMapStyleMenuBinding.inflate(inflater, parent, false)
|
||||
return MapStyleAdapter(mapStyleMenuBinding)
|
||||
}
|
||||
|
||||
fun onBindViewHolder(holder: MyView, position: Int) {
|
||||
holder.textView.text = list[position]
|
||||
}
|
||||
|
||||
fun getItemCount(): Int {
|
||||
return list.size
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue