iiab-tools/apk/controller/app/src/main/res/layout/main.xml

495 lines
24 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:attr/windowBackground">
<!-- Custom Header/Toolbar -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="#1A1A1A"
android:padding="8dp">
<ImageView
android:id="@+id/header_icon"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:src="@mipmap/ic_launcher" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/header_icon"
android:layout_centerVertical="true"
android:layout_marginStart="12dp"
android:text="@string/app_name"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/btn_settings"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_toStartOf="@id/theme_toggle"
android:layout_centerVertical="true"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@android:drawable/ic_menu_preferences"
android:contentDescription="Settings"
android:padding="10dp"
android:scaleType="fitCenter" />
<!-- Triple Toggle Theme ImageButton -->
<ImageButton
android:id="@+id/theme_toggle"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_theme_system"
android:contentDescription="Toggle Theme"
android:padding="8dp"
android:scaleType="fitCenter" />
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<LinearLayout
android:id="@+id/dashboard_container"
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:layout_marginBottom="16dp"
android:background="@drawable/rounded_button"
android:backgroundTint="#1A1A1A"
android:paddingHorizontal="8dp"
android:gravity="center_vertical"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/dash_wifi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
android:padding="12dp">
<View
android:layout_width="10dp"
android:id="@+id/led_wifi"
android:layout_height="10dp"
android:layout_marginEnd="8dp"
android:background="@drawable/led_off" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wi-Fi"
android:textColor="#FFFFFF"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/dash_hotspot"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
android:padding="12dp">
<View
android:id="@+id/led_hotspot"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginEnd="8dp"
android:background="@drawable/led_off" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hotspot"
android:textColor="#FFFFFF"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/dash_tunnel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
android:padding="12dp"
android:visibility="gone">
<View
android:id="@+id/led_tunnel"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginEnd="8dp"
android:background="@drawable/led_on_green" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tunnel"
android:textColor="#FFFFFF"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<!-- VPN Control Section -->
<Button
android:id="@+id/control"
android:layout_width="match_parent"
android:layout_height="90dp"
android:text="@string/control_enable"
android:textSize="20sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:background="@drawable/rounded_button"
android:backgroundTint="@color/btn_vpn_off"
android:textAllCaps="false"/>
<TextView
android:id="@+id/control_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/vpn_description"
android:textSize="13sp"
android:gravity="center"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginTop="8dp"
android:layout_marginBottom="12dp"/>
<!-- Local WebView -->
<Button
android:id="@+id/btnBrowseContent"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="12dp"
android:text="@string/browse_content"
android:textSize="21sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:background="@drawable/rounded_button"
android:backgroundTint="@color/btn_explore_disabled"
android:textAllCaps="false"
android:elevation="4dp"
android:enabled="false" />
<TextView
android:id="@+id/config_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/advanced_settings_label"
android:textStyle="bold"
android:padding="12dp"
android:background="?attr/sectionHeaderBackground"
android:textColor="#FFFFFF"
android:clickable="true"
android:focusable="true"
android:layout_marginTop="20dp" />
<LinearLayout
android:id="@+id/config_layout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:padding="12dp"
android:background="?attr/sectionBackground">
<Button
android:id="@+id/apps"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/apps"
android:layout_marginBottom="12dp"
android:background="@drawable/rounded_button"
android:backgroundTint="#673AB7"
android:textColor="#FFFFFF"
android:textAllCaps="false"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dns_ipv4"
android:textColor="?android:attr/textColorSecondary"
android:textSize="11sp"/>
<EditText android:id="@+id/dns_ipv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dns_ipv6"
android:textColor="?android:attr/textColorSecondary"
android:textSize="11sp"/>
<EditText android:id="@+id/dns_ipv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"/>
<CheckBox
android:id="@+id/checkbox_maintenance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="Maintenance Mode"
android:checked="true" />
<TextView
android:id="@+id/maintenance_warning"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Disable Safe Pocket Web in order to modify"
android:textSize="11sp"
android:textStyle="italic"
android:textColor="#FF9800"
android:layout_marginBottom="8dp"
android:visibility="gone" />
<Button android:id="@+id/save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/save"
android:layout_marginTop="8dp"
android:background="@drawable/rounded_button"
android:backgroundTint="#555555"
android:textColor="#FFFFFF"
android:textAllCaps="false"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/socks_addr" android:textColor="?android:attr/textColorSecondary" android:textSize="12sp" android:visibility="gone"/>
<EditText android:id="@+id/socks_addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:textColor="?android:attr/textColorPrimary" android:visibility="gone"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/socks_port" android:textColor="?android:attr/textColorSecondary" android:textSize="12sp" android:visibility="gone"/>
<EditText android:id="@+id/socks_port" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:inputType="number" android:textColor="?android:attr/textColorPrimary" android:visibility="gone"/>
<TextView
android:id="@+id/adv_config_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/advanced_settings_label"
android:textColor="?android:attr/textColorSecondary"
android:padding="8dp"
android:textSize="13sp"
android:clickable="true"
android:focusable="true"
android:visibility="gone"/>
<LinearLayout
android:id="@+id/advanced_config"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/socks_udp_addr" android:textColor="?android:attr/textColorSecondary" android:textSize="11sp"/>
<EditText android:id="@+id/socks_udp_addr" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:textColor="?android:attr/textColorPrimary"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/socks_user" android:textColor="?android:attr/textColorSecondary" android:textSize="11sp"/>
<EditText android:id="@+id/socks_user" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:textColor="?android:attr/textColorPrimary"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/socks_pass" android:textColor="?android:attr/textColorSecondary" android:textSize="11sp"/>
<EditText android:id="@+id/socks_pass" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:inputType="textPassword" android:textColor="?android:attr/textColorPrimary"/>
<CheckBox android:id="@+id/udp_in_tcp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/udp_in_tcp" android:textColor="?android:attr/textColorSecondary"/>
<CheckBox android:id="@+id/ipv4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ipv4" android:textColor="?android:attr/textColorSecondary"/>
<CheckBox android:id="@+id/ipv6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ipv6" android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:visibility="gone">
<CheckBox android:id="@+id/remote_dns" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/remote_dns" android:textColor="?android:attr/textColorSecondary"/>
<CheckBox android:id="@+id/global" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/global" android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>
</LinearLayout>
<!-- HR above Watchdog -->
<View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/divider_color" android:layout_marginBottom="16dp"/>
<!-- Watchdog Control Section -->
<LinearLayout
android:id="@+id/deck_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="12dp"
android:layout_marginBottom="8dp"
android:background="#00000000"
android:padding="3dp"
android:orientation="horizontal"
android:baselineAligned="false"
android:weightSum="2">
<Button
android:id="@+id/btn_server_control"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
android:layout_marginEnd="4dp"
android:text="Launch Server"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:background="@drawable/rounded_button"
android:backgroundTint="@color/btn_success"
android:textAllCaps="false"/>
<Button
android:id="@+id/watchdog_control"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1"
android:layout_marginStart="4dp"
android:text="@string/watchdog_enable"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="#FFFFFF"
android:background="@drawable/rounded_button"
android:backgroundTint="@color/btn_watchdog_off"
android:textAllCaps="false"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/watchdog_description"
android:textSize="13sp"
android:gravity="center"
android:textColor="?android:attr/textColorSecondary"
android:layout_marginBottom="16dp"/>
<View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/divider_color" android:layout_marginVertical="20dp"/>
<!-- Log Section (Collapsible) -->
<TextView
android:id="@+id/log_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/connection_log_label"
android:textStyle="bold"
android:padding="10dp"
android:background="?attr/sectionHeaderBackground"
android:textColor="#FFFFFF"
android:clickable="true"
android:focusable="true"/>
<!-- Log Warnings (Growth rate warning) -->
<TextView
android:id="@+id/log_warning_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/text_warning"
android:textSize="11sp"
android:textStyle="italic"
android:padding="4dp"
android:visibility="gone"
android:text="@string/log_warning_rapid_growth" />
<!-- Loading Indicator for Logs -->
<ProgressBar
android:id="@+id/log_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="gone" />
<TextView
android:id="@+id/connection_log"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="#000000"
android:textColor="#00FF00"
android:fontFamily="monospace"
android:padding="8dp"
android:visibility="gone"
android:scrollbars="vertical"
android:fadeScrollbars="false"
android:scrollbarSize="10dp"
android:scrollbarThumbVertical="@drawable/scrollbar_thumb"
android:text="@string/system_ready"
android:textSize="11sp"/>
<!-- Log Size Indicator -->
<TextView
android:id="@+id/log_size_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end"
android:textColor="?android:attr/textColorSecondary"
android:textSize="10sp"
android:paddingEnd="8dp"
android:visibility="gone"
android:text="Size: 0KB / 10MB" />
<!-- Log Actions Bar -->
<LinearLayout
android:id="@+id/log_actions"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="4dp">
<Button
android:id="@+id/btn_clear_log"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/reset_log"
android:textSize="12sp"
android:backgroundTint="@color/btn_danger"
android:textColor="#FFFFFF"
android:textAllCaps="false"
android:layout_marginEnd="4dp"/>
<Button
android:id="@+id/btn_copy_log"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/copy_all"
android:textSize="12sp"
android:backgroundTint="@color/btn_success"
android:textColor="#FFFFFF"
android:textAllCaps="false"
android:layout_marginStart="4dp"/>
</LinearLayout>
<!-- Version Footer -->
<View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/divider_color" android:layout_marginTop="32dp" android:layout_marginBottom="8dp"/>
<TextView
android:id="@+id/version_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="v0.1.17alpha"
android:textColor="@color/text_muted"
android:textSize="10sp"
android:paddingBottom="16dp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>