react-native-video-trim 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -121,6 +121,8 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
121
121
  private String alertOnFailCloseText = "Close";
122
122
  private View currentSelectedhandle;
123
123
 
124
+ private RelativeLayout trimmerView;
125
+
124
126
  public VideoTrimmerView(ReactApplicationContext context, ReadableMap config, AttributeSet attrs) {
125
127
  this(context, attrs, 0, config);
126
128
  }
@@ -170,6 +172,8 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
170
172
 
171
173
  headerView = findViewById(R.id.headerView);
172
174
  headerText = findViewById(R.id.headerText);
175
+
176
+ trimmerView = findViewById(R.id.trimmerView);
173
177
  }
174
178
 
175
179
  public void initByURI(final Uri videoURI) {
@@ -296,6 +300,7 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
296
300
  }
297
301
 
298
302
  mOnTrimVideoListener.onLoad(mDuration);
303
+ ignoreSystemGestureForView(trimmerView);
299
304
  }
300
305
 
301
306
  private void updateGradientColors(int startColor, int endColor) {
@@ -464,7 +469,7 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
464
469
  cancelBtn.setText(config.getString("cancelButtonText"));
465
470
  saveBtn.setText(config.getString("saveButtonText"));
466
471
  isVideoType = config.hasKey("type") && Objects.equals(config.getString("type"), "video");
467
- System.out.println("1111 isVideoType: " + isVideoType);
472
+ System.out.println("isVideoType: " + isVideoType);
468
473
 
469
474
  mOutputExt = config.hasKey("outputExt") ? config.getString("outputExt") : "mp4";
470
475
  if (!isVideoType) {
@@ -782,4 +787,23 @@ public class VideoTrimmerView extends FrameLayout implements IVideoTrimmerView {
782
787
 
783
788
  isZoomedIn = true;
784
789
  }
790
+
791
+ private void ignoreSystemGestureForView(View v) {
792
+ // Android 10+
793
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
794
+ // 1. setSystemGestureExclusionRects on a rect which is entire screen size
795
+ // 2. if we use the bound of the view, it's not smooth and still sometimes can trigger system gesture even our finger is within the view bound
796
+ // 3. even though here the bound is set to screen size, it doesn't mean the entire screen is excluded from system gesture, it only means the area within the view bound is excluded
797
+ v.setSystemGestureExclusionRects(
798
+ java.util.List.of(
799
+ new android.graphics.Rect(
800
+ 0,
801
+ 0,
802
+ DeviceUtil.getDeviceWidth(),
803
+ DeviceUtil.getDeviceHeight()
804
+ )
805
+ )
806
+ );
807
+ }
808
+ }
785
809
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-video-trim",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Video trimmer for your React Native app",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",