From 5acad1bf7f11adb4eec18c782faf206eceba2983 Mon Sep 17 00:00:00 2001 From: Florianisme Date: Sun, 8 Oct 2023 13:38:48 +0200 Subject: [PATCH] Add Github shortcut --- .../de/florianisme/wakeonlan/ui/MainActivity.java | 13 +++++++++++++ app/src/main/res/drawable/ic_github_logo.xml | 9 +++++++++ app/src/main/res/menu/activity_main_drawer.xml | 12 +++++++++++- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/drawable/ic_github_logo.xml diff --git a/app/src/main/java/de/florianisme/wakeonlan/ui/MainActivity.java b/app/src/main/java/de/florianisme/wakeonlan/ui/MainActivity.java index ba796ad..81ddf36 100644 --- a/app/src/main/java/de/florianisme/wakeonlan/ui/MainActivity.java +++ b/app/src/main/java/de/florianisme/wakeonlan/ui/MainActivity.java @@ -1,5 +1,7 @@ package de.florianisme.wakeonlan.ui; +import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.widget.TextView; @@ -62,6 +64,17 @@ private void initializeNavController() { appBarConfiguration = new AppBarConfiguration.Builder(getMenuIds()).setOpenableLayout(binding.drawerLayout).build(); NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration); NavigationUI.setupWithNavController(binding.navigationView, navController); + + setGithubShortcut(); + } + + private void setGithubShortcut() { + binding.navigationView.getMenu().findItem(R.id.githubShortcut).setOnMenuItemClickListener(item -> { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/Florianisme/WakeOnLan")); + startActivity(browserIntent); + + return false; + }); } private void initializeShortcuts() { diff --git a/app/src/main/res/drawable/ic_github_logo.xml b/app/src/main/res/drawable/ic_github_logo.xml new file mode 100644 index 0000000..f0f4c70 --- /dev/null +++ b/app/src/main/res/drawable/ic_github_logo.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml index c0d8053..6178abc 100644 --- a/app/src/main/res/menu/activity_main_drawer.xml +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -1,6 +1,8 @@ - + + + + \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index dba9ca0..29af519 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -70,6 +70,7 @@ Sicherheit SecureOn Passwort (optional) Passwort muss entweder leer oder eine gültige MAC oder IP Adresse sein + Fehler melden Version %1$s Gerät einschalten Gerät kann nicht geweckt werden diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6688798..95ac7fd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -97,6 +97,7 @@ @string/title_fragment_device_list @string/title_fragment_network_scan @string/title_fragment_backup + Report Issues Version %1$s