|
|
|
|
@ -1,14 +1,12 @@
|
|
|
|
|
package com.cyb3rko.techniklogger
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint
|
|
|
|
|
import android.content.Intent
|
|
|
|
|
import android.content.SharedPreferences
|
|
|
|
|
import android.os.Bundle
|
|
|
|
|
import android.util.Log
|
|
|
|
|
import android.view.Menu
|
|
|
|
|
import android.view.MenuItem
|
|
|
|
|
import android.view.View
|
|
|
|
|
import android.widget.TextView
|
|
|
|
|
import android.widget.Toast
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog
|
|
|
|
|
@ -19,49 +17,56 @@ import com.afollestad.materialdialogs.list.listItemsMultiChoice
|
|
|
|
|
import com.afollestad.materialdialogs.list.uncheckItems
|
|
|
|
|
import com.cyb3rko.techniklogger.recycler.ProjectTechnikerViewHolder
|
|
|
|
|
import com.cyb3rko.techniklogger.recycler.ProjectTechnikerViewState
|
|
|
|
|
import com.google.firebase.database.*
|
|
|
|
|
import com.parse.ParseObject
|
|
|
|
|
import com.parse.ParseQuery
|
|
|
|
|
import es.dmoral.toasty.Toasty
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_main.*
|
|
|
|
|
import java.lang.IndexOutOfBoundsException
|
|
|
|
|
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 kotlinx.coroutines.GlobalScope
|
|
|
|
|
import kotlinx.coroutines.launch
|
|
|
|
|
import me.ibrahimyilmaz.kiel.adapter.RecyclerViewAdapter
|
|
|
|
|
import me.ibrahimyilmaz.kiel.core.RecyclerViewHolder
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetTextI18n")
|
|
|
|
|
class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
|
|
|
|
|
private var addTechniker = mutableListOf<String>()
|
|
|
|
|
private lateinit var adapter: RecyclerViewAdapter<ProjectTechnikerViewState, RecyclerViewHolder<ProjectTechnikerViewState>>
|
|
|
|
|
private var adminMode = false
|
|
|
|
|
private var childKey = ""
|
|
|
|
|
private lateinit var databaseReference: DatabaseReference
|
|
|
|
|
private lateinit var einsatz: ParseObject
|
|
|
|
|
private lateinit var sharedPref: SharedPreferences
|
|
|
|
|
private val techniker: MutableList<ProjectTechnikerViewState.ProjectTechniker> = mutableListOf()
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
|
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)
|
|
|
|
|
if (sharedPref.getBoolean("admin", false)) adminMode = true
|
|
|
|
|
adminMode = sharedPref.getBoolean("admin", false)
|
|
|
|
|
|
|
|
|
|
databaseReference = FirebaseDatabase.getInstance().getReference("einsätze").child(childKey)
|
|
|
|
|
|
|
|
|
|
val adapter = adapterOf<ProjectTechnikerViewState> {
|
|
|
|
|
adapter = adapterOf {
|
|
|
|
|
register(
|
|
|
|
|
layoutResource = R.layout.item_recycler_techniker,
|
|
|
|
|
viewHolder = ::ProjectTechnikerViewHolder,
|
|
|
|
|
onBindBindViewHolder = { vh, _, text ->
|
|
|
|
|
vh.textView.text = text.name
|
|
|
|
|
if (adminMode) {
|
|
|
|
|
vh.itemView.setOnClickListener {
|
|
|
|
|
if (adminMode) {
|
|
|
|
|
MaterialDialog(this@ProjectActivity)
|
|
|
|
|
.show {
|
|
|
|
|
message(text = "Möchtest du \'${text.name}\' entfernen?")
|
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
|
databaseReference.child("techniker").child(text.key).removeValue()
|
|
|
|
|
techniker.remove(text)
|
|
|
|
|
einsatz.put("techniker", techniker)
|
|
|
|
|
einsatz.saveInBackground()
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
if (techniker.size == 0) showDivider(false)
|
|
|
|
|
}
|
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
|
}
|
|
|
|
|
@ -71,32 +76,47 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val listener = object: ChildEventListener {
|
|
|
|
|
override fun onChildAdded(snapshot: DataSnapshot, previousChildName: String?) {
|
|
|
|
|
techniker.add(techniker.size, ProjectTechnikerViewState.ProjectTechniker(snapshot.value.toString(), snapshot.key!!))
|
|
|
|
|
val query = ParseQuery.getQuery<ParseObject>("Einsatz")
|
|
|
|
|
query.getInBackground(childKey) { einsatz, e ->
|
|
|
|
|
if (e == null) {
|
|
|
|
|
val technikerIds = einsatz.getList<String>("techniker")!!
|
|
|
|
|
|
|
|
|
|
val queries = mutableListOf<ParseQuery<ParseObject>>()
|
|
|
|
|
technikerIds.forEach {
|
|
|
|
|
val tempQuery = ParseQuery.getQuery<ParseObject>("Techniker")
|
|
|
|
|
tempQuery.whereEqualTo("objectId", it.toString())
|
|
|
|
|
queries.add(tempQuery)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (queries.isNotEmpty()) {
|
|
|
|
|
val query2 = ParseQuery.or(queries)
|
|
|
|
|
query2.findInBackground { objects2, e2 ->
|
|
|
|
|
if (e2 == null) {
|
|
|
|
|
objects2.forEach {
|
|
|
|
|
techniker.add(ProjectTechnikerViewState.ProjectTechniker(it.getString("name")!!, it.objectId))
|
|
|
|
|
}
|
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
|
recycler_view.scheduleLayoutAnimation()
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
showDivider()
|
|
|
|
|
techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
} else {
|
|
|
|
|
Toasty.error(applicationContext, "Fehler bei Id-Abfrage", Toasty.LENGTH_SHORT).show()
|
|
|
|
|
Log.e("TechnikLogger.TechSuche", e2.message.toString())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onChildChanged(snapshot: DataSnapshot, previousChildName: String?) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onChildRemoved(snapshot: DataSnapshot) {
|
|
|
|
|
techniker.remove(ProjectTechnikerViewState.ProjectTechniker(snapshot.value.toString(), snapshot.key!!))
|
|
|
|
|
recycler_view.scheduleLayoutAnimation()
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
emptyCheck()
|
|
|
|
|
techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onChildMoved(snapshot: DataSnapshot, previousChildName: String?) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCancelled(error: DatabaseError) {
|
|
|
|
|
Toast.makeText(applicationContext, "Abruf fehlgeschlagen", Toast.LENGTH_SHORT).show()
|
|
|
|
|
title_view.text = einsatz["name"].toString()
|
|
|
|
|
location_view.text = einsatz["ort"].toString()
|
|
|
|
|
val dates = einsatz["datum"].toString().split(",")
|
|
|
|
|
val dateParts = dates[0].split(".")
|
|
|
|
|
val date = "${dateParts[2]}.${dateParts[1]}.${dateParts[0]}"
|
|
|
|
|
val time = if (dates.size > 1) ", ${dates[1]}" else ""
|
|
|
|
|
date_view.text = date + time
|
|
|
|
|
} else {
|
|
|
|
|
Toasty.error(applicationContext, "Abruf fehlgeschlagen", Toasty.LENGTH_SHORT).show()
|
|
|
|
|
Log.e("TechnikLogger.TechSuche", e.message.toString())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -104,15 +124,8 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
recycler_view.layoutManager = LinearLayoutManager(applicationContext)
|
|
|
|
|
recycler_view.adapter = adapter
|
|
|
|
|
|
|
|
|
|
databaseReference.child("techniker").addChildEventListener(listener)
|
|
|
|
|
|
|
|
|
|
setValueEventListener("name", title_view)
|
|
|
|
|
setValueEventListener("location", location_view)
|
|
|
|
|
setValueEventListener("date", date_view)
|
|
|
|
|
setTimeEventListener()
|
|
|
|
|
|
|
|
|
|
add_button.setOnClickListener {
|
|
|
|
|
val name = getSharedPreferences("Safe", 0).getString("name", "invalid")!!
|
|
|
|
|
val name = sharedPref.getString("name", "invalid")!!
|
|
|
|
|
if (!adminMode) selfAdd(name) else bothAdd(name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -124,7 +137,12 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
MaterialDialog(this).show {
|
|
|
|
|
message(text = "Möchtest du alle eingetragenen Techniker entfernen?")
|
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
|
databaseReference.child("techniker").removeValue()
|
|
|
|
|
einsatz.put("techniker", listOf<String>())
|
|
|
|
|
einsatz.saveInBackground()
|
|
|
|
|
techniker.clear()
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
showDivider(false)
|
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
}
|
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
|
}
|
|
|
|
|
@ -160,12 +178,28 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
MaterialDialog(this).show {
|
|
|
|
|
message(text = "Möchtest du dich als involvierter Techniker eintragen?")
|
|
|
|
|
positiveButton(text = "Ja") {
|
|
|
|
|
databaseReference.child("techniker").push().setValue(name)
|
|
|
|
|
val entry = ParseObject.createWithoutData("Einsatz", childKey)
|
|
|
|
|
entry.add("techniker", sharedPref.getString("technikerId", "")!!)
|
|
|
|
|
entry.saveInBackground()
|
|
|
|
|
techniker.add(ProjectTechnikerViewState.ProjectTechniker(name, sharedPref.getString("technikerId", "")!!))
|
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
showDivider(true)
|
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
}
|
|
|
|
|
negativeButton(text = "Abbrechen")
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
databaseReference.child("techniker").push().setValue(name)
|
|
|
|
|
val entry = ParseObject.createWithoutData("Einsatz", childKey)
|
|
|
|
|
entry.add("techniker", sharedPref.getString("technikerId", "")!!)
|
|
|
|
|
entry.saveInBackground()
|
|
|
|
|
techniker.add(ProjectTechnikerViewState.ProjectTechniker(name, sharedPref.getString("technikerid", "")!!))
|
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
showDivider(true)
|
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
MaterialDialog(this)
|
|
|
|
|
@ -177,96 +211,59 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun otherAdd() {
|
|
|
|
|
val technikerReference = FirebaseDatabase.getInstance().reference.child("techniker")
|
|
|
|
|
val childReadListener = getReadListener(technikerReference)
|
|
|
|
|
val query = ParseQuery.getQuery<ParseObject>("Techniker")
|
|
|
|
|
val addTechniker = mutableListOf<ProjectTechnikerViewState.ProjectTechniker>()
|
|
|
|
|
|
|
|
|
|
addTechniker.clear()
|
|
|
|
|
technikerReference.addChildEventListener(childReadListener)
|
|
|
|
|
query.findInBackground { objects, e ->
|
|
|
|
|
if (e == null) {
|
|
|
|
|
objects.forEach {
|
|
|
|
|
addTechniker.add(ProjectTechnikerViewState.ProjectTechniker(it.getString("name")!!, it.objectId))
|
|
|
|
|
}
|
|
|
|
|
addTechniker.sortBy { it.name }
|
|
|
|
|
|
|
|
|
|
technikerReference.addListenerForSingleValueEvent(object : ValueEventListener {
|
|
|
|
|
override fun onDataChange(snapshot: DataSnapshot) {
|
|
|
|
|
if (snapshot.exists()) {
|
|
|
|
|
technikerReference.removeEventListener(childReadListener)
|
|
|
|
|
technikerReference.removeEventListener(this)
|
|
|
|
|
addTechniker.sort()
|
|
|
|
|
val currentSelection = mutableListOf<Int>()
|
|
|
|
|
val names = mutableListOf<String>()
|
|
|
|
|
addTechniker.forEachIndexed { index, s ->
|
|
|
|
|
names.add(s.name)
|
|
|
|
|
techniker.forEach {
|
|
|
|
|
if (s == it.name) currentSelection.add(index)
|
|
|
|
|
if (s.name == it.name) currentSelection.add(index)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
val intArray = currentSelection.toIntArray()
|
|
|
|
|
MaterialDialog(this@ProjectActivity).show {
|
|
|
|
|
listItemsMultiChoice(items = addTechniker, initialSelection = intArray, disabledIndices = intArray)
|
|
|
|
|
listItemsMultiChoice(items = names, initialSelection = intArray, disabledIndices = intArray)
|
|
|
|
|
positiveButton(text = "Hinzufügen") {
|
|
|
|
|
it.uncheckItems(intArray)
|
|
|
|
|
GlobalScope.launch {
|
|
|
|
|
val checkedNameKeys = mutableListOf<String>()
|
|
|
|
|
addTechniker.forEachIndexed { index, s ->
|
|
|
|
|
if (it.isItemChecked(index)) {
|
|
|
|
|
databaseReference.child("techniker").push().setValue(s)
|
|
|
|
|
checkedNameKeys.add(s.key)
|
|
|
|
|
techniker.add(s)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
einsatz.addAll("techniker", checkedNameKeys)
|
|
|
|
|
einsatz.saveInBackground()
|
|
|
|
|
addTechniker.clear()
|
|
|
|
|
}
|
|
|
|
|
techniker.sortBy { it.name }
|
|
|
|
|
adapter.notifyDataSetChanged()
|
|
|
|
|
showDivider(true)
|
|
|
|
|
this@ProjectActivity.recycler_view.scheduleLayoutAnimation()
|
|
|
|
|
this@ProjectActivity.techniker_view.text = "Techniker: ${techniker.size}"
|
|
|
|
|
}
|
|
|
|
|
negativeButton(text = "Abbrechen") {
|
|
|
|
|
addTechniker.clear()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCancelled(error: DatabaseError) {
|
|
|
|
|
technikerReference.removeEventListener(childReadListener)
|
|
|
|
|
technikerReference.removeEventListener(this)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun getReadListener(databaseRef: DatabaseReference): ChildEventListener {
|
|
|
|
|
return object : ChildEventListener {
|
|
|
|
|
override fun onChildAdded(snapshot: DataSnapshot, previousChildName: String?) {
|
|
|
|
|
addTechniker.add(snapshot.value.toString())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onChildChanged(snapshot: DataSnapshot, previousChildName: String?) {}
|
|
|
|
|
override fun onChildRemoved(snapshot: DataSnapshot) {}
|
|
|
|
|
override fun onChildMoved(snapshot: DataSnapshot, previousChildName: String?) {}
|
|
|
|
|
override fun onCancelled(error: DatabaseError) {
|
|
|
|
|
databaseRef.removeEventListener(this)
|
|
|
|
|
} else {
|
|
|
|
|
Toasty.error(applicationContext, "Fehler bei Id-Abfrage", Toasty.LENGTH_SHORT).show()
|
|
|
|
|
Log.e("TechnikLogger.TechSuche", e.message.toString())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun setValueEventListener(childName: String, textView: TextView) {
|
|
|
|
|
val valueEventListener = object: ValueEventListener {
|
|
|
|
|
override fun onDataChange(snapshot: DataSnapshot) {
|
|
|
|
|
textView.text = snapshot.value.toString()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCancelled(error: DatabaseError) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
databaseReference.child(childName).addListenerForSingleValueEvent(valueEventListener)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun setTimeEventListener() {
|
|
|
|
|
val valueEventListener = object: ValueEventListener {
|
|
|
|
|
override fun onDataChange(snapshot: DataSnapshot) {
|
|
|
|
|
val time = snapshot.value.toString()
|
|
|
|
|
if (time != "null") {
|
|
|
|
|
date_view.text = "${date_view.text}, $time Uhr"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onCancelled(error: DatabaseError) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
databaseReference.child("time").addListenerForSingleValueEvent(valueEventListener)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun showDivider() {
|
|
|
|
|
divider.visibility = View.VISIBLE
|
|
|
|
|
private fun showDivider(show: Boolean = true) {
|
|
|
|
|
divider.visibility = if (show) View.VISIBLE else View.GONE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun emptyCheck() {
|
|
|
|
|
@ -298,55 +295,9 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun toggleAdminMode() {
|
|
|
|
|
if (!adminMode) {
|
|
|
|
|
var adminKey = ""
|
|
|
|
|
|
|
|
|
|
val listener = object: ChildEventListener {
|
|
|
|
|
override fun onChildAdded(snapshot: DataSnapshot, previousChildName: String?) {
|
|
|
|
|
if (snapshot.key == "admin_key") {
|
|
|
|
|
adminKey = snapshot.value.toString()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
override fun onChildChanged(snapshot: DataSnapshot, previousChildName: String?) {}
|
|
|
|
|
override fun onChildRemoved(snapshot: DataSnapshot) {}
|
|
|
|
|
override fun onChildMoved(snapshot: DataSnapshot, previousChildName: String?) {}
|
|
|
|
|
override fun onCancelled(error: DatabaseError) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FirebaseDatabase.getInstance().reference.addChildEventListener(listener)
|
|
|
|
|
|
|
|
|
|
MaterialDialog(this)
|
|
|
|
|
.title(text = "Bitte gebe den Admin-Key ein")
|
|
|
|
|
.show {
|
|
|
|
|
input(hint = "Admin-Key", waitForPositiveButton = false) { _, inputKey ->
|
|
|
|
|
positiveButton {
|
|
|
|
|
if (inputKey.toString() == adminKey) {
|
|
|
|
|
sharedPref.edit().putBoolean("admin", true).apply()
|
|
|
|
|
val intent = Intent(applicationContext, MainActivity::class.java)
|
|
|
|
|
startActivity(intent)
|
|
|
|
|
finishAffinity()
|
|
|
|
|
} else {
|
|
|
|
|
Toasty.error(applicationContext, "Ungültiger Key").show()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
positiveButton(text = "Speichern")
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
sharedPref.edit().putBoolean("admin", false).apply()
|
|
|
|
|
val intent = Intent(applicationContext, MainActivity::class.java)
|
|
|
|
|
startActivity(intent)
|
|
|
|
|
finishAffinity()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
if (adminMode) {
|
|
|
|
|
menu.findItem(R.id.action_admin).title = "Admin-Zugriff deaktivieren"
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -357,7 +308,6 @@ class ProjectActivity : AppCompatActivity() {
|
|
|
|
|
when (item.itemId) {
|
|
|
|
|
android.R.id.home -> finish()
|
|
|
|
|
R.id.action_rename -> showNameDialog()
|
|
|
|
|
R.id.action_admin -> toggleAdminMode()
|
|
|
|
|
// 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 ->
|
|
|
|
|
|