Redesign WifiP2pDialog using design lib

This commit is contained in:
Mygod
2018-04-24 22:48:34 -07:00
parent c7a45e215e
commit 39cd40627f
5 changed files with 37 additions and 110 deletions

View File

@@ -12,6 +12,7 @@
limitations under the License.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="300sp"
android:layout_height="wrap_content"
android:fadeScrollbars="false">
@@ -20,74 +21,38 @@
android:layout_height="wrap_content"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:orientation="vertical">
<LinearLayout android:id="@+id/info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_section" />
<LinearLayout android:id="@+id/type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_section">
<LinearLayout
style="@style/wifi_item">
<android.support.design.widget.TextInputLayout
android:id="@+id/ssid_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dip"
android:layout_marginBottom="8dip">
<android.support.design.widget.TextInputEditText
android:id="@+id/ssid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_label"
android:layout_marginTop="8dip"
android:text="@string/wifi_ssid" />
<EditText android:id="@+id/ssid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_edit_content"
android:hint="@string/wifi_ssid_hint"
android:inputType="textMultiLine|textNoSuggestions"
android:maxLength="32" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:id="@+id/fields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_section">
<LinearLayout
style="@style/wifi_item_edit_content"
android:hint="@string/wifi_ssid"
android:inputType="textMultiLine|textNoSuggestions"
android:maxLength="32" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/password_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
app:errorEnabled="true">
<android.support.design.widget.TextInputEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_label"
android:layout_marginTop="8dip"
android:text="@string/wifi_password" />
<EditText android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_edit_content"
android:singleLine="true"
android:inputType="textPassword"
android:maxLength="63"
android:imeOptions="flagForceAscii" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item">
<TextView android:id="@+id/hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_label"
android:text="@string/credentials_password_too_short"
android:layout_marginTop="8dip"
android:layout_marginBottom="10sp"/>
<CheckBox android:id="@+id/show_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item_content"
android:text="@string/wifi_show_password" />
</LinearLayout>
</LinearLayout>
style="@style/wifi_item_edit_content"
android:singleLine="true"
android:hint="@string/wifi_password"
android:inputType="textPassword"
android:maxLength="63"
android:imeOptions="flagForceAscii" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</ScrollView>

View File

@@ -77,9 +77,7 @@
<string name="noisy_su_failure">发生异常,详情请查看调试信息。</string>
<string name="wifi_ssid" msgid="5519636102673067319">"网络名称"</string>
<string name="wifi_ssid_hint" msgid="897593601067321355">"输入 SSID"</string>
<string name="wifi_password" msgid="5948219759936151048">"密码"</string>
<string name="wifi_show_password" msgid="6461249871236968884">"显示密码"</string>
<string name="credentials_password_too_short" msgid="7502749986405522663">"密码至少应包含 8 个字符。"</string>
<string name="wifi_save" msgid="3331121567988522826">"保存"</string>
<string name="wifi_cancel" msgid="6763568902542968964">"取消"</string>

View File

@@ -82,9 +82,7 @@
<string name="noisy_su_failure">Something went wrong, please check the debug information.</string>
<string name="wifi_ssid">Network name</string>
<string name="wifi_ssid_hint">Enter the SSID</string>
<string name="wifi_password">Password</string>
<string name="wifi_show_password">Show password</string>
<string name="credentials_password_too_short">The password must have at least 8 characters.</string>
<string name="wifi_save">Save</string>
<string name="wifi_cancel">Cancel</string>

View File

@@ -23,25 +23,10 @@
<item name="android:orientation">vertical</item>
<item name="android:gravity">start</item>
</style>
<style name="wifi_item_label">
<item name="android:paddingStart">8dip</item>
<item name="android:textSize">14sp</item>
<item name="android:textAlignment">viewStart</item>
<item name="android:textAppearance">@android:style/TextAppearance.Material.Body1</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>
<style name="wifi_item_edit_content">
<item name="android:paddingStart">4dip</item>
<item name="android:layout_marginStart">4dip</item>
<item name="android:textSize">18sp</item>
</style>
<style name="wifi_section">
<item name="android:orientation">vertical</item>
</style>
<style name="wifi_item_content">
<item name="android:textAlignment">viewStart</item>
<item name="android:textAppearance">@android:style/TextAppearance.Material.Subhead</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
</resources>