Newer
Older
MethaneInspection / app / src / main / res / layout / activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white">

    <ImageView
        android:id="@+id/backgroundView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="100dp"
        android:text="@string/app_name"
        android:textColor="@color/white"
        android:textSize="@dimen/sp_22" />

    <LinearLayout
        android:id="@+id/userNameLayout"
        android:layout_width="match_parent"
        android:layout_height="@dimen/titleViewHeight"
        android:layout_above="@id/userPasswordLayout"
        android:layout_marginHorizontal="@dimen/dp_50"
        android:layout_marginBottom="@dimen/dp_5"
        android:background="@drawable/bg_solid_layout_gray_radius_5"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="@dimen/dp_10"
            android:src="@drawable/ic_user" />

        <com.pengxh.kt.lite.widget.DeleteEditText
            android:id="@+id/userNameView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@null"
            android:hint="请输入账号"
            android:singleLine="true"
            android:textSize="@dimen/sp_16"
            android:theme="@style/EditTextTheme" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/userPasswordLayout"
        android:layout_width="match_parent"
        android:layout_height="@dimen/titleViewHeight"
        android:layout_above="@id/anchorView"
        android:layout_marginHorizontal="@dimen/dp_50"
        android:layout_marginTop="@dimen/dp_5"
        android:background="@drawable/bg_solid_layout_gray_radius_5"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="@dimen/dp_10"
            android:src="@drawable/ic_lock" />

        <com.pengxh.kt.lite.widget.DeleteEditText
            android:id="@+id/userPasswordView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@null"
            android:hint="请输入密码"
            android:inputType="textPassword"
            android:singleLine="true"
            android:textSize="@dimen/sp_16"
            android:theme="@style/EditTextTheme" />
    </LinearLayout>

    <View
        android:id="@+id/anchorView"
        android:layout_width="@dimen/borderThickness"
        android:layout_height="@dimen/borderThickness"
        android:layout_centerInParent="true" />

    <Button
        android:id="@+id/loginButton"
        style="@style/MainButtonStyle"
        android:layout_below="@id/anchorView"
        android:layout_marginHorizontal="@dimen/dp_50"
        android:layout_marginTop="@dimen/dp_30"
        android:text="登\u3000\u3000录" />

    <Button
        android:id="@+id/singleModeView"
        style="@style/WhiteButtonStyle"
        android:layout_below="@id/loginButton"
        android:layout_marginHorizontal="@dimen/dp_50"
        android:layout_marginTop="@dimen/dp_10"
        android:text="本地模式使用" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/changeServerConfigView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:layout_marginEnd="20dp"
        android:layout_marginBottom="20dp"
        android:backgroundTint="@color/white"
        android:contentDescription="修改服务器地址"
        android:src="@drawable/ic_settings"
        app:borderWidth="0dp"
        app:fabSize="mini" />
</RelativeLayout>