Skip to content

Commit

Permalink
fix(-sdk): Fix back navigation in ZoomInPreviewFragment
Browse files Browse the repository at this point in the history
BSDK-258
  • Loading branch information
abolfazlimahdi committed Jan 23, 2024
1 parent 0889ade commit 03aa792
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import net.gini.android.capture.review.multipage.previews.PreviewFragmentListener;
import net.gini.android.capture.review.multipage.previews.PreviewPagesAdapter;
import net.gini.android.capture.review.multipage.view.ReviewNavigationBarBottomAdapter;
import net.gini.android.capture.review.zoom.ZoomInPreviewFragment;
import net.gini.android.capture.tracking.AnalysisScreenEvent;
import net.gini.android.capture.tracking.ReviewScreenEvent;
import net.gini.android.capture.tracking.ReviewScreenEvent.UPLOAD_ERROR_DETAILS_MAP_KEY;
Expand Down Expand Up @@ -980,10 +979,7 @@ public void onDeleteDocument(@NonNull final ImageDocument document) {

@Override
public void onPageClicked(@NonNull ImageDocument document) {
getChildFragmentManager().beginTransaction()
.add(R.id.gc_fragment_container, ZoomInPreviewFragment.newInstance(document), ZoomInPreviewFragment.class.getName())
.addToBackStack(null)
.commit();
NavHostFragment.findNavController(this).navigate( MultiPageReviewFragmentDirections.toZoomInPreviewFragment(document));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import net.gini.android.capture.AsyncCallback;
import net.gini.android.capture.Document;
import net.gini.android.capture.GiniCapture;
import net.gini.android.capture.R;
import net.gini.android.capture.document.ImageDocument;
import net.gini.android.capture.internal.camera.photo.ParcelableMemoryCache;
import net.gini.android.capture.internal.camera.photo.Photo;
import net.gini.android.capture.review.RotatableTouchImageViewContainer;

Expand Down Expand Up @@ -47,7 +43,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.gc_fragement_zoom_in_preview, container, false);
final View view = inflater.inflate(R.layout.gc_fragment_zoom_in_preview, container, false);
setupInputHandlers(view);
return view;
}
Expand Down
14 changes: 14 additions & 0 deletions capture-sdk/sdk/src/main/res/navigation/gc_nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
android:name="ARGS_DOCUMENT"
app:argType="net.gini.android.capture.Document" />
</action>
<action
android:id="@+id/to_zoom_in_preview_fragment"
app:destination="@id/gc_destination_zoom_in_preview_fragment"
>
<argument
android:name="GC_ARGS_DOCUMENT"
app:argType="net.gini.android.capture.Document" />
</action>
</fragment>

<fragment
Expand Down Expand Up @@ -241,4 +249,10 @@
android:label="fragment_onboarding">
</fragment>

<fragment
android:id="@+id/gc_destination_zoom_in_preview_fragment"
android:name="net.gini.android.capture.review.zoom.ZoomInPreviewFragment"
android:label="fragment_zoom_in_preview">
</fragment>

</navigation>

0 comments on commit 03aa792

Please sign in to comment.