|
|
|
@ -10,6 +10,8 @@ import android.os.Looper;
|
|
|
|
|
import android.util.Log; |
|
|
|
|
import android.view.View; |
|
|
|
|
import android.widget.ImageView; |
|
|
|
|
import android.widget.TextView; |
|
|
|
|
import android.widget.Toast; |
|
|
|
|
|
|
|
|
|
import androidx.activity.result.ActivityResultLauncher; |
|
|
|
|
import androidx.activity.result.contract.ActivityResultContracts; |
|
|
|
@ -48,6 +50,8 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
private EventLogDetailed eventLogDetailed; |
|
|
|
|
private String status; |
|
|
|
|
|
|
|
|
|
private TextView testText; |
|
|
|
|
|
|
|
|
|
//private Toolbar toolbar;
|
|
|
|
|
private SliderLayout sliderLayout; |
|
|
|
|
ActivityResultLauncher<Intent> icVerificationLauncher = registerForActivityResult( |
|
|
|
@ -90,6 +94,10 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
setContentView(R.layout.activity_main); |
|
|
|
|
|
|
|
|
|
sliderLayout = findViewById(R.id.slider_layout_ma); |
|
|
|
|
sliderLayout.setVisibility(View.INVISIBLE); //todo until get good image
|
|
|
|
|
|
|
|
|
|
testText = findViewById(R.id.testText); |
|
|
|
|
|
|
|
|
|
load = findViewById(R.id.loading_image_mt); |
|
|
|
|
setupTextSlider(); |
|
|
|
|
|
|
|
|
@ -133,7 +141,8 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
|
|
|
|
|
private void initViews() { |
|
|
|
|
runOnUiThread(() -> { |
|
|
|
|
sliderLayout.setVisibility(View.GONE); |
|
|
|
|
sliderLayout.setVisibility(View.INVISIBLE); |
|
|
|
|
testText.setVisibility(View.INVISIBLE); |
|
|
|
|
animationDrawable = (AnimationDrawable) load.getDrawable(); |
|
|
|
|
animationDrawable.start(); |
|
|
|
|
load.setVisibility(View.VISIBLE); |
|
|
|
@ -145,7 +154,8 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
this.eventLogDetailed = null; |
|
|
|
|
|
|
|
|
|
runOnUiThread(() -> { |
|
|
|
|
sliderLayout.setVisibility(View.VISIBLE); |
|
|
|
|
//sliderLayout.setVisibility(View.VISIBLE);
|
|
|
|
|
testText.setVisibility(View.VISIBLE); |
|
|
|
|
load.setVisibility(View.GONE); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -396,6 +406,7 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
String savedNo = this.eventLogDetailed.getDocumentNumber().trim(); |
|
|
|
|
if (!cardNo.contains(savedNo)) { |
|
|
|
|
match = false; |
|
|
|
|
Toast.makeText(MainActivity.this, "Card Number not correct!", Toast.LENGTH_SHORT).show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Verify Name...
|
|
|
|
@ -404,6 +415,7 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
for (String s : firstNames) { |
|
|
|
|
if (!name.contains(s)) { |
|
|
|
|
match = false; |
|
|
|
|
Toast.makeText(MainActivity.this, "First Name not found", Toast.LENGTH_SHORT).show(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -413,10 +425,14 @@ public class MainActivity extends AppCompatActivity implements CallableInterface
|
|
|
|
|
for (String s : lastName) { |
|
|
|
|
if (!name.contains(s)) { |
|
|
|
|
match = false; |
|
|
|
|
Toast.makeText(MainActivity.this, "Last Name not found", Toast.LENGTH_SHORT).show(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (match) { |
|
|
|
|
Toast.makeText(MainActivity.this, "NRIC match!", Toast.LENGTH_SHORT).show(); |
|
|
|
|
} |
|
|
|
|
return match; |
|
|
|
|
} |
|
|
|
|
} |