current position:Home>Android enterprise combat - Interface - 5

Android enterprise combat - Interface - 5

2022-01-27 04:17:51 Jimeng doesn't eat fish

This is my participation 8 The fourth of the yuegengwen challenge 17 God , Check out the activity details :8 Yuegengwen challenge

List of articles

Android Enterprise level actual combat - Interface -5


Ji Meng's creation is not easy , Other platforms that are not settled shall be handled according to the rules of the agreement .


Preface

Some fans have just joined the company for internship , Want one Android Layout of live broadcast authentication interface , So the fifth article in this series


The following is the main body of this article

One 、 Let's take a look at the effect of implementation

 Please add a picture description  Please add a picture description  Please add a picture description

Two 、 Preparation before implementation

1.dimens.xml The contents of the document ( The same file as the first case )

No more words , Please take it from the first article

2.ids.xml The contents of the document ( This case is available )

    <item type="id" name="title_bar"/>
    <item type="id" name="back_icon"/>
    <item type="id" name="apply_info_layout"/>
    <item type="id" name="blog_avtar"/>
    <item type="id" name="tip"/>
    <item type="id" name="nickname"/>
    <item type="id" name="edit_name"/>
    <item type="id" name="edit_id"/>
    <item type="id" name="edit_phone"/>
    <item type="id" name="next"/>
    <item type="id" name="agreement_check"/>
    <item type="id" name="apply_result_layout"/>
    <item type="id" name="auth_tip"/>
    <item type="id" name="confirm"/>
    <item type="id" name="agreement"/>
 Copy code 

3.colors.xml The contents of the document ( This case is available )

    <color name="jimeng_text_tertiary_light">#ffb2b2b2</color>
    <color name="jimeng_green_light">#ff14c4bc</color>
    <color name="jimeng_gray02">@color/jimeng_text_tertiary_light</color>
    <color name="jimeng_brand_highlight_color">@color/jimeng_green_light</color>
    <color name="jimeng_gray07">@color/jimeng_background_secondary_light</color>
    <color name="jimeng_gray06">@color/jimeng_background_secondary_light</color>
    <color name="jimeng_brand_highlight_color_7f">#7f4eb7ba</color>
 Copy code 

4.strings.xml The contents of the document ( This case is available )

    <string name="detection_auth"> Real name authentication </string>
    <string name="detection_auth_tip"> According to relevant regulations , You need to pass the real name authentication to open the live studio </string>
    <string name="detection_auth_name_hint"> Please enter your real name </string>
    <string name="detection_auth_phone_hint"> Please enter your mobile number </string>
    <string name="detection_auth_id_hint"> Please enter the ID number </string>
    <string name="detection_auth_start_facedetection"> Start face authentication </string>
    <string name="detection_agreement"> agree! 《 Real name authentication protocol for live broadcast on Jimeng platform 》</string>
    <string name="auth_tip_success"> You have passed the real name certification </string>
 Copy code 

5.back_nav_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/navbar_icon_back_light" />
</selector>
 Copy code 

6.shape_detection_input_bg.xml

<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <size android:height="65.0dip" android:width="100.0dip" />
    <solid android:color="@color/jimeng_gray07" />
    <corners android:radius="32.5dip" />
</shape>
 Copy code 

3、 ... and 、 Realization

1. Top bar

    <RelativeLayout
        android:id="@id/title_bar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@id/back_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="16.0dip"
            android:src="@drawable/back_nav_selector" />

        <TextView
            android:id="@id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="@string/detection_auth"
            android:textColor="@color/jimeng_black"
            android:textSize="18.0dip" />
    </RelativeLayout>
 Copy code 

The renderings are as follows :  Please add a picture description

2. Head portrait and name

         <ImageView
                    android:id="@id/blog_avtar"
                    android:layout_width="80.0dip"
                    android:layout_height="80.0dip"
                    android:src="@drawable/venda_default_icon_jimeng"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="24.0dip"
                    android:scaleType="centerCrop" />

                <TextView
                    android:id="@id/nickname"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="10.0dip"
                    android:layout_marginRight="24.0dip"
                    android:gravity="center_horizontal"
                    android:text=" Jimeng doesn't eat fish "
                    android:textColor="@color/jimeng_black"
                    android:textSize="18.0sp" />
 Copy code 

The renderings are as follows :  Please add a picture description

3. Information input field ( Take one as an example )

                <EditText
                    android:id="@id/edit_id"
                    android:layout_width="fill_parent"
                    android:layout_height="65.0dip"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="12.0dip"
                    android:layout_marginRight="24.0dip"
                    android:background="@drawable/shape_detection_input_bg"
                    android:gravity="center_vertical"
                    android:hint="@string/detection_auth_id_hint"
                    android:paddingLeft="24.0dip"
                    android:paddingRight="24.0dip"
                    android:singleLine="true"
                    android:textColor="@color/jimeng_black"
                    android:textColorHint="@color/jimeng_gray03"
                    android:textSize="18.0sp" />
 Copy code 

The renderings are as follows :  Please add a picture description

