Tools: context=


Download 1.5 Mb.
bet1/5
Sana27.03.2023
Hajmi1.5 Mb.
#1300986
  1   2   3   4   5
Bog'liq
apk



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"
android:background="@drawable/background"
tools:context=".MainActivity">

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/signin"
android:text="Sign in"
android:textColor="@color/white"
android:textSize="35dp"
android:layout_margin="50dp"
android:gravity="center"

/>

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/username"
android:layout_below="@id/signin"
android:background="#30ffffff"
android:hint="User name"
android:textColorHint="@color/white"
android:textColor="@color/white"
android:layout_margin="10dp"
android:padding="20dp"
android:drawableLeft="@drawable/ic_baseline_person_24"
android:drawablePadding="20dp"
/>

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/password"
android:layout_below="@id/username"
android:background="#30ffffff"
android:hint="Password"
android:textColorHint="@color/white"
android:textColor="@color/white"
android:layout_margin="10dp"
android:padding="20dp"
android:drawableLeft="@drawable/ic_baseline_info_24"
android:drawablePadding="20dp"
android:inputType="textPassword"
/>

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/loginbtn"
android:layout_below="@id/password"
android:text="LOGIN"
android:backgroundTint="@color/teal_700"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/forgotpass"
android:layout_below="@id/loginbtn"
android:text="Forgot password ?"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/other"
android:layout_above="@id/socialicon"
android:text="or sign in with"
android:textColor="@color/white"
android:layout_centerHorizontal="true"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/socialicon"
android:layout_alignParentBottom="true"
android:gravity="center">

android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="20dp"
android:src="@drawable/gog"

/>

android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="20dp"
android:src="@drawable/twit"

/>

android:layout_width="48dp"
android:layout_height="48dp"
android:layout_margin="20dp"
android:src="@drawable/ins"

/>




package com.example.myloginapp;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.button.MaterialButton;

public class MainActivity extends AppCompatActivity {

@Override


protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

TextView username = (TextView) findViewById(R.id.username);


TextView password = (TextView) findViewById(R.id.password);

Button loginbtn = (MaterialButton) findViewById(R.id.loginbtn);


// admin and admin
loginbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(username.getText().toString().equals("admin")&& password.getText().toString().equals("admin"));
//correct password
Toast.makeText(MainActivity.this,"LOGIN SUCCESSFULL",Toast.LENGTH_LONG).show();
}
//incorrect
});

}
}






xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">

android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

android:layout_width="match_parent"
android:layout_height="wrap_content" />

app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent" />

app:layout_anchor="@id/agenda_view"
app:layout_anchorGravity="bottom|right|end"
android:layout_margin="@dimen/fab_margin"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />




android:id="@+id/drawer"
android:layout_gravity="start"
android:orientation="vertical"
android:background="?android:attr/colorBackground"
android:divider="@drawable/horizontal_divider"
android:showDividers="middle"

android:layout_height="match_parent">



android:text="@string/calendars"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:gravity="center_vertical"
android:paddingLeft="@dimen/horizontal_padding"
android:paddingRight="@dimen/horizontal_padding"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />

android:id="@+id/list_view_calendar"
android:divider="@color/colorDivider"
android:dividerHeight="@dimen/divider_size"
android:layout_width="match_parent"
android:layout_height="match_parent" />





android:id="@+id/empty"
android:inflatedId="@+id/empty"
android:layout="@layout/empty_permission"
android:layout_width="match_parent"
android:layout_height="match_parent" />


package mn.today;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;


import java.util.LinkedList;
import java.util.UUID;


Download 1.5 Mb.

Do'stlaringiz bilan baham:
  1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling