This commit is contained in:
dece 2022-01-11 17:06:04 +01:00
parent ad5d146a9b
commit 732a2db166
3 changed files with 19 additions and 0 deletions

View file

@ -1,6 +1,8 @@
package dev.lowrespalmtree.comet
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
@ -17,7 +19,18 @@ class MainActivity : AppCompatActivity() {
supportFragmentManager.findFragmentById(R.id.nav_host_fragment)?.also { navHost ->
findViewById<NavigationView>(R.id.drawer_navigation)?.apply {
setupWithNavController((navHost as NavHostFragment).navController)
// setNavigationItemSelectedListener { menuItem ->
// when (menuItem.itemId) {
// R.id.home -> Log.w("AJAJ", "clickkkkk")
// else ->
// }
// true
// }
}
}
}
fun prout(item: android.view.MenuItem) {
Log.w("AJAJ", "koiluuut")
}
}

View file

@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/home"
android:icon="@android:drawable/ic_menu_myplaces"
android:title="@string/home"
android:onClick="prout" />
<item
android:id="@+id/history"
android:icon="@android:drawable/ic_menu_recent_history"

View file

@ -27,6 +27,7 @@
<string name="attachment_summary_on">Automatically download attachments for incoming emails
</string>
<string name="attachment_summary_off">Only download attachments when manually requested</string>
<string name="home">Home</string>
</resources>