Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pm 86 android 15 test 1 #515

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import kotlinx.coroutines.test.runTest
import net.gini.android.bank.api.models.ResolvePaymentInput
import net.gini.android.bank.api.requests.ErrorEvent
import net.gini.android.bank.api.requests.ResolvePaymentBody
import net.gini.android.bank.api.response.ConfigurationResponse
import net.gini.android.bank.api.response.ResolvePaymentResponse
import net.gini.android.core.api.response.PaymentRequestResponse
import net.gini.android.core.api.response.PaymentResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentFactory
import androidx.navigation.NavController
Expand All @@ -30,6 +31,7 @@ import net.gini.android.capture.tracking.useranalytics.UserAnalytics
import net.gini.android.capture.tracking.useranalytics.properties.UserAnalyticsEventSuperProperty
import net.gini.android.capture.tracking.useranalytics.properties.UserAnalyticsUserProperty
import net.gini.android.capture.tracking.useranalytics.tracker.AmplitudeUserAnalyticsEventTracker
import org.slf4j.LoggerFactory
import java.util.UUID


Expand Down Expand Up @@ -130,19 +132,25 @@ class GiniCaptureFragment(private val openWithDocument: Document? = null) :
navController = (childFragmentManager.fragments[0]).findNavController()
oncePerInstallEventStore = OncePerInstallEventStore(requireContext())
setAnalyticsEntryPointProperty(openWithDocument != null)
Toast.makeText(requireContext(), "!!!!!!!!", Toast.LENGTH_LONG)
LOG.error("OnViewCreated shouldShowOnboarding: ${shouldShowOnboarding()} onoboardingOnFirstRun ${shouldShowOnboardingAtFirstRun()}" +
" eventStore ${oncePerInstallEventStore.containsEvent(OncePerInstallEvent.SHOW_ONBOARDING)} getEventStore ${oncePerInstallEventStore.getEV(OncePerInstallEvent.SHOW_ONBOARDING)}")
if (openWithDocument != null) {
navController.navigate(
CameraFragmentDirections.toAnalysisFragment(
openWithDocument,
""
)
)
LOG.error("IFBRANCH")
} else {
if (shouldShowOnboarding() || (shouldShowOnboardingAtFirstRun() && !oncePerInstallEventStore.containsEvent(
OncePerInstallEvent.SHOW_ONBOARDING
))
) {
oncePerInstallEventStore.saveEvent(OncePerInstallEvent.SHOW_ONBOARDING)
LOG.error("OnViewCreated trying navigate")

oncePerInstallEventStore.saveEvent(OncePerInstallEvent.SHOW_ONBOARDING)
navController.navigate(CameraFragmentDirections.toOnboardingFragment())
}
}
Expand Down Expand Up @@ -265,6 +273,7 @@ class GiniCaptureFragment(private val openWithDocument: Document? = null) :
}

companion object {
private val LOG = LoggerFactory.getLogger(GiniCaptureFragment::class.java)
@JvmStatic
fun createInstance(document: Document? = null): GiniCaptureFragment {
return GiniCaptureFragment(document)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public boolean containsEvent(final OncePerInstallEvent event) {
return mSharedPreferences.contains(event.name());
}

public boolean getEV(final OncePerInstallEvent event) {
return mSharedPreferences.getBoolean(event.name(), false);
}

public void saveEvent(final OncePerInstallEvent event) {
mSharedPreferences.edit()
.putBoolean(event.name(), true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,9 @@ public void onStart() {
if (isQRCodeScanningEnabled()) {
initQRCodeReader();
}
LOG.error("Checking if we init ibanRecognizeFilter hasInstance " + GiniCapture.hasInstance()
+ " getEntryPoint " + GiniCapture.getInstance().getEntryPoint()
+ " isOnlyQrCodeScanningEnabled " + isOnlyQRCodeScanningEnabled());
if (GiniCapture.hasInstance()
&& GiniCapture.getInstance().getEntryPoint() == EntryPoint.FIELD
&& !isOnlyQRCodeScanningEnabled()) {
Expand Down Expand Up @@ -589,6 +592,7 @@ public void onInterrupted() {
}

private void initIBANRecognizerFilter() {
LOG.error("init ibanRecognizerFilter " + ibanRecognizerFilter);
if (ibanRecognizerFilter != null) {
return;
}
Expand Down Expand Up @@ -873,6 +877,8 @@ private boolean isOnlyQRCodeScanningEnabled() {
return false;
}

LOG.error("qrcodeScanningEnabling function isOnlyQRCodeScanning " + GiniCapture.getInstance().isOnlyQRCodeScanning()
+ " isQRCodeScanningEnabled " + GiniCapture.getInstance().isQRCodeScanningEnabled());
return GiniCapture.getInstance().isOnlyQRCodeScanning() && GiniCapture.getInstance().isQRCodeScanningEnabled();
}

Expand Down Expand Up @@ -1877,12 +1883,14 @@ public void onPreviewFrame(@NonNull Image image, @NonNull Size imageSize, int ro

@Override
public void onPreviewFrame(@NonNull byte[] image, @NonNull Size imageSize, int rotation) {
LOG.error("OnPreviewFrame " + ibanRecognizerFilter);
if (mPaymentQRCodeReader != null) {
mPaymentQRCodeReader.readFromByteArray(image, imageSize, rotation);
}
if (ibanRecognizerFilter != null) {
LOG.error("RecognizeFilter if");
try {
ibanRecognizerFilter.processByteArray(image, imageSize.width, imageSize.height, rotation, () -> {
ibanRecognizerFilter.processByteArray(image, 600, 600, rotation, () -> {
});
} catch (Exception e) {
LOG.error("Failed to process image for IBAN recognition", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ internal class MLKitTextRecognizer(private val recognizer: com.google.mlkit.visi
doneCallback: (RecognizedText?) -> Unit,
cancelledCallback: () -> Unit
) {
LOG.error("ProcessByteArray width $width height $height")
if (processingTask != null) {
LOG.warn("Text recognizer is already processing an image")
cancelledCallback()
Expand All @@ -91,7 +92,7 @@ internal class MLKitTextRecognizer(private val recognizer: com.google.mlkit.visi
private fun handleProcessingTask(doneCallback: (RecognizedText?) -> Unit) {
processingTask
?.addOnSuccessListener { result ->
LOG.debug("Text recognizer success: {}", result.text)
LOG.error("Text recognizer success: {}", result.text)
doneCallback(mlKitTextToRecognizedText(result))
}
?.addOnFailureListener { e ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public View onCreateView(final LayoutInflater inflater, final ViewGroup containe
bindViews(view);
addInputHandlers();
mPresenter.start();
LOG.error("CreateView");
return view;
}

Expand Down
Loading