Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7bcd50f

Browse files
committed
update doc
1 parent 06e05e6 commit 7bcd50f

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,12 @@ void onBackPressed() {
787787
/**
788788
* Invoke this from {@link OnBackAnimationCallback#onBackStarted(BackEvent)}.
789789
*
790-
* <p>This method should be called when the back gesture is initiated, as part of the
791-
* implementation of {@link OnBackAnimationCallback}. It's responsible for handling the initial
792-
* response to the start of a back gesture, such as initiating animations or preparing the UI for
793-
* the back navigation process.
790+
* <p>This method should be called when the back gesture is initiated. It should be invoked as
791+
* part of the implementation of {@link OnBackAnimationCallback}.
792+
*
793+
* <p>This method delegates the handling of the start of a back gesture to the Flutter framework,
794+
* which is responsible for the appropriate response, such as initiating animations or preparing
795+
* the UI for the back navigation process.
794796
*
795797
* @param backEvent The BackEvent object containing information about the touch.
796798
*/
@@ -810,9 +812,10 @@ void startBackGesture(@NonNull BackEvent backEvent) {
810812
* Invoke this from {@link OnBackAnimationCallback#onBackProgressed(BackEvent)}.
811813
*
812814
* <p>This method should be called in response to progress in a back gesture, as part of the
813-
* implementation of {@link OnBackAnimationCallback}. It allows for updating the state of the
814-
* application or UI elements based on the ongoing back gesture, such as progressing animations or
815-
* interactive elements.
815+
* implementation of {@link OnBackAnimationCallback}.
816+
*
817+
* <p>This method delegates to the Flutter framework to update UI elements or animations based on
818+
* the progression of the back gesture.
816819
*
817820
* @param backEvent An BackEvent object describing the progress event.
818821
*/
@@ -833,11 +836,13 @@ void updateBackGestureProgress(@NonNull BackEvent backEvent) {
833836
/**
834837
* Invoke this from {@link OnBackAnimationCallback#onBackInvoked()}.
835838
*
836-
* <p>This method signifies the completion of a back gesture and commits the navigation action
837-
* initiated by the gesture. It should be called as a final step in the back gesture handling,
838-
* indicating that the application is ready to proceed with the back navigation. This could
839-
* involve finalizing animations, updating the UI to reflect the navigation, or performing cleanup
840-
* tasks related to the gesture.
839+
* <p>This method is called to signify the completion of a back gesture and commits the navigation
840+
* action initiated by the gesture. It should be invoked as the final step in handling a back
841+
* gesture.
842+
*
843+
* <p>This method indicates to the Flutter framework that it should proceed with the back
844+
* navigation, including finalizing animations and updating the UI to reflect the navigation
845+
* outcome.
841846
*/
842847
@TargetApi(API_LEVELS.API_34)
843848
@RequiresApi(API_LEVELS.API_34)
@@ -854,10 +859,12 @@ void commitBackGesture() {
854859
/**
855860
* Invoke this from {@link OnBackAnimationCallback#onBackCancelled()}.
856861
*
857-
* <p>This method should be called when a back gesture is cancelled or back button pressed, as
858-
* part of the implementation of {@link OnBackAnimationCallback}. It's responsible for handling
859-
* the rollback of any changes or animations that were initiated in response to the back gesture.
860-
* This includes resetting UI elements or state to their original form before the gesture started.
862+
* <p>This method should be called when a back gesture is cancelled or the back button is pressed.
863+
* It informs the Flutter framework about the cancellation.
864+
*
865+
* <p>This method enables the Flutter framework to rollback any UI changes or animations initiated
866+
* in response to the back gesture. This includes resetting UI elements to their state prior to
867+
* the gesture's start.
861868
*/
862869
@TargetApi(API_LEVELS.API_34)
863870
@RequiresApi(API_LEVELS.API_34)

0 commit comments

Comments
 (0)