Android - Como utilizar TextInputLayout con androidX

 
Vista:

Como utilizar TextInputLayout con androidX

Publicado por dwins (1 intervención) el 20/01/2021 23:34:32
Intento utilizar los efectos de TextInputLayout para una version de SDK 30 utilizando las librerias de androidx. Sin embargo al escribir el codigo de TextImputLayout en XML del Layout la aplicacion deja de funcionar. Ya intente incluir las librerias de soporte que se usaban antes del SDK 28, pero no corrige nada. Este es el codigo del Layout:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activities.LoginActivity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1">
 
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.7"
            android:background="@drawable/gradient_green_to_white"
        >
 
            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingBottom="10dp"
                android:src="@drawable/ic_titulo_monagro2"
                />
 
        </RelativeLayout>
 
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.3"
            android:orientation="vertical">
 
        <com.google.android.material.textfield.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           >
 
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/username"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:hint="@string/hint_username"
                android:theme="@style/EdithTextWhite"
                />
            <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/password"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:hint="@string/hint_password"
                android:inputType="textPassword"
                android:theme="@style/EdithTextWhite"
                />
 
        </com.google.android.material.textfield.TextInputLayout>
            <Button
                android:id="@+id/loginButton"
                android:layout_height="wrap_content"
                android:layout_width="match_parent"
                android:text="@string/text_button_loginButton"
                android:textColor="@color/white"
                android:theme="@style/RaisedButtonDark"
                android:layout_marginHorizontal="40dp" />
 
        </LinearLayout>
 
        ></LinearLayout>
 
 
</androidx.coordinatorlayout.widget.CoordinatorLayout>


Por Favor!!! Ayuda!!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder