Skip to content

Commit

Permalink
Updated dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
SERDUN committed Sep 22, 2022
1 parent 15755a1 commit 0ff96e8
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 135 deletions.
9 changes: 5 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'com.steelkiwi.videotrimming'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.20'
repositories {
google()
jcenter()
Expand Down Expand Up @@ -30,21 +30,22 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 31
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion
multiDexEnabled true
minSdkVersion 26
targetSdkVersion 31
minSdkVersion 27
targetSdkVersion 33

}
lintOptions {
disable 'InvalidPackage'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
19 changes: 11 additions & 8 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.steelkiwi.videotrimming">

<application android:theme="@style/AppTheme">

<application
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:label="videotrimming">
<activity
android:name=".VideoTrimmerActivity"
android:configChanges="orientation|screenSize"
android:launchMode="singleTask"
android:exported="true"
android:screenOrientation="fullSensor"
android:windowSoftInputMode="adjustPan">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<!-- <data android:mimeType="*/*" /> -->
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="text/*" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class VideotrimmingPlugin : FlutterPlugin, MethodCallHandler, ActivityAwa
fun registerWith(registrar: Registrar) {
val plugin = VideotrimmingPlugin()
plugin.setupEngine(registrar.messenger())
val delegate: VideoTrimDelegate = plugin.setupActivity(registrar.activity())!!
val delegate: VideoTrimDelegate = registrar.activity()?.let { plugin.setupActivity(it) }!!
registrar.addActivityResultListener(delegate)


Expand Down
15 changes: 11 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ if (flutterVersionName == null) {

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


android {
compileSdkVersion 31
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -36,12 +36,19 @@ android {
lintOptions {
disable 'InvalidPackage'
}
kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.steelkiwi.videotrimming_example"
minSdkVersion 26
targetSdkVersion 31
minSdkVersion 27
targetSdkVersion 33
multiDexEnabled true

versionCode flutterVersionCode.toInteger()
Expand Down
84 changes: 40 additions & 44 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.steelkiwi.videotrimming_example">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="videotrimming_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"

android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
package="com.steelkiwi.videotrimming_example">
<application
android:label="videotrimming"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

5 changes: 2 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.20'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 changes: 0 additions & 4 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
Expand Down
9 changes: 4 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {
VideoPlayerController? _controller;
VideoPlayerController? _controller;
String selectedPath = "";
String trimmedPath = "";

Expand All @@ -48,9 +48,9 @@ class _MyHomePageState extends State<MyHomePage> {
height: 200,
width: 200,
),
new RaisedButton(
new GestureDetector(
child: new Text('Select video'),
onPressed: () {
onTap: () {
_pickVideo();
},
),
Expand All @@ -62,8 +62,7 @@ class _MyHomePageState extends State<MyHomePage> {

_pickVideo() async {
if (await Permission.storage.request().isGranted) {
FilePickerResult? selectedFile =
await FilePicker.platform.pickFiles(type: FileType.video);
FilePickerResult? selectedFile = await FilePicker.platform.pickFiles(type: FileType.video);

selectedPath = selectedFile?.files.single.path ?? "";
var trimmedFile = await VideoTrimming.trimVideo(sourcePath: selectedPath);
Expand Down
Loading

0 comments on commit 0ff96e8

Please sign in to comment.