Design implementation
This commit is contained in:
parent
1d8d8cd45e
commit
7e7ca3533c
@ -4,9 +4,12 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
import android.widget.PopupMenu;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import ru.visionlab.femdemo.login.LoginActivity;
|
import ru.visionlab.femdemo.login.LoginActivity;
|
||||||
import ru.visionlab.femdemo.register.RegisterActivityNew;
|
import ru.visionlab.femdemo.register.RegisterActivityNew;
|
||||||
@ -14,6 +17,7 @@ import ru.visionlab.femdemo.register.RegisterActivityNew;
|
|||||||
public class CheckInActivity extends AppCompatActivity {
|
public class CheckInActivity extends AppCompatActivity {
|
||||||
|
|
||||||
ImageView logout;
|
ImageView logout;
|
||||||
|
ImageView menu;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -29,5 +33,24 @@ public class CheckInActivity extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
menu = findViewById(R.id.menu);
|
||||||
|
menu.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
PopupMenu popupMenu = new PopupMenu(CheckInActivity.this, menu);
|
||||||
|
popupMenu.getMenuInflater().inflate(R.menu.navigation_menu, popupMenu.getMenu());
|
||||||
|
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onMenuItemClick(MenuItem menuItem) {
|
||||||
|
// Toast message on menu item clicked
|
||||||
|
Toast.makeText(CheckInActivity.this, "You Clicked " + menuItem.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Showing the popup menu
|
||||||
|
popupMenu.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -455,4 +455,9 @@ public class LoginActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed () {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -6,7 +6,9 @@ import android.content.Intent;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import ru.visionlab.femdemo.CheckInActivity;
|
import ru.visionlab.femdemo.CheckInActivity;
|
||||||
import ru.visionlab.femdemo.R;
|
import ru.visionlab.femdemo.R;
|
||||||
@ -18,18 +20,37 @@ public class LoginActivityNew extends AppCompatActivity {
|
|||||||
|
|
||||||
ImageButton back;
|
ImageButton back;
|
||||||
|
|
||||||
|
EditText edt_empId,edt_pass;
|
||||||
|
String empId = "", pass = "";
|
||||||
|
|
||||||
|
boolean isAllFieldsChecked = false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_login_new);
|
setContentView(R.layout.activity_login_new);
|
||||||
|
|
||||||
|
edt_empId = findViewById(R.id.edt_empId);
|
||||||
|
edt_pass = findViewById(R.id.edt_pass);
|
||||||
|
|
||||||
|
empId = edt_empId.getText().toString().trim();
|
||||||
|
pass = edt_pass.getText().toString().trim();
|
||||||
|
|
||||||
|
System.out.println("value of emp and pass " + empId + " " + pass);
|
||||||
|
|
||||||
btnSignin = findViewById(R.id.btnSignin);
|
btnSignin = findViewById(R.id.btnSignin);
|
||||||
|
|
||||||
btnSignin.setOnClickListener(new View.OnClickListener() {
|
btnSignin.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
isAllFieldsChecked = CheckAllFields();
|
||||||
|
if(isAllFieldsChecked) {
|
||||||
Intent intent = new Intent(LoginActivityNew.this, CheckInActivity.class);
|
Intent intent = new Intent(LoginActivityNew.this, CheckInActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -41,5 +62,22 @@ public class LoginActivityNew extends AppCompatActivity {
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private boolean CheckAllFields() {
|
||||||
|
if (edt_empId.length() == 0) {
|
||||||
|
edt_empId.setError("This field is required");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (edt_pass.length() == 0) {
|
||||||
|
edt_pass.setError("This field is required");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// after all validation return true.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,20 +5,46 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
|
import ru.visionlab.femdemo.CheckInActivity;
|
||||||
import ru.visionlab.femdemo.R;
|
import ru.visionlab.femdemo.R;
|
||||||
import ru.visionlab.femdemo.login.LoginActivity;
|
import ru.visionlab.femdemo.login.LoginActivity;
|
||||||
|
import ru.visionlab.femdemo.login.LoginActivityNew;
|
||||||
|
|
||||||
public class RegisterActivityNew extends AppCompatActivity {
|
public class RegisterActivityNew extends AppCompatActivity {
|
||||||
|
|
||||||
ImageButton back_img;
|
ImageButton back_img;
|
||||||
|
|
||||||
|
EditText edt_comp,edt_emp,edt_otp;
|
||||||
|
|
||||||
|
boolean isAllFieldsChecked = false;
|
||||||
|
|
||||||
|
Button verifynproceed;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_register_new);
|
setContentView(R.layout.activity_register_new);
|
||||||
|
|
||||||
|
edt_comp = findViewById(R.id.edt_comp);
|
||||||
|
edt_emp = findViewById(R.id.edt_emp);
|
||||||
|
edt_otp = findViewById(R.id.edt_otp);
|
||||||
|
|
||||||
|
verifynproceed = findViewById(R.id.verifynproceed);
|
||||||
|
verifynproceed.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
isAllFieldsChecked = CheckAllFields();
|
||||||
|
if(isAllFieldsChecked) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
back_img = findViewById(R.id.back_img);
|
back_img = findViewById(R.id.back_img);
|
||||||
back_img.setOnClickListener(new View.OnClickListener() {
|
back_img.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -28,4 +54,23 @@ public class RegisterActivityNew extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean CheckAllFields() {
|
||||||
|
if (edt_comp.length() == 0) {
|
||||||
|
edt_comp.setError("This field is required");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (edt_emp.length() == 0) {
|
||||||
|
edt_emp.setError("This field is required");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (edt_otp.length() == 0) {
|
||||||
|
edt_otp.setError("This field is required");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// after all validation return true.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#0E0F11"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||||
|
</vector>
|
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#0E0F11"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/>
|
||||||
|
</vector>
|
@ -10,6 +10,7 @@
|
|||||||
android:padding="15dp">
|
android:padding="15dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/menu"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
|
@ -106,6 +106,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/edt_empId"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="54dp"
|
android:layout_height="54dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
@ -116,9 +117,11 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:background="@drawable/custom_input"
|
android:background="@drawable/custom_input"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:layout_marginTop="18dp"/>
|
android:layout_marginTop="18dp"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/edt_pass"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="54dp"
|
android:layout_height="54dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
@ -130,6 +133,7 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:background="@drawable/custom_input"
|
android:background="@drawable/custom_input"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:layout_marginTop="18dp"/>
|
android:layout_marginTop="18dp"/>
|
||||||
|
|
||||||
<!--<com.google.android.material.textfield.TextInputLayout
|
<!--<com.google.android.material.textfield.TextInputLayout
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
android:layout_marginTop="2dp"/>
|
android:layout_marginTop="2dp"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/edt_comp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="54dp"
|
android:layout_height="54dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
@ -65,8 +66,10 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:background="@drawable/custom_input"
|
android:background="@drawable/custom_input"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:layout_marginTop="37dp"/>
|
android:layout_marginTop="37dp"/>
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/edt_emp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="54dp"
|
android:layout_height="54dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
@ -77,9 +80,11 @@
|
|||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:background="@drawable/custom_input"
|
android:background="@drawable/custom_input"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:layout_marginTop="18dp"/>
|
android:layout_marginTop="18dp"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/edt_otp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="54dp"
|
android:layout_height="54dp"
|
||||||
android:layout_marginTop="18dp"
|
android:layout_marginTop="18dp"
|
||||||
@ -89,8 +94,10 @@
|
|||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:hint="OTP"
|
android:hint="OTP"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold"
|
||||||
|
android:inputType="number"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/verifynproceed"
|
android:id="@+id/verifynproceed"
|
||||||
|
@ -1,18 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!--xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:ignore="HardcodedText">
|
tools:ignore="HardcodedText">-->
|
||||||
|
|
||||||
|
<!--<item
|
||||||
|
android:id="@+id/home"
|
||||||
|
android:icon="@drawable/otp"
|
||||||
|
android:title="Home"
|
||||||
|
app:showAsAction="always" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/home"
|
android:id="@+id/profile"
|
||||||
android:title="Home" />
|
android:icon="@drawable/lock"
|
||||||
|
android:title="Profile"
|
||||||
|
/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/overflowMenu"
|
||||||
|
android:icon="@drawable/phone"
|
||||||
|
android:title="Menu"
|
||||||
|
app:showAsAction="always">
|
||||||
|
|
||||||
|
<menu>
|
||||||
|
<item
|
||||||
|
android:id="@+id/menuWithIconText"
|
||||||
|
android:icon="@drawable/user1"
|
||||||
|
android:title="Andrew Bahl"
|
||||||
|
/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/attendance"
|
android:id="@+id/attendance"
|
||||||
android:title="Attendance" />
|
android:icon="@drawable/back"
|
||||||
|
android:title="Log out" />
|
||||||
|
</menu>
|
||||||
|
</item>
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/nav_logout"
|
|
||||||
android:title="My profile" />
|
|
||||||
|
|
||||||
</menu>
|
</menu>
|
Loading…
x
Reference in New Issue
Block a user