|
|
|
@ -1,13 +1,13 @@
|
|
|
|
package com.cyb3rko.techniklogger
|
|
|
|
package com.cyb3rko.techniklogger.fragments
|
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
|
import android.annotation.SuppressLint
|
|
|
|
|
|
|
|
import android.content.Context
|
|
|
|
import android.content.SharedPreferences
|
|
|
|
import android.content.SharedPreferences
|
|
|
|
import android.os.Bundle
|
|
|
|
import android.os.Bundle
|
|
|
|
import android.util.Log
|
|
|
|
import android.util.Log
|
|
|
|
import android.view.Menu
|
|
|
|
import android.view.*
|
|
|
|
import android.view.MenuItem
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
import android.view.View
|
|
|
|
import androidx.navigation.fragment.navArgs
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog
|
|
|
|
import com.afollestad.materialdialogs.input.getInputField
|
|
|
|
import com.afollestad.materialdialogs.input.getInputField
|
|
|
|
@ -15,21 +15,23 @@ import com.afollestad.materialdialogs.input.input
|
|
|
|
import com.afollestad.materialdialogs.list.isItemChecked
|
|
|
|
import com.afollestad.materialdialogs.list.isItemChecked
|
|
|
|
import com.afollestad.materialdialogs.list.listItemsMultiChoice
|
|
|
|
import com.afollestad.materialdialogs.list.listItemsMultiChoice
|
|
|
|
import com.afollestad.materialdialogs.list.uncheckItems
|
|
|
|
import com.afollestad.materialdialogs.list.uncheckItems
|
|
|
|
|
|
|
|
import com.cyb3rko.techniklogger.R
|
|
|
|
|
|
|
|
import com.cyb3rko.techniklogger.databinding.FragmentProjectBinding
|
|
|
|
import com.cyb3rko.techniklogger.recycler.ProjectTechnikerViewHolder
|
|
|
|
import com.cyb3rko.techniklogger.recycler.ProjectTechnikerViewHolder
|
|
|
|
import com.cyb3rko.techniklogger.recycler.ProjectTechnikerViewState
|
|
|
|
import com.cyb3rko.techniklogger.recycler.ProjectTechnikerViewState
|
|
|
|
import com.parse.ParseObject
|
|
|
|
import com.parse.ParseObject
|
|
|
|
import com.parse.ParseQuery
|
|
|
|
import com.parse.ParseQuery
|
|
|
|
import es.dmoral.toasty.Toasty
|
|
|
|
import es.dmoral.toasty.Toasty
|
|
|
|
import kotlinx.android.synthetic.main.activity_main.*
|
|
|
|
|
|
|
|
import java.lang.IndexOutOfBoundsException
|
|
|
|
import java.lang.IndexOutOfBoundsException
|
|
|
|
import me.ibrahimyilmaz.kiel.adapter.RecyclerViewAdapter.Companion.adapterOf
|
|
|
|
import me.ibrahimyilmaz.kiel.adapter.RecyclerViewAdapter.Companion.adapterOf
|
|
|
|
import kotlinx.android.synthetic.main.activity_project.*
|
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_project.recycler_view
|
|
|
|
|
|
|
|
import me.ibrahimyilmaz.kiel.adapter.RecyclerViewAdapter
|
|
|
|
import me.ibrahimyilmaz.kiel.adapter.RecyclerViewAdapter
|
|
|
|
import me.ibrahimyilmaz.kiel.core.RecyclerViewHolder
|
|
|
|
import me.ibrahimyilmaz.kiel.core.RecyclerViewHolder
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
|
class ProjectActivity : AppCompatActivity() {
|
|
|
|
class ProjectFragment : Fragment() {
|
|
|
|
|
|
|
|
private var _binding: FragmentProjectBinding? = null
|
|
|
|
|
|
|
|
private lateinit var myContext: Context
|
|
|
|
|
|
|
|
private val args: ProjectFragmentArgs by navArgs()
|
|
|
|
|
|
|
|
|
|
|
|
private lateinit var adapter: RecyclerViewAdapter<ProjectTechnikerViewState, RecyclerViewHolder<ProjectTechnikerViewState>>
|
|
|
|
private lateinit var adapter: RecyclerViewAdapter<ProjectTechnikerViewState, RecyclerViewHolder<ProjectTechnikerViewState>>
|
|
|
|
private var adminMode = false
|
|
|
|
private var adminMode = false
|
|
|
|
@ -38,16 +40,19 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
private lateinit var sharedPref: SharedPreferences
|
|
|
|
private lateinit var sharedPref: SharedPreferences
|
|
|
|
private val techniker: MutableList<ProjectTechnikerViewState.ProjectTechniker> = mutableListOf()
|
|
|
|
private val techniker: MutableList<ProjectTechnikerViewState.ProjectTechniker> = mutableListOf()
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
private val binding get() = _binding!!
|
|
|
|
childKey = intent.extras?.getString("childKey").toString()
|
|
|
|
|
|
|
|
einsatz = ParseObject.createWithoutData("Einsatz", childKey)
|
|
|
|
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
|
|
|
|
setContentView(R.layout.activity_project)
|
|
|
|
|
|
|
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sharedPref = getSharedPreferences("Safe", 0)
|
|
|
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
|
|
|
|
|
|
|
_binding = FragmentProjectBinding.inflate(inflater, container, false)
|
|
|
|
|
|
|
|
val root = binding.root
|
|
|
|
|
|
|
|
myContext = requireContext()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sharedPref = myContext.getSharedPreferences("Safe", 0)
|
|
|
|
adminMode = sharedPref.getBoolean("admin", false)
|
|
|
|
adminMode = sharedPref.getBoolean("admin", false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
childKey = args.childKey
|
|
|
|
|
|
|
|
einsatz = ParseObject.createWithoutData("Einsatz", childKey)
|
|
|
|
|
|
|
|
|
|
|
|
adapter = adapterOf {
|
|
|
|
adapter = adapterOf {
|
|
|
|
register(
|
|
|
|
register(
|
|
|
|
layoutResource = R.layout.item_recycler_techniker,
|
|
|
|
layoutResource = R.layout.item_recycler_techniker,
|
|
|
|
@ -56,7 +61,7 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
vh.textView.text = text.name
|
|
|
|
vh.textView.text = text.name
|
|
|
|
vh.itemView.setOnClickListener {
|
|
|
|
vh.itemView.setOnClickListener {
|
|
|
|
if (adminMode) {
|
|
|
|
if (adminMode) {
|
|
|
|
MaterialDialog(this@ProjectActivity)
|
|
|
|
MaterialDialog(myContext)
|
|
|
|
.show {
|
|
|
|
.show {
|
|
|
|
message(text = "Möchtest du \'${text.name}\' entfernen?")
|
|
|
|
message(text = "Möchtest du \'${text.name}\' entfernen?")
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
@ -64,8 +69,8 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
einsatz.put("techniker", techniker)
|
|
|
|
einsatz.put("techniker", techniker)
|
|
|
|
einsatz.saveInBackground()
|
|
|
|
einsatz.saveInBackground()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
binding.recyclerView.scheduleLayoutAnimation()
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
binding.technikerView.text = "Techniker: ${techniker.size}"
|
|
|
|
if (techniker.size == 0) showDivider(false)
|
|
|
|
if (techniker.size == 0) showDivider(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
@ -96,35 +101,35 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
techniker.add(ProjectTechnikerViewState.ProjectTechniker(it.getString("name")!!, it.objectId))
|
|
|
|
techniker.add(ProjectTechnikerViewState.ProjectTechniker(it.getString("name")!!, it.objectId))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
recycler_view.scheduleLayoutAnimation()
|
|
|
|
binding.recyclerView.scheduleLayoutAnimation()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
binding.technikerView.text = "Techniker: ${techniker.size}"
|
|
|
|
showDivider()
|
|
|
|
showDivider()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Toasty.error(applicationContext, "Fehler bei Id-Abfrage", Toasty.LENGTH_SHORT).show()
|
|
|
|
Toasty.error(myContext, "Fehler bei Id-Abfrage", Toasty.LENGTH_SHORT).show()
|
|
|
|
Log.e("TechnikLogger.TechSuche", e2.message.toString())
|
|
|
|
Log.e("TechnikLogger.TechSuche", e2.message.toString())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
title_view.text = einsatz["name"].toString()
|
|
|
|
binding.titleView.text = einsatz["name"].toString()
|
|
|
|
location_view.text = einsatz["ort"].toString()
|
|
|
|
binding.locationView.text = einsatz["ort"].toString()
|
|
|
|
val dates = einsatz["datum"].toString().split(",")
|
|
|
|
val dates = einsatz["datum"].toString().split(",")
|
|
|
|
val dateParts = dates[0].split(".")
|
|
|
|
val dateParts = dates[0].split(".")
|
|
|
|
val date = "${dateParts[2]}.${dateParts[1]}.${dateParts[0]}"
|
|
|
|
val date = "${dateParts[2]}.${dateParts[1]}.${dateParts[0]}"
|
|
|
|
val time = if (dates.size > 1) ", ${dates[1]}" else ""
|
|
|
|
val time = if (dates.size > 1) ", ${dates[1]}" else ""
|
|
|
|
date_view.text = date + time
|
|
|
|
binding.dateView.text = date + time
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Toasty.error(applicationContext, "Abruf fehlgeschlagen", Toasty.LENGTH_SHORT).show()
|
|
|
|
Toasty.error(myContext, "Abruf fehlgeschlagen", Toasty.LENGTH_SHORT).show()
|
|
|
|
Log.e("TechnikLogger.TechSuche", e.message.toString())
|
|
|
|
Log.e("TechnikLogger.TechSuche", e.message.toString())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
adapter.submitList(techniker as List<ProjectTechnikerViewState>?)
|
|
|
|
adapter.submitList(techniker as List<ProjectTechnikerViewState>?)
|
|
|
|
recycler_view.layoutManager = LinearLayoutManager(applicationContext)
|
|
|
|
binding.recyclerView.layoutManager = LinearLayoutManager(myContext)
|
|
|
|
recycler_view.adapter = adapter
|
|
|
|
binding.recyclerView.adapter = adapter
|
|
|
|
|
|
|
|
|
|
|
|
add_button.setOnClickListener {
|
|
|
|
binding.addButton.setOnClickListener {
|
|
|
|
val name = sharedPref.getString("name", "invalid")!!
|
|
|
|
val name = sharedPref.getString("name", "invalid")!!
|
|
|
|
if (!adminMode) selfAdd(name) else bothAdd(name)
|
|
|
|
if (!adminMode) selfAdd(name) else bothAdd(name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -132,9 +137,9 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
emptyCheck()
|
|
|
|
emptyCheck()
|
|
|
|
|
|
|
|
|
|
|
|
if (adminMode) {
|
|
|
|
if (adminMode) {
|
|
|
|
reset_button.visibility = View.VISIBLE
|
|
|
|
binding.resetButton.visibility = View.VISIBLE
|
|
|
|
reset_button.setOnClickListener {
|
|
|
|
binding.resetButton.setOnClickListener {
|
|
|
|
MaterialDialog(this).show {
|
|
|
|
MaterialDialog(myContext).show {
|
|
|
|
message(text = "Möchtest du alle eingetragenen Techniker entfernen?")
|
|
|
|
message(text = "Möchtest du alle eingetragenen Techniker entfernen?")
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
einsatz.put("techniker", listOf<String>())
|
|
|
|
einsatz.put("techniker", listOf<String>())
|
|
|
|
@ -142,12 +147,14 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
techniker.clear()
|
|
|
|
techniker.clear()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
showDivider(false)
|
|
|
|
showDivider(false)
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
binding.technikerView.text = "Techniker: ${techniker.size}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return root
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun technikerExists(name: String): Boolean {
|
|
|
|
private fun technikerExists(name: String): Boolean {
|
|
|
|
@ -160,7 +167,7 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun bothAdd(name: String) {
|
|
|
|
private fun bothAdd(name: String) {
|
|
|
|
MaterialDialog(this)
|
|
|
|
MaterialDialog(myContext)
|
|
|
|
.show {
|
|
|
|
.show {
|
|
|
|
message(text = "Möchtest du nur dich oder auch andere Techniker eintragen?")
|
|
|
|
message(text = "Möchtest du nur dich oder auch andere Techniker eintragen?")
|
|
|
|
positiveButton(text = "Mich") {
|
|
|
|
positiveButton(text = "Mich") {
|
|
|
|
@ -175,7 +182,7 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
private fun selfAdd(name: String, skip: Boolean = false) {
|
|
|
|
private fun selfAdd(name: String, skip: Boolean = false) {
|
|
|
|
if (!technikerExists(name)) {
|
|
|
|
if (!technikerExists(name)) {
|
|
|
|
if (!skip) {
|
|
|
|
if (!skip) {
|
|
|
|
MaterialDialog(this).show {
|
|
|
|
MaterialDialog(myContext).show {
|
|
|
|
message(text = "Möchtest du dich als involvierter Techniker eintragen?")
|
|
|
|
message(text = "Möchtest du dich als involvierter Techniker eintragen?")
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
val entry = ParseObject.createWithoutData("Einsatz", childKey)
|
|
|
|
val entry = ParseObject.createWithoutData("Einsatz", childKey)
|
|
|
|
@ -185,8 +192,8 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
showDivider(true)
|
|
|
|
showDivider(true)
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
binding.recyclerView.scheduleLayoutAnimation()
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
binding.technikerView.text = "Techniker: ${techniker.size}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -198,11 +205,11 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
showDivider(true)
|
|
|
|
showDivider(true)
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
binding.recyclerView.scheduleLayoutAnimation()
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
binding.technikerView.text = "Techniker: ${techniker.size}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
MaterialDialog(this)
|
|
|
|
MaterialDialog(myContext)
|
|
|
|
.show {
|
|
|
|
.show {
|
|
|
|
message(text = "Du bist bereits eingetragen.")
|
|
|
|
message(text = "Du bist bereits eingetragen.")
|
|
|
|
positiveButton(text = "Ok")
|
|
|
|
positiveButton(text = "Ok")
|
|
|
|
@ -231,7 +238,7 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
val intArray = currentSelection.toIntArray()
|
|
|
|
val intArray = currentSelection.toIntArray()
|
|
|
|
MaterialDialog(this@ProjectActivity).show {
|
|
|
|
MaterialDialog(myContext).show {
|
|
|
|
listItemsMultiChoice(items = names, initialSelection = intArray, disabledIndices = intArray)
|
|
|
|
listItemsMultiChoice(items = names, initialSelection = intArray, disabledIndices = intArray)
|
|
|
|
positiveButton(text = "Hinzufügen") {
|
|
|
|
positiveButton(text = "Hinzufügen") {
|
|
|
|
it.uncheckItems(intArray)
|
|
|
|
it.uncheckItems(intArray)
|
|
|
|
@ -248,34 +255,34 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
showDivider(true)
|
|
|
|
showDivider(true)
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
binding.recyclerView.scheduleLayoutAnimation()
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
binding.technikerView.text = "Techniker: ${techniker.size}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
negativeButton(text = "Abbrechen") {
|
|
|
|
negativeButton(text = "Abbrechen") {
|
|
|
|
addTechniker.clear()
|
|
|
|
addTechniker.clear()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Toasty.error(applicationContext, "Fehler bei Id-Abfrage", Toasty.LENGTH_SHORT).show()
|
|
|
|
Toasty.error(myContext, "Fehler bei Id-Abfrage", Toasty.LENGTH_SHORT).show()
|
|
|
|
Log.e("TechnikLogger.TechSuche", e.message.toString())
|
|
|
|
Log.e("TechnikLogger.TechSuche", e.message.toString())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun showDivider(show: Boolean = true) {
|
|
|
|
private fun showDivider(show: Boolean = true) {
|
|
|
|
divider.visibility = if (show) View.VISIBLE else View.GONE
|
|
|
|
binding.divider.visibility = if (show) View.VISIBLE else View.GONE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun emptyCheck() {
|
|
|
|
private fun emptyCheck() {
|
|
|
|
if (techniker.isEmpty()) {
|
|
|
|
if (techniker.isEmpty()) {
|
|
|
|
divider.visibility = View.GONE
|
|
|
|
binding.divider.visibility = View.GONE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun showNameDialog() {
|
|
|
|
private fun showNameDialog() {
|
|
|
|
val currentName = getSharedPreferences("Safe", 0).getString("name", "")
|
|
|
|
val currentName = myContext.getSharedPreferences("Safe", 0).getString("name", "")
|
|
|
|
|
|
|
|
|
|
|
|
MaterialDialog(this)
|
|
|
|
MaterialDialog(myContext)
|
|
|
|
.cancelable(false)
|
|
|
|
.cancelable(false)
|
|
|
|
.title(0, "Bitte gebe deinen Namen ein")
|
|
|
|
.title(0, "Bitte gebe deinen Namen ein")
|
|
|
|
.show {
|
|
|
|
.show {
|
|
|
|
@ -288,32 +295,10 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
positiveButton {
|
|
|
|
positiveButton {
|
|
|
|
getSharedPreferences("Safe", 0).edit().putString("name", inputName.toString()).apply()
|
|
|
|
myContext.getSharedPreferences("Safe", 0).edit().putString("name", inputName.toString()).apply()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
positiveButton(0, "Speichern")
|
|
|
|
positiveButton(0, "Speichern")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
|
|
|
|
|
|
|
// Inflate the menu; this adds items to the action bar if it is present.
|
|
|
|
|
|
|
|
menuInflater.inflate(R.menu.menu_main, menu)
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
|
|
|
|
|
|
|
// Handle action bar item clicks here. The action bar will
|
|
|
|
|
|
|
|
// automatically handle clicks on the Home/Up button, so long
|
|
|
|
|
|
|
|
// as you specify a parent activity in AndroidManifest.xml.
|
|
|
|
|
|
|
|
when (item.itemId) {
|
|
|
|
|
|
|
|
android.R.id.home -> finish()
|
|
|
|
|
|
|
|
R.id.action_rename -> showNameDialog()
|
|
|
|
|
|
|
|
// R.id.action_icons -> setContentView(AboutIcons(applicationContext, R.drawable::class.java).setTitle("Benutzte Icons").get())
|
|
|
|
|
|
|
|
// R.id.action_libraries -> LibsBuilder().start(this)
|
|
|
|
|
|
|
|
// R.id.action_privacy_policy ->
|
|
|
|
|
|
|
|
// R.id.action_terms_of_use ->
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return super.onOptionsItemSelected(item)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|