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;