Face verification
This commit is contained in:
parent
383e448898
commit
45a0b864f3
@ -5,6 +5,7 @@ import android.content.Intent;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -115,7 +116,7 @@ public class AuthenticationActivity extends ToolbarActivity implements PinFragme
|
|||||||
|
|
||||||
// to make the Navigation drawer icon always appear on the action bar
|
// to make the Navigation drawer icon always appear on the action bar
|
||||||
|
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
// getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
login = getIntent().getStringExtra(USER_NAME);
|
login = getIntent().getStringExtra(USER_NAME);
|
||||||
face = findViewById(R.id.face);
|
face = findViewById(R.id.face);
|
||||||
@ -123,7 +124,11 @@ public class AuthenticationActivity extends ToolbarActivity implements PinFragme
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
System.out.println("Clicked face");
|
System.out.println("Clicked face");
|
||||||
|
setSelectedTab(v);
|
||||||
|
showFaceAuth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
/*if (TextUtils.isEmpty(login)) {
|
/*if (TextUtils.isEmpty(login)) {
|
||||||
finish();
|
finish();
|
||||||
@ -223,7 +228,7 @@ public class AuthenticationActivity extends ToolbarActivity implements PinFragme
|
|||||||
|
|
||||||
private void unselectTabs() {
|
private void unselectTabs() {
|
||||||
face.setActivated(false);
|
face.setActivated(false);
|
||||||
finger.setActivated(false);
|
// finger.setActivated(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSelectedTab(View view) {
|
private void setSelectedTab(View view) {
|
||||||
@ -231,22 +236,25 @@ public class AuthenticationActivity extends ToolbarActivity implements PinFragme
|
|||||||
view.setActivated(true);
|
view.setActivated(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@OnClick({R.id.face})
|
@OnClick({R.id.face})
|
||||||
public void onFaceClick(View view) {
|
public void onFaceClick(View view) {
|
||||||
System.out.println("Clicked face");
|
System.out.println("Clicked face1");
|
||||||
setSelectedTab(view);
|
setSelectedTab(view);
|
||||||
showFaceAuth();
|
showFaceAuth();
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void showFaceAuth() {
|
private void showFaceAuth() {
|
||||||
|
System.out.println("Inside showFaceAuth");
|
||||||
|
preferences.setNeedPortrait(false);
|
||||||
if (photoFragment == null) {
|
if (photoFragment == null) {
|
||||||
photoFragment = PhotoFragment.newInstance();
|
photoFragment = PhotoFragment.newInstance();
|
||||||
photoFragment.setListener(this);
|
photoFragment.setListener(this);
|
||||||
photoFragment.setPhotoProcessor(photoProcessor);
|
photoFragment.setPhotoProcessor(photoProcessor);
|
||||||
photoFragment.enableLivenessCheck(preferences.getLivenessAuth());
|
photoFragment.enableLivenessCheck(false);
|
||||||
}
|
}
|
||||||
preferences.setStartTime(String.valueOf(System.currentTimeMillis()));
|
preferences.setStartTime(String.valueOf(System.currentTimeMillis()));
|
||||||
preferences.setNeedPortrait(true);
|
|
||||||
showFragment(photoFragment);
|
showFragment(photoFragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ import ru.visionlab.femdemo.CheckInActivity;
|
|||||||
import ru.visionlab.femdemo.R;
|
import ru.visionlab.femdemo.R;
|
||||||
import ru.visionlab.femdemo.api.CallApiService;
|
import ru.visionlab.femdemo.api.CallApiService;
|
||||||
import ru.visionlab.femdemo.api.JsonPlaceHolderApi;
|
import ru.visionlab.femdemo.api.JsonPlaceHolderApi;
|
||||||
|
import ru.visionlab.femdemo.authentication.AuthenticationActivity;
|
||||||
import ru.visionlab.femdemo.models.RegistrationNew;
|
import ru.visionlab.femdemo.models.RegistrationNew;
|
||||||
import ru.visionlab.femdemo.models.Users;
|
import ru.visionlab.femdemo.models.Users;
|
||||||
import ru.visionlab.femdemo.register.RegisterActivityNew;
|
import ru.visionlab.femdemo.register.RegisterActivityNew;
|
||||||
@ -67,9 +68,9 @@ public class LoginActivityNew extends AppCompatActivity {
|
|||||||
|
|
||||||
isAllFieldsChecked = CheckAllFields();
|
isAllFieldsChecked = CheckAllFields();
|
||||||
if(isAllFieldsChecked) {
|
if(isAllFieldsChecked) {
|
||||||
login();
|
// login();
|
||||||
/*Intent intent = new Intent(LoginActivityNew.this, CheckInActivity.class);
|
Intent intent = new Intent(LoginActivityNew.this, AuthenticationActivity.class);
|
||||||
startActivity(intent);*/
|
startActivity(intent);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,13 @@ public class RegistrationNew {
|
|||||||
private String employeeId;
|
private String employeeId;
|
||||||
private String otp;
|
private String otp;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RegistrationNew(String companyId, String employeeId, String otp) {
|
public RegistrationNew(String companyId, String employeeId, String otp) {
|
||||||
this.companyId = companyId;
|
this.companyId = companyId;
|
||||||
this.employeeId = employeeId;
|
this.employeeId = employeeId;
|
||||||
this.otp = otp;
|
this.otp = otp;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCompanyId() {
|
public String getCompanyId() {
|
||||||
@ -35,4 +38,6 @@ public class RegistrationNew {
|
|||||||
public void setOtp(String otp) {
|
public void setOtp(String otp) {
|
||||||
this.otp = otp;
|
this.otp = otp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
style="@style/TabStyle"
|
style="@style/TabStyle"
|
||||||
android:id="@+id/face"
|
android:id="@+id/face"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:enabled="false"
|
android:enabled="true"
|
||||||
android:text="@string/auth_face_tab_title"
|
android:text="@string/auth_face_tab_title"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user