Guruh: 653-21 Nazariy qism: Layout turlari va ular haqida qisqa ma’lumot




Download 493,26 Kb.
bet2/4
Sana15.05.2024
Hajmi493,26 Kb.
#236557
1   2   3   4
Bog'liq
Mobil ilovalar2

MainActivity.java:
package com.example.dedline_2;
import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;


public class MainActivity extends AppCompatActivity {


Button loginButton, signUpButton;


@Override


protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
loginButton = findViewById(R.id.loginButton); signUpButton = findViewById(R.id.signUpButton);

loginButton.setOnClickListener(new View.OnClickListener() {


@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
startActivity(intent);
}
});
signUpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), SignUpActivity.class);
startActivity(intent);
}
});
}
}


activity_login.xml:

android:padding="16dp">
android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="24dp" android:text="Login" android:textColor="#C61616" android:textSize="30sp" />


android:id="@+id/loginEmail" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Email" android:textColor="#000000"
android:inputType="textEmailAddress" />


android:id="@+id/loginPassword" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:hint="Password" android:textColor="#000000"
android:inputType="textPassword" />



Download 493,26 Kb.
1   2   3   4




Download 493,26 Kb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Guruh: 653-21 Nazariy qism: Layout turlari va ular haqida qisqa ma’lumot

Download 493,26 Kb.