|
Guruh: 653-21 Nazariy qism: Layout turlari va ular haqida qisqa ma’lumot
|
bet | 2/4 | Sana | 15.05.2024 | Hajmi | 493,26 Kb. | | #236557 |
Bog'liq Mobil ilovalar2MainActivity.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" />
android:id="@+id/buttonLogin" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" android:text="Login" />
|
| |