summaryrefslogtreecommitdiff
path: root/mobile-kt/app/res
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-01-26 14:51:36 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-01-26 14:52:57 +0100
commitd3bf2d09f740221771806789b00bf915c9f5f2e3 (patch)
tree95f99eabd763dff1907f107393504ee75aa747d7 /mobile-kt/app/res
parent466d03a38cb01e9ff9a2d11be113a81c2bdce34a (diff)
initial commitHEADmain
Diffstat (limited to 'mobile-kt/app/res')
-rw-r--r--mobile-kt/app/res/drawable/logo.pngbin0 -> 8963 bytes
-rw-r--r--mobile-kt/app/res/layout/main.xml43
-rw-r--r--mobile-kt/app/res/menu/settings.xml11
-rw-r--r--mobile-kt/app/res/values-de/strings.xml66
-rw-r--r--mobile-kt/app/res/values-ja/strings.xml66
-rw-r--r--mobile-kt/app/res/values/dimens.xml4
-rw-r--r--mobile-kt/app/res/values/strings.xml66
-rw-r--r--mobile-kt/app/res/values/styles.xml11
-rw-r--r--mobile-kt/app/res/xml/settings.xml45
9 files changed, 312 insertions, 0 deletions
diff --git a/mobile-kt/app/res/drawable/logo.png b/mobile-kt/app/res/drawable/logo.png
new file mode 100644
index 0000000..154b579
--- /dev/null
+++ b/mobile-kt/app/res/drawable/logo.png
Binary files differ
diff --git a/mobile-kt/app/res/layout/main.xml b/mobile-kt/app/res/layout/main.xml
new file mode 100644
index 0000000..d3bbcf5
--- /dev/null
+++ b/mobile-kt/app/res/layout/main.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:orientation="vertical"
+ tools:context=".MainActivity"
+>
+
+ <TextureView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/surface_view"
+ />
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:id="@+id/button_start"
+ android:layout_gravity="center"
+ android:onClick="onClickButtonStart"
+ android:text="@string/button_start"
+ android:background="#22B225"
+ android:textColor="@android:color/white"
+ android:textSize="96sp"
+ />
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:id="@+id/button_stop"
+ android:layout_gravity="center"
+ android:onClick="onClickButtonStop"
+ android:text="@string/button_stop"
+ android:background="#96060C"
+ android:textColor="@android:color/white"
+ android:textSize="96sp"
+ />
+</FrameLayout>
diff --git a/mobile-kt/app/res/menu/settings.xml b/mobile-kt/app/res/menu/settings.xml
new file mode 100644
index 0000000..3e3bcbb
--- /dev/null
+++ b/mobile-kt/app/res/menu/settings.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu
+ xmlns:android="http://schemas.android.com/apk/res/android"
+>
+ <item
+ android:id="@+id/menu_settings"
+ android:icon="@android:drawable/ic_menu_preferences"
+ android:title="@string/menu_settings"
+ android:showAsAction="always"
+ />
+</menu>
diff --git a/mobile-kt/app/res/values-de/strings.xml b/mobile-kt/app/res/values-de/strings.xml
new file mode 100644
index 0000000..1b4ebc6
--- /dev/null
+++ b/mobile-kt/app/res/values-de/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_label">
+ Pihole DNS Proxy
+ </string>
+
+ <string name="button_start">
+ Start
+ </string>
+ <string name="button_stop">
+ Stop
+ </string>
+
+ <!-- DNSProxyService -->
+ <string name="dns_proxy_service__notification__text" formatted="false">
+ %s wird verwendet
+ </string>
+ <string name="dns_proxy_service__notification__action__stop">
+ Stop
+ </string>
+
+ <!-- WifiListenerService -->
+ <string name="wifi_listener_service__notification__text">
+ Wartet auf Verbindungsänderungen
+ </string>
+ <string name="wifi_listener_service__notification__action__stop_listener">
+ Listener stoppen
+ </string>
+ <string name="wifi_listener_service__notification__action__start_proxy">
+ Proxy starten
+ </string>
+
+ <!-- Settings -->
+ <string name="menu_settings">
+ Einstellungen
+ </string>
+
+ <string name="settings__use_automatic_dns_server_discovery__title">
+ DNS Server / Pihole automatisch erkennen
+ </string>
+ <string name="settings__use_automatic_dns_server_discovery__summary">
+ Ob der automatische Erkennungsmechanismus verwendet werden soll, um den DNS Server zu setzen
+ </string>
+
+ <string name="settings__dns_server_address__title">
+ Pihole IP Adresse
+ </string>
+
+ <string name="settings__use_wifi_listener__title">
+ WiFi Listener verwenden
+ </string>
+ <string name="settings__use_wifi_listener__summary">
+ Deaktiviert den Proxy wenn die WiFi Verbindung verloren geht
+ </string>
+
+ <string name="settings__use_wifi_listener_for_activation__title">
+ WiFi Listener für Aktivierung verwenden
+ </string>
+ <string name="settings__use_wifi_listener_for_activation__summary">
+ Aktiviert den Proxy wenn mit bestimmtem WLAN verbunden wird. Braucht Standortdienste um zu funktionieren!
+ </string>
+
+ <string name="settings__wifi_listener_ssid__title">
+ WLAN SSID
+ </string>
+</resources>
diff --git a/mobile-kt/app/res/values-ja/strings.xml b/mobile-kt/app/res/values-ja/strings.xml
new file mode 100644
index 0000000..cdd2d3c
--- /dev/null
+++ b/mobile-kt/app/res/values-ja/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_label">
+ Pihole DNS Proxy
+ </string>
+
+ <string name="button_start">
+ 開始
+ </string>
+ <string name="button_stop">
+ 止まる
+ </string>
+
+ <!-- DNSProxyService -->
+ <string name="dns_proxy_service__notification__text">
+ Running with %s
+ </string>
+ <string name="dns_proxy_service__notification__action__stop">
+ 止まる
+ </string>
+
+ <!-- WifiListenerService -->
+ <string name="wifi_listener_service__notification__text">
+ Listening for WiFi connection change
+ </string>
+ <string name="wifi_listener_service__notification__action__stop_listener">
+ Stop Listener
+ </string>
+ <string name="wifi_listener_service__notification__action__start_proxy">
+ プロキシ開始
+ </string>
+
+ <!-- Settings -->
+ <string name="menu_settings">
+ 設定
+ </string>
+
+ <string name="settings__use_automatic_dns_server_discovery__title">
+ Use automatic DNS Server / Pihole discovery
+ </string>
+ <string name="settings__use_automatic_dns_server_discovery__summary">
+ Whether to use the automatic discovery mechanism to set the DNS server
+ </string>
+
+ <string name="settings__dns_server_address__title">
+ Pihole IP アドレス
+ </string>
+
+ <string name="settings__use_wifi_listener__title">
+ Use WiFi listener
+ </string>
+ <string name="settings__use_wifi_listener__summary">
+ Automatically deactivates the proxy on WiFi disconnect
+ </string>
+
+ <string name="settings__use_wifi_listener_for_activation__title">
+ Use WiFi listener for activation
+ </string>
+ <string name="settings__use_wifi_listener_for_activation__summary">
+ Automatically activates the proxy on WiFi connect when connecting to specific WLAN. Needs location services to function!
+ </string>
+
+ <string name="settings__wifi_listener_ssid__title">
+ WLAN SSID
+ </string>
+</resources>
diff --git a/mobile-kt/app/res/values/dimens.xml b/mobile-kt/app/res/values/dimens.xml
new file mode 100644
index 0000000..fe991af
--- /dev/null
+++ b/mobile-kt/app/res/values/dimens.xml
@@ -0,0 +1,4 @@
+<resources>
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>
diff --git a/mobile-kt/app/res/values/strings.xml b/mobile-kt/app/res/values/strings.xml
new file mode 100644
index 0000000..3662cf5
--- /dev/null
+++ b/mobile-kt/app/res/values/strings.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_label">
+ Pihole DNS Proxy
+ </string>
+
+ <string name="button_start">
+ Start
+ </string>
+ <string name="button_stop">
+ Stop
+ </string>
+
+ <!-- DNSProxyService -->
+ <string name="dns_proxy_service__notification__text" formatted="false">
+ Running with %s
+ </string>
+ <string name="dns_proxy_service__notification__action__stop">
+ Stop
+ </string>
+
+ <!-- WifiListenerService -->
+ <string name="wifi_listener_service__notification__text">
+ Listening for WiFi connection change
+ </string>
+ <string name="wifi_listener_service__notification__action__stop_listener">
+ Stop Listener
+ </string>
+ <string name="wifi_listener_service__notification__action__start_proxy">
+ Start Proxy
+ </string>
+
+ <!-- Settings -->
+ <string name="menu_settings">
+ Settings
+ </string>
+
+ <string name="settings__use_automatic_dns_server_discovery__title">
+ Use automatic DNS Server / Pihole discovery
+ </string>
+ <string name="settings__use_automatic_dns_server_discovery__summary">
+ Whether to use the automatic discovery mechanism to set the DNS server
+ </string>
+
+ <string name="settings__dns_server_address__title">
+ Pihole IP address
+ </string>
+
+ <string name="settings__use_wifi_listener__title">
+ Use WiFi listener
+ </string>
+ <string name="settings__use_wifi_listener__summary">
+ Automatically deactivates the proxy on WiFi disconnect
+ </string>
+
+ <string name="settings__use_wifi_listener_for_activation__title">
+ Use WiFi listener for activation
+ </string>
+ <string name="settings__use_wifi_listener_for_activation__summary">
+ Automatically activates the proxy on WiFi connect when connecting to specific WLAN. Needs location services to function!
+ </string>
+
+ <string name="settings__wifi_listener_ssid__title">
+ WLAN SSID
+ </string>
+</resources>
diff --git a/mobile-kt/app/res/values/styles.xml b/mobile-kt/app/res/values/styles.xml
new file mode 100644
index 0000000..d5037d5
--- /dev/null
+++ b/mobile-kt/app/res/values/styles.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="button_start__start" parent="@android:style/Widget.Button">
+ <item name="android:background">#96060C</item>
+ <item name="android:textColor">@android:color/white</item>
+ </style>
+ <style name="button_start__stop" parent="@android:style/Widget.Button">
+ <item name="android:background">#22B225</item>
+ <item name="android:textColor">@android:color/white</item>
+ </style>
+</resources>
diff --git a/mobile-kt/app/res/xml/settings.xml b/mobile-kt/app/res/xml/settings.xml
new file mode 100644
index 0000000..31cc8f0
--- /dev/null
+++ b/mobile-kt/app/res/xml/settings.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+>
+ <SwitchPreference
+ android:key="use_automatic_dns_server_discovery"
+ android:defaultValue="true"
+ android:title="@string/settings__use_automatic_dns_server_discovery__title"
+ android:summary="@string/settings__use_automatic_dns_server_discovery__summary"
+ />
+
+ <EditTextPreference
+ android:key="dns_server_address"
+ android:title="@string/settings__dns_server_address__title"
+ />
+
+ <SwitchPreference
+ android:key="use_wifi_listener"
+ android:defaultValue="false"
+ android:title="@string/settings__use_wifi_listener__title"
+ android:summary="@string/settings__use_wifi_listener__summary"
+ />
+
+ <SwitchPreference
+ android:key="use_wifi_listener_for_activation"
+ android:dependency="use_wifi_listener"
+ android:defaultValue="false"
+ android:title="@string/settings__use_wifi_listener_for_activation__title"
+ android:summary="@string/settings__use_wifi_listener_for_activation__summary"
+ />
+
+ <EditTextPreference
+ android:key="wifi_listener_ssid"
+ android:dependency="use_wifi_listener_for_activation"
+ android:title="@string/settings__wifi_listener_ssid__title"
+ />
+
+ <!-- SELECT_FROM_KNOWN_SSIDS -->
+ <!-- <MultiSelectListPreference -->
+ <!-- android:id="@+id/known_ssids" -->
+ <!-- android:key="known_ssids" -->
+ <!-- android:entries="" -->
+ <!-- android:entryValues="" -->
+ <!-- /> -->
+</PreferenceScreen>