add settings
add permissions to access ssid, fix error in theme, add settings activity with shared preferences and support German and English
This commit is contained in:
@@ -14,6 +14,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"></WebView>
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
75
app/src/main/res/layout/activity_settings.xml
Normal file
75
app/src/main/res/layout/activity_settings.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".SettingsActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/textInputLayoutSsidLocal"
|
||||
android:layout_width="395dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="18dp"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/editTextSsidLocal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="SSID"
|
||||
android:inputType="text" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/textInputLayoutUrlLocal"
|
||||
android:layout_width="395dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInputLayoutSsidLocal">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/editTextUrlLocal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Local URL"
|
||||
android:inputType="text" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/textInputLayoutUrlGlobal"
|
||||
android:layout_width="395dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInputLayoutUrlLocal">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/editTextUrlGlobal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Global URL"
|
||||
android:inputType="text" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
7
app/src/main/res/menu/main.xml
Normal file
7
app/src/main/res/menu/main.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/settings"
|
||||
android:title="@string/settings"/>
|
||||
//android:icon="@drawable/ic_new_game"
|
||||
//android:showAsAction="ifRoom"
|
||||
</menu>
|
||||
5
app/src/main/res/values-de/strings.xml
Normal file
5
app/src/main/res/values-de/strings.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">WiFi-Wetter-Station</string>
|
||||
<string name="settings">Einstellungen</string>
|
||||
<string name="loading">Bitte warten, die Ansicht wird geladen...</string>
|
||||
</resources>
|
||||
@@ -1,4 +1,8 @@
|
||||
<resources>
|
||||
<string name="app_name">WiFi Weather Station</string>
|
||||
<string name="action_settings">Einstellungen</string>
|
||||
<string name="settings">Settings</string>
|
||||
<string name="loading">Please wait, the view is loading...</string>
|
||||
<string name="ssid" translatable="false">NETGEAR26-5G-2</string>
|
||||
<string name="url_local" translatable="false">http://192.168.1.5/site/wifi-weather-station/</string>
|
||||
<string name="url_global" translatable="false">http://inetsrv.no-ip.org/site/wifi-weather-station/</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!--<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
|
||||
<style name="DarkTheme" parent="Theme.AppCompat">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
|
||||
Reference in New Issue
Block a user