Add settings
This commit is contained in:
9
mobile/src/main/res/drawable/ic_action_settings.xml
Normal file
9
mobile/src/main/res/drawable/ic_action_settings.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
|
||||
</vector>
|
||||
9
mobile/src/main/res/drawable/ic_navigation_close.xml
Normal file
9
mobile/src/main/res/drawable/ic_navigation_close.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#fff"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
</vector>
|
||||
@@ -58,6 +58,7 @@
|
||||
android:layout_column="2"
|
||||
android:layout_row="0"
|
||||
android:text="@{data.ssid}"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="DIRECT-rAnd0m"/>
|
||||
|
||||
<TextView
|
||||
@@ -74,6 +75,7 @@
|
||||
android:layout_column="2"
|
||||
android:layout_row="1"
|
||||
android:text="@{data.password}"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="p4ssW0rd"/>
|
||||
</GridLayout>
|
||||
|
||||
@@ -101,6 +103,6 @@
|
||||
android:paddingTop="8dp"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="vertical"
|
||||
tools:listitem="@layout/client"/>
|
||||
tools:listitem="@layout/listitem_client"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
26
mobile/src/main/res/layout/activity_settings.xml
Normal file
26
mobile/src/main/res/layout/activity_settings.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_width="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
app:title="@string/title_activity_settings"
|
||||
app:navigationIcon="@drawable/ic_navigation_close"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
android:id="@+id/toolbar"/>
|
||||
<fragment
|
||||
class="be.mygod.vpnhotspot.SettingsFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/preference"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -21,6 +21,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{device.deviceAddress}"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="xx:xx:xx:xx:xx:xx"/>
|
||||
|
||||
<TextView
|
||||
@@ -28,6 +29,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{ipAddress == null ? View.GONE : View.VISIBLE}"
|
||||
android:text="@{ipAddress}"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="192.168.49.123"/>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
9
mobile/src/main/res/menu/main.xml
Normal file
9
mobile/src/main/res/menu/main.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:icon="@drawable/ic_action_settings"
|
||||
android:title="@string/title_activity_settings"
|
||||
app:showAsAction="always"/>
|
||||
</menu>
|
||||
@@ -1,3 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">VPN Hotspot</string>
|
||||
<string name="title_activity_settings">Settings</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<style name="AppTheme" parent="PreferenceFixTheme.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
41
mobile/src/main/res/xml/pref_settings.xml
Normal file
41
mobile/src/main/res/xml/pref_settings.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory
|
||||
android:key="service"
|
||||
android:title="Service">
|
||||
<AutoSummaryEditTextPreference
|
||||
android:key="service.upstream"
|
||||
android:title="Upstream interface"
|
||||
android:summary="%s"
|
||||
android:defaultValue="tun0"/>
|
||||
<AutoSummaryEditTextPreference
|
||||
android:key="service.route"
|
||||
android:title="Wi-Fi Direct routing"
|
||||
android:summary="%s"
|
||||
android:defaultValue="192.168.49.0/24"/>
|
||||
<AutoSummaryEditTextPreference
|
||||
android:key="service.dns"
|
||||
android:title="Downstream DNS server:port"
|
||||
android:summary="%s"
|
||||
android:defaultValue="8.8.8.8:53"/>
|
||||
<Preference
|
||||
android:key="service.clean"
|
||||
android:title="Clean up"
|
||||
android:summary="Remove routing rules"/>
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory
|
||||
android:title="Misc">
|
||||
<Preference
|
||||
android:key="misc.logcat"
|
||||
android:title="Export logcat"
|
||||
android:summary="Such useful very wow"/>
|
||||
<Preference
|
||||
android:key="misc.source"
|
||||
android:title="View on GitHub"
|
||||
android:summary="Star, submit issues and contribute"/>
|
||||
<Preference
|
||||
android:key="misc.donate"
|
||||
android:title="Donate"
|
||||
android:summary="I love money"/>
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user