4.CheckBox+TextView

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="24.0dip"
                    android:layout_marginRight="24.0dip"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <CheckBox
                        android:id="@id/agreement_check"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="false"
                        android:paddingRight="4.0dip" />

                    <TextView
                        android:id="@id/agreement"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:text="@string/detection_agreement"
                        android:textColor="@color/jimeng_gray02"
                        android:textSize="12.0sp" />
                </LinearLayout>
 Copy code 

The renderings are as follows :  Please add a picture description

Four . Source code

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/jimeng_white">

    <RelativeLayout
        android:id="@id/title_bar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <ImageView
            android:id="@id/back_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="16.0dip"
            android:src="@drawable/back_nav_selector" />

        <TextView
            android:id="@id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:text="@string/detection_auth"
            android:textColor="@color/jimeng_black"
            android:textSize="18.0dip" />
    </RelativeLayout>

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/title_bar"
        android:overScrollMode="never"
        android:scrollbars="none">

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <LinearLayout
                android:id="@id/apply_info_layout"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical"
                android:visibility="visible">

                <ImageView
                    android:id="@id/blog_avtar"
                    android:layout_width="80.0dip"
                    android:layout_height="80.0dip"
                    android:src="@drawable/venda_default_icon_jimeng"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="24.0dip"
                    android:scaleType="centerCrop" />

                <TextView
                    android:id="@id/nickname"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="10.0dip"
                    android:layout_marginRight="24.0dip"
                    android:gravity="center_horizontal"
                    android:text=" Jimeng doesn't eat fish "
                    android:textColor="@color/jimeng_black"
                    android:textSize="18.0sp" />

                <TextView
                    android:id="@id/tip"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="24.0dip"
                    android:text="@string/detection_auth_tip"
                    android:textColor="@color/jimeng_gray02"
                    android:textSize="13.0sp" />

                <EditText
                    android:id="@id/edit_name"
                    android:layout_width="fill_parent"
                    android:layout_height="65.0dip"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="24.0dip"
                    android:layout_marginRight="24.0dip"
                    android:background="@drawable/shape_detection_input_bg"
                    android:gravity="center_vertical"
                    android:hint="@string/detection_auth_name_hint"
                    android:paddingLeft="24.0dip"
                    android:paddingRight="24.0dip"
                    android:singleLine="true"
                    android:textColor="@color/jimeng_black"
                    android:textColorHint="@color/jimeng_gray03"
                    android:textSize="18.0sp" />

                <EditText
                    android:id="@id/edit_id"
                    android:layout_width="fill_parent"
                    android:layout_height="65.0dip"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="12.0dip"
                    android:layout_marginRight="24.0dip"
                    android:background="@drawable/shape_detection_input_bg"
                    android:gravity="center_vertical"
                    android:hint="@string/detection_auth_id_hint"
                    android:paddingLeft="24.0dip"
                    android:paddingRight="24.0dip"
                    android:singleLine="true"
                    android:textColor="@color/jimeng_black"
                    android:textColorHint="@color/jimeng_gray03"
                    android:textSize="18.0sp" />

                <EditText
                    android:id="@id/edit_phone"
                    android:layout_width="fill_parent"
                    android:layout_height="65.0dip"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="12.0dip"
                    android:layout_marginRight="24.0dip"
                    android:background="@drawable/shape_detection_input_bg"
                    android:gravity="center_vertical"
                    android:hint="@string/detection_auth_phone_hint"
                    android:paddingLeft="24.0dip"
                    android:paddingRight="24.0dip"
                    android:singleLine="true"
                    android:textColor="@color/jimeng_black"
                    android:textColorHint="@color/jimeng_gray03"
                    android:textSize="18.0sp" />

                <TextView
                    android:id="@id/next"
                    android:layout_width="fill_parent"
                    android:layout_height="50.0dip"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="24.0dip"
                    android:layout_marginRight="24.0dip"
                    android:background="@drawable/selector_apply_info_next_bg"
                    android:enabled="false"
                    android:gravity="center"
                    android:text="@string/detection_auth_start_facedetection"
                    android:textColor="@color/jimeng_gray03"
                    android:textSize="18.0sp" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="24.0dip"
                    android:layout_marginTop="24.0dip"
                    android:layout_marginRight="24.0dip"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <CheckBox
                        android:id="@id/agreement_check"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:checked="false"
                        android:paddingRight="4.0dip" />

                    <TextView
                        android:id="@id/agreement"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:text="@string/detection_agreement"
                        android:textColor="@color/jimeng_gray02"
                        android:textSize="12.0sp" />
                </LinearLayout>
            </LinearLayout>
        </RelativeLayout>
    </ScrollView>
</RelativeLayout>
 Copy code 

Be careful

In this interface, you can write a hidden layout , When the user enters this interface after authentication, this layout will be displayed gone, The authenticated prompt layout is then displayed .

summary

Welcome to leave a message , If you have any questions, you can have a private chat with Ji Meng ( When you see the news, go back to ), If you want Jimeng to update an interface article, you can also chat privately , See you in the next article .

copyright notice
author[Jimeng doesn't eat fish],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270417491679.html

Random recommended