Display licence verification status

This commit is contained in:
Apalak Dutta 2023-06-19 16:17:12 +05:30
parent c80dc745a0
commit ffa34bd808
2 changed files with 32 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import android.hardware.Camera;
import android.os.Bundle; import android.os.Bundle;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.widget.LinearLayoutCompat;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
@ -75,6 +76,7 @@ public class LoginActivity extends BaseActivity {
String user = ""; String user = "";
Button login_new; Button login_new;
Button reg_new; Button reg_new;
LinearLayoutCompat lay_licence_verify;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
@ -85,6 +87,8 @@ public class LoginActivity extends BaseActivity {
//login = findViewById(R.id.login); //login = findViewById(R.id.login);
register = findViewById(R.id.register); register = findViewById(R.id.register);
lay_licence_verify = findViewById(R.id.lay_licence_verify);
login_new = findViewById(R.id.login_new); login_new = findViewById(R.id.login_new);
login_new.setOnClickListener(new View.OnClickListener() { login_new.setOnClickListener(new View.OnClickListener() {
@ -114,7 +118,10 @@ public class LoginActivity extends BaseActivity {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(status -> { .subscribe(status -> {
preferences.setFirstRun(false); preferences.setFirstRun(false);
System.out.println("Value of status "+ status);
sdkResult = status; sdkResult = status;
System.out.println("Value of sdkResult "+ sdkResult);
showSDKStatus(); showSDKStatus();
finishSplashScreen(); finishSplashScreen();
} }
@ -153,6 +160,7 @@ public class LoginActivity extends BaseActivity {
} }
private void showSDKStatus() { private void showSDKStatus() {
System.out.println("Inside sdk status " + sdkResult);
switch (sdkResult) { switch (sdkResult) {
case -1: { case -1: {
Toast.makeText(this, "Failed to unzip resources!", Toast.LENGTH_SHORT).show(); Toast.makeText(this, "Failed to unzip resources!", Toast.LENGTH_SHORT).show();
@ -160,6 +168,7 @@ public class LoginActivity extends BaseActivity {
} }
case 0: { case 0: {
Log.d(TAG, "Face engine were succesfully created " + getFilesDir() + "/vl/data"); Log.d(TAG, "Face engine were succesfully created " + getFilesDir() + "/vl/data");
lay_licence_verify.setVisibility(View.VISIBLE);
break; break;
} }
case 1: { case 1: {

View File

@ -16,6 +16,7 @@
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:scrollbars="none"> android:scrollbars="none">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -99,6 +100,28 @@
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:textAllCaps="false"/> android:textAllCaps="false"/>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/lay_licence_verify"
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="vertical"
android:background="#FF2E2E"
android:layout_marginTop="45dp"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:text="Please complete licence verification"
android:textStyle="bold"
android:layout_gravity="center"
android:gravity="center_vertical"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<!--<ImageView <!--<ImageView
android:layout_width="@dimen/login_logo_width" android:layout_width="@dimen/login_logo_width"
android:layout_height="@dimen/login_logo_height" android:layout_height="@dimen/login_logo_height"