Android App Development | Lecture#23 | Hive Learners

Words
275
Reading
2 min
Listen
Play
4y

饾摉饾摶饾摦饾摦饾摻饾摬饾摲饾摪饾摷

Hello dear Hive Learners, Welcome to the 23rd lecture on Android App Development. Today we will add some visuals of our widgets, We will also navigate from one screen to another. In android, we always notice that when we click on the sign-in button it will take us to a sign-in page and the same for the signup page it will open the signup page. All the buttons that we have created can have a separate page. So let's jump into it.

alt

GitHub Link

Use this GitHub project to clone into your directory. It will constantly get updated in the following lecture so you will never miss the latest code. Happy Coding!.

What Should I Learn

  • Add vectors to widgets
  • Navigate through screens

Assignment

  • Implement screen navigation

Procedure

First of all, we will add vectors to our project. Android studio provides us with some built-in vectors. Open this file structure to add a new vector.

res>right_click>new>Vector Asset

alt

We need vectors for username, email, and password. So we add them one by one and also use the black color.

alt

For username, I am choosing this vector.

alt

alt

alt

Also, add email and password vectors.

alt

alt

Now we need to add these vectors to our design code. Here I add the email vector to the sign-in page. We do the same for all the Edittext fields.

                android:drawableStart="@drawable/ic_baseline_email_24"
                android:drawablePadding="4dp"

alt

alt

Now we implement the screen navigation code on the already_act_btn. Implement the code and run the app and click the button it will open the SignIn_Activity.

 already_act_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(MainActivity.this, SignIn_Activity.class));

            }
        });

alt

If we get an error on run. We need to add these two lines of code in the gradle.properties file as shown here.

android.useAndroidX=true
android.enableJetifier=true

alt

hl_divider.png

Thank You

hl_footer_banner.png

Android App Development | Lecture#23 | Hive Learners | Ecency