Skip to content

Commit

Permalink
feature(bank-sdk): Skonto feature. Fix Skonto allow screenshots and s…
Browse files Browse the repository at this point in the history
…creen rotation

PP-377
  • Loading branch information
ndubkov-distcotech committed Jul 26, 2024
1 parent c825456 commit 13438ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.FrameLayout
import androidx.activity.compose.BackHandler
import androidx.compose.animation.AnimatedVisibility
Expand Down Expand Up @@ -79,6 +80,7 @@ import net.gini.android.bank.sdk.capture.skonto.colors.section.SkontoSectionColo
import net.gini.android.bank.sdk.capture.skonto.colors.section.WithoutSkontoSectionColors
import net.gini.android.bank.sdk.capture.skonto.model.SkontoData
import net.gini.android.bank.sdk.capture.util.currencyFormatterWithoutSymbol
import net.gini.android.bank.sdk.util.disallowScreenshots
import net.gini.android.capture.GiniCapture
import net.gini.android.capture.internal.util.ActivityHelper.forcePortraitOrientationOnPhones
import net.gini.android.capture.internal.util.CancelListener
Expand Down Expand Up @@ -119,7 +121,14 @@ class SkontoFragment : Fragment() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (GiniCapture.hasInstance() && !GiniCapture.getInstance().allowScreenshots) {
requireActivity().window.disallowScreenshots()
}
forcePortraitOrientationOnPhones(activity)

if (resources.getBoolean(net.gini.android.capture.R.bool.gc_is_tablet)) {
requireActivity().window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING)
}
}

override fun onCreateView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,23 @@ public void setListener(@NonNull final AnalysisFragmentListener listener) {
void showScanAnimation() {
mAnalysisMessageTextView.setVisibility(View.VISIBLE);
isScanAnimationActive = true;
injectedLoadingIndicatorContainer.modifyAdapterIfOwned(adapter -> {
adapter.onVisible();
return Unit.INSTANCE;
});
if (injectedLoadingIndicatorContainer != null)
injectedLoadingIndicatorContainer.modifyAdapterIfOwned(adapter -> {
adapter.onVisible();
return Unit.INSTANCE;
});
}

@Override
void hideScanAnimation() {
isScanAnimationActive = false;
injectedLoadingIndicatorContainer.modifyAdapterIfOwned(adapter -> {
adapter.onHidden();
return Unit.INSTANCE;
});
mAnalysisMessageTextView.setVisibility(View.GONE);
if (injectedLoadingIndicatorContainer != null)
injectedLoadingIndicatorContainer.modifyAdapterIfOwned(adapter -> {
adapter.onHidden();
return Unit.INSTANCE;
});
if (mAnalysisMessageTextView != null)
mAnalysisMessageTextView.setVisibility(View.GONE);
}

@Override
Expand Down

0 comments on commit 13438ee

Please sign in to comment.