Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Optimize layout Histeria2
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust authored and AnGgIt86 committed Sep 29, 2024
1 parent d31085a commit e14e531
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 16 deletions.
14 changes: 7 additions & 7 deletions app/src/main/kotlin/com/neko/v2ray/ui/ServerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ class ServerActivity : BaseActivity() {
private val sp_security: Spinner? by lazy { findViewById(R.id.sp_security) }
private val sp_stream_security: Spinner? by lazy { findViewById(R.id.sp_stream_security) }
private val sp_allow_insecure: Spinner? by lazy { findViewById(R.id.sp_allow_insecure) }
private val container_allow_insecure: LinearLayout? by lazy { findViewById(R.id.l5) }
private val container_allow_insecure: LinearLayout? by lazy { findViewById(R.id.lay_allow_insecure) }
private val et_sni: EditText? by lazy { findViewById(R.id.et_sni) }
private val container_sni: LinearLayout? by lazy { findViewById(R.id.l2) }
private val container_sni: LinearLayout? by lazy { findViewById(R.id.lay_sni) }
private val sp_stream_fingerprint: Spinner? by lazy { findViewById(R.id.sp_stream_fingerprint) } //uTLS
private val container_fingerprint: LinearLayout? by lazy { findViewById(R.id.l3) }
private val container_fingerprint: LinearLayout? by lazy { findViewById(R.id.lay_stream_fingerprint) }
private val sp_network: Spinner? by lazy { findViewById(R.id.sp_network) }
private val sp_header_type: Spinner? by lazy { findViewById(R.id.sp_header_type) }
private val sp_header_type_title: TextView? by lazy { findViewById(R.id.sp_header_type_title) }
Expand All @@ -121,13 +121,13 @@ class ServerActivity : BaseActivity() {
private val tv_path: TextInputLayout? by lazy { findViewById(R.id.tv_path) }
private val et_path: EditText? by lazy { findViewById(R.id.et_path) }
private val sp_stream_alpn: Spinner? by lazy { findViewById(R.id.sp_stream_alpn) } //uTLS
private val container_alpn: LinearLayout? by lazy { findViewById(R.id.l4) }
private val container_alpn: LinearLayout? by lazy { findViewById(R.id.lay_stream_alpn) }
private val et_public_key: EditText? by lazy { findViewById(R.id.et_public_key) }
private val container_public_key: LinearLayout? by lazy { findViewById(R.id.l6) }
private val container_public_key: LinearLayout? by lazy { findViewById(R.id.lay_public_key) }
private val et_short_id: EditText? by lazy { findViewById(R.id.et_short_id) }
private val container_short_id: LinearLayout? by lazy { findViewById(R.id.l7) }
private val container_short_id: LinearLayout? by lazy { findViewById(R.id.lay_short_id) }
private val et_spider_x: EditText? by lazy { findViewById(R.id.et_spider_x) }
private val container_spider_x: LinearLayout? by lazy { findViewById(R.id.l8) }
private val container_spider_x: LinearLayout? by lazy { findViewById(R.id.lay_spider_x) }
private val et_reserved1: EditText? by lazy { findViewById(R.id.et_reserved1) }
private val et_reserved2: EditText? by lazy { findViewById(R.id.et_reserved2) }
private val et_reserved3: EditText? by lazy { findViewById(R.id.et_reserved3) }
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_server_hysteria2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<include layout="@layout/layout_tls" />
<include layout="@layout/layout_tls_hysteria2" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/layout/layout_tls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:orientation="vertical"
android:id="@+id/l1"
android:id="@+id/lay_stream_security"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand All @@ -28,7 +28,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l2"
android:id="@+id/lay_sni"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0.0dip"
Expand All @@ -48,7 +48,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l3"
android:id="@+id/lay_stream_fingerprint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand All @@ -70,7 +70,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l4"
android:id="@+id/lay_stream_alpn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand All @@ -92,7 +92,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l5"
android:id="@+id/lay_allow_insecure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand All @@ -113,7 +113,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l6"
android:id="@+id/lay_public_key"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand All @@ -133,7 +133,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l7"
android:id="@+id/lay_short_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand All @@ -153,7 +153,7 @@
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/l8"
android:id="@+id/lay_spider_x"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
Expand Down
70 changes: 70 additions & 0 deletions app/src/main/res/layout/layout_tls_hysteria2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:orientation="vertical"
android:id="@+id/lay_stream_security"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
android:layout_marginBottom="16.0dip">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/server_lab_stream_security" />
<Spinner
android:entries="@array/streamsecuritys"
android:id="@+id/sp_stream_security"
android:background="@drawable/uwu_bg_spinner"
android:focusable="true"
android:nextFocusDown="@+id/et_sni"
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="@dimen/edit_height"
android:foreground="?android:selectableItemBackground" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/lay_sni"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="0.0dip"
android:layout_marginBottom="8.0dip">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/server_lab_sni"
style="@style/Outline_TextInputLayout">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/et_sni"
android:nextFocusDown="@+id/sp_stream_fingerprint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:id="@+id/lay_allow_insecure"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8.0dip"
android:layout_marginBottom="16.0dip">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/server_lab_allow_insecure" />
<Spinner
android:entries="@array/allowinsecures"
android:id="@+id/sp_allow_insecure"
android:background="@drawable/uwu_bg_spinner"
android:focusable="true"
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="@dimen/edit_height"
android:foreground="?android:selectableItemBackground" />
</LinearLayout>
</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/resource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<item></item>
<item>tls</item>
</string-array>

<string-array name="streamsecurityxs" translatable="false">
<item></item>
<item>tls</item>
Expand Down

0 comments on commit e14e531

Please sign in to comment.