Commit 79d3a8d1 authored by 林生雨's avatar 林生雨

commit

parent f72993a8
...@@ -7,8 +7,16 @@ ...@@ -7,8 +7,16 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="$ENABLE_FLUTTER_DESKTOP$" id="5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba" name="Default Changelist" comment=""> <list default="$ENABLE_FLUTTER_DESKTOP$" id="5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/utils/PhotoBitmapUtils.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/kotlin/com/example/gengmei_flutter_plugin/utils/PhotoBitmapUtils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/kotlin/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/GengmeiFlutterPlugin.m" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/GengmeiFlutterPlugin.m" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/MyPlayerViewController.m" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/MyPlayerViewController.m" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Classes/MyPlayerViewController.m" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/MyPlayerViewController.m" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/.dart_tool/" /> <ignored path="$PROJECT_DIR$/.dart_tool/" />
<ignored path="$PROJECT_DIR$/.idea/" /> <ignored path="$PROJECT_DIR$/.idea/" />
...@@ -25,14 +33,14 @@ ...@@ -25,14 +33,14 @@
<component name="DefaultGradleProjectSettings"> <component name="DefaultGradleProjectSettings">
<option name="isMigrated" value="$ENABLE_FLUTTER_DESKTOP$" /> <option name="isMigrated" value="$ENABLE_FLUTTER_DESKTOP$" />
</component> </component>
<component name="ExecutionTargetManager" SELECTED_TARGET="AKC0218316000622" /> <component name="ExecutionTargetManager" SELECTED_TARGET="Pixel_2_API_25" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="$ENABLE_FLUTTER_DESKTOP$">
<entry file="file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"> <entry file="file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="1100"> <state relative-caret-position="184">
<caret line="57" column="38" selection-start-line="57" selection-start-column="38" selection-end-line="57" selection-end-column="38" /> <caret line="56" column="39" selection-start-line="56" selection-start-column="24" selection-end-line="56" selection-end-column="39" />
<folding> <folding>
<element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
...@@ -53,7 +61,7 @@ ...@@ -53,7 +61,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"> <entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="179"> <state relative-caret-position="5522">
<caret line="251" column="22" selection-start-line="251" selection-start-column="22" selection-end-line="251" selection-end-column="22" /> <caret line="251" column="22" selection-start-line="251" selection-start-column="22" selection-end-line="251" selection-end-column="22" />
</state> </state>
</provider> </provider>
...@@ -88,11 +96,11 @@ ...@@ -88,11 +96,11 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="$ENABLE_FLUTTER_DESKTOP$"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"> <entry file="file://$PROJECT_DIR$/lib/ScanImagePlugn.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="137"> <state relative-caret-position="98">
<caret line="108" column="18" selection-start-line="108" selection-start-column="18" selection-end-line="108" selection-end-column="18" /> <caret line="82" column="28" selection-start-line="82" selection-start-column="28" selection-end-line="82" selection-end-column="28" />
<folding> <folding>
<element signature="e#45#62#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#45#62#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
...@@ -103,7 +111,7 @@ ...@@ -103,7 +111,7 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/SharedPlugin.dart"> <entry file="file://$PROJECT_DIR$/lib/SharedPlugin.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="247"> <state relative-caret-position="308">
<caret line="17" selection-start-line="17" selection-end-line="17" /> <caret line="17" selection-start-line="17" selection-end-line="17" />
</state> </state>
</provider> </provider>
...@@ -159,6 +167,7 @@ ...@@ -159,6 +167,7 @@
<find>gotoNativeCameraKey</find> <find>gotoNativeCameraKey</find>
<find>nativeCamera</find> <find>nativeCamera</find>
<find>paseAlbum</find> <find>paseAlbum</find>
<find>GET_IOS_VIDEO_DATA</find>
</findStrings> </findStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
...@@ -193,11 +202,10 @@ ...@@ -193,11 +202,10 @@
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds">
<option name="x" value="-48" /> <option name="y" value="23" />
<option name="y" value="27" />
<option name="width" value="1440" /> <option name="width" value="1440" />
<option name="height" value="811" /> <option name="height" value="809" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="$ENABLE_FLUTTER_DESKTOP$" /> <component name="ProjectLevelVcsManager" settingsEditedManually="$ENABLE_FLUTTER_DESKTOP$" />
<component name="ProjectView"> <component name="ProjectView">
...@@ -229,6 +237,13 @@ ...@@ -229,6 +237,13 @@
<item name="ios" type="462c0819:PsiDirectoryNode" /> <item name="ios" type="462c0819:PsiDirectoryNode" />
<item name="Classes" type="462c0819:PsiDirectoryNode" /> <item name="Classes" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="gengmei_flutter_plugin" type="b2602c69:ProjectViewProjectNode" />
<item name="gengmei_flutter_plugin" type="462c0819:PsiDirectoryNode" />
<item name="ios" type="462c0819:PsiDirectoryNode" />
<item name="Classes" type="462c0819:PsiDirectoryNode" />
<item name="UIView+extention" type="462c0819:PsiDirectoryNode" />
</path>
<path> <path>
<item name="gengmei_flutter_plugin" type="b2602c69:ProjectViewProjectNode" /> <item name="gengmei_flutter_plugin" type="b2602c69:ProjectViewProjectNode" />
<item name="gengmei_flutter_plugin" type="462c0819:PsiDirectoryNode" /> <item name="gengmei_flutter_plugin" type="462c0819:PsiDirectoryNode" />
...@@ -238,9 +253,9 @@ ...@@ -238,9 +253,9 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
<pane id="AndroidView" />
<pane id="PackagesPane" /> <pane id="PackagesPane" />
<pane id="AndroidView" />
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
...@@ -287,9 +302,10 @@ ...@@ -287,9 +302,10 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1440" height="816" extended-state="6" /> <frame x="0" y="23" width="1440" height="809" extended-state="0" />
<editor active="$ENABLE_FLUTTER_DESKTOP$" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.19742489" /> <window_info active="$ENABLE_FLUTTER_DESKTOP$" content_ui="combo" id="Project" order="0" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.19742489" />
<window_info id="Captures" order="1" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info id="Captures" order="1" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
<window_info id="Structure" order="2" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info id="Structure" order="2" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
<window_info id="Image Layers" order="3" /> <window_info id="Image Layers" order="3" />
...@@ -304,7 +320,7 @@ ...@@ -304,7 +320,7 @@
<window_info anchor="bottom" id="Android Profiler" order="3" show_stripe_button="false" /> <window_info anchor="bottom" id="Android Profiler" order="3" show_stripe_button="false" />
<window_info anchor="bottom" id="Logcat" order="4" weight="0.42701226" /> <window_info anchor="bottom" id="Logcat" order="4" weight="0.42701226" />
<window_info anchor="bottom" id="Debug" order="5" weight="0.32962447" /> <window_info anchor="bottom" id="Debug" order="5" weight="0.32962447" />
<window_info active="$ENABLE_FLUTTER_DESKTOP$" anchor="bottom" id="Terminal" order="6" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.5593923" /> <window_info anchor="bottom" id="Terminal" order="6" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.41562065" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info anchor="bottom" id="Event Log" order="7" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
<window_info anchor="bottom" id="Flutter Performance" order="8" side_tool="$ENABLE_FLUTTER_DESKTOP$" /> <window_info anchor="bottom" id="Flutter Performance" order="8" side_tool="$ENABLE_FLUTTER_DESKTOP$" />
<window_info anchor="bottom" id="Version Control" order="9" /> <window_info anchor="bottom" id="Version Control" order="9" />
...@@ -561,22 +577,19 @@ ...@@ -561,22 +577,19 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="1100">
<caret line="57" column="38" selection-start-line="57" selection-start-column="38" selection-end-line="57" selection-end-column="38" />
<folding>
<element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/ios/Classes/MyPreviewController.m"> <entry file="file://$PROJECT_DIR$/ios/Classes/MyPreviewController.m">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor" /> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor" />
</entry> </entry>
<entry file="file://$PROJECT_DIR$/ios/Classes/MyPlayerViewController.m"> <entry file="file://$PROJECT_DIR$/ios/Classes/MyPlayerViewController.m">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor" /> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor" />
</entry> </entry>
<entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="5522">
<caret line="251" column="22" selection-start-line="251" selection-start-column="22" selection-end-line="251" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/bean/DirBean.dart"> <entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/bean/DirBean.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor" /> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor" />
</entry> </entry>
...@@ -600,6 +613,13 @@ ...@@ -600,6 +613,13 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/SharedPlugin.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="308">
<caret line="17" selection-start-line="17" selection-end-line="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"> <entry file="file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="3916"> <state relative-caret-position="3916">
...@@ -610,26 +630,22 @@ ...@@ -610,26 +630,22 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"> <entry file="file://$PROJECT_DIR$/lib/ScanImagePlugn.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="179">
<caret line="251" column="22" selection-start-line="251" selection-start-column="22" selection-end-line="251" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/SharedPlugin.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="247"> <state relative-caret-position="98">
<caret line="17" selection-start-line="17" selection-end-line="17" /> <caret line="82" column="28" selection-start-line="82" selection-start-column="28" selection-end-line="82" selection-end-column="28" />
<folding>
<element signature="e#45#62#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"> <entry file="file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="137"> <state relative-caret-position="184">
<caret line="108" column="18" selection-start-line="108" selection-start-column="18" selection-end-line="108" selection-end-column="18" /> <caret line="56" column="39" selection-start-line="56" selection-start-column="24" selection-end-line="56" selection-end-column="39" />
<folding> <folding>
<element signature="e#45#62#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
</state> </state>
</provider> </provider>
......
...@@ -31,7 +31,7 @@ android { ...@@ -31,7 +31,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {
abiFilters 'armeabi-v7a' abiFilters 'armeabi-v7a'
} }
...@@ -49,6 +49,7 @@ dependencies { ...@@ -49,6 +49,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion" implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion" implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.8.0' implementation 'com.github.bumptech.glide:glide:4.8.0'
} }
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
\ No newline at end of file
...@@ -14,7 +14,7 @@ import android.os.Build ...@@ -14,7 +14,7 @@ import android.os.Build
import android.os.Environment import android.os.Environment
import android.os.Handler import android.os.Handler
import android.provider.MediaStore import android.provider.MediaStore
import android.support.v4.content.FileProvider import androidx.core.content.FileProvider
import android.util.Log import android.util.Log
import android.widget.Toast import android.widget.Toast
import com.example.gengmei_flutter_plugin.act.PreviewActivity import com.example.gengmei_flutter_plugin.act.PreviewActivity
...@@ -23,6 +23,7 @@ import com.example.gengmei_flutter_plugin.result.ResultManager ...@@ -23,6 +23,7 @@ import com.example.gengmei_flutter_plugin.result.ResultManager
import com.example.gengmei_flutter_plugin.sharedPrefernces.SharedManager import com.example.gengmei_flutter_plugin.sharedPrefernces.SharedManager
import com.example.gengmei_flutter_plugin.utils.DebugUtil import com.example.gengmei_flutter_plugin.utils.DebugUtil
import com.example.gengmei_flutter_plugin.utils.MyUtil.Companion.getFileName import com.example.gengmei_flutter_plugin.utils.MyUtil.Companion.getFileName
import com.example.gengmei_flutter_plugin.utils.PhotoBitmapUtils
import com.example.gengmei_flutter_plugin.utils.addTo import com.example.gengmei_flutter_plugin.utils.addTo
import com.example.myimagepicker.luban.Luban import com.example.myimagepicker.luban.Luban
import com.example.myimagepicker.repository.ImageRespository import com.example.myimagepicker.repository.ImageRespository
...@@ -140,6 +141,10 @@ class GengmeiFlutterPlugin : MethodCallHandler { ...@@ -140,6 +141,10 @@ class GengmeiFlutterPlugin : MethodCallHandler {
if (resultCode == RESULT_OK) { if (resultCode == RESULT_OK) {
android.util.Log.e("lsy", " RESULT OKKKKK ") android.util.Log.e("lsy", " RESULT OKKKKK ")
if (nativeImage != null && nativeImage!!.exists()) { if (nativeImage != null && nativeImage!!.exists()) {
val bitmapDegree = PhotoBitmapUtils.getBitmapDegree(nativeImage!!.absolutePath)
if(bitmapDegree!=0){
PhotoBitmapUtils.rotateBitmapByDegree(nativeImage!!.absolutePath,bitmapDegree)
}
ImageRespository.getInstance().scareImg(nativeImage!!.absolutePath).subscribe({ ImageRespository.getInstance().scareImg(nativeImage!!.absolutePath).subscribe({
val map = HashMap<String, Any>() val map = HashMap<String, Any>()
map.put("realPath", it.first) map.put("realPath", it.first)
......
package com.example.gengmei_flutter_plugin.act package com.example.gengmei_flutter_plugin.act
import android.os.Bundle import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.example.gengmei_flutter_plugin.R import com.example.gengmei_flutter_plugin.R
import com.example.gengmei_flutter_plugin.act.view.PinchImageView import com.example.gengmei_flutter_plugin.act.view.PinchImageView
......
...@@ -2,10 +2,10 @@ package com.example.gengmei_flutter_plugin.act ...@@ -2,10 +2,10 @@ package com.example.gengmei_flutter_plugin.act
import android.os.Bundle import android.os.Bundle
import android.provider.CalendarContract import android.provider.CalendarContract
import android.support.v7.app.AppCompatActivity
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.MediaController import android.widget.MediaController
import android.widget.VideoView import android.widget.VideoView
import androidx.appcompat.app.AppCompatActivity
import com.example.gengmei_flutter_plugin.R import com.example.gengmei_flutter_plugin.R
import com.example.gengmei_flutter_plugin.utils.MyUtil import com.example.gengmei_flutter_plugin.utils.MyUtil
......
...@@ -2,13 +2,17 @@ package com.example.gengmei_flutter_plugin.act.view ...@@ -2,13 +2,17 @@ package com.example.gengmei_flutter_plugin.act.view
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.content.Context import android.content.Context
import android.graphics.* import android.graphics.Canvas
import android.support.v7.widget.AppCompatImageView import android.graphics.Matrix
import android.graphics.PointF
import android.graphics.RectF
import android.util.AttributeSet import android.util.AttributeSet
import android.util.Log
import android.view.GestureDetector import android.view.GestureDetector
import android.view.MotionEvent import android.view.MotionEvent
import androidx.appcompat.widget.AppCompatImageView
import java.util.* import java.util.*
import kotlin.collections.ArrayList
/** /**
* 手势缩放ImageView * 手势缩放ImageView
......
...@@ -13,7 +13,7 @@ import java.io.FileOutputStream ...@@ -13,7 +13,7 @@ import java.io.FileOutputStream
import java.io.IOException import java.io.IOException
import java.lang.Exception import java.lang.Exception
import android.view.ViewGroup import android.view.ViewGroup
import android.support.v4.view.ViewCompat.setFitsSystemWindows import androidx.core.view.ViewCompat.setFitsSystemWindows
import android.app.Activity import android.app.Activity
import android.view.WindowManager import android.view.WindowManager
import android.os.Build import android.os.Build
......
package com.example.gengmei_flutter_plugin.utils; package com.example.gengmei_flutter_plugin.utils;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
import android.text.TextUtils;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
/** /**
* @author lsy * @author lsy
* @date 2020-02-26 * @date 2020-02-26
*/ */
public class PhotoBitmapUtils { public class PhotoBitmapUtils {
/**
* 读取图片的旋转的角度
*
* @param path 图片绝对路径
* @return 图片的旋转角度
*/
public static int getBitmapDegree(String path) {
int degree = 0;//被旋转的角度
try {
// 从指定路径下读取图片,并获取其EXIF信息
ExifInterface exifInterface = new ExifInterface(path);
// 获取图片的旋转信息
int orientation = exifInterface.getAttributeInt(ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL);
switch (orientation) {
case ExifInterface.ORIENTATION_ROTATE_90:
degree = 90;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
degree = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_270:
degree = 270;
break;
}
} catch (IOException e) {
e.printStackTrace();
}
return degree;
}
/**
* 将图片按照某个角度进行旋转
*
* @param degree 旋转角度
* @return 旋转后的图片
*/
public static boolean rotateBitmapByDegree(String filePath, int degree) {
File file = new File(filePath);
if (!file.exists()) {
return false;
}
Bitmap bm = BitmapFactory.decodeFile(filePath);
Bitmap returnBm = null;
FileOutputStream fos = null;
// 根据旋转角度,生成旋转矩阵
Matrix matrix = new Matrix();
matrix.postRotate(degree);
try {
// 将原始图片按照旋转矩阵进行旋转,并得到新的图片
returnBm = Bitmap.createBitmap(bm, 0, 0, bm.getWidth(), bm.getHeight(), matrix, true);
fos = new FileOutputStream(file);
returnBm.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();
} catch (OutOfMemoryError e) {
e.printStackTrace();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fos != null) {
fos.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
} }
...@@ -562,9 +562,9 @@ PHImageRequestOptions *baseImageRequestOption; ...@@ -562,9 +562,9 @@ PHImageRequestOptions *baseImageRequestOption;
if([[self.scanMap allKeys] containsObject:path]){ if([[self.scanMap allKeys] containsObject:path]){
PHAsset * assets=self.scanMap[path]; PHAsset * assets=self.scanMap[path];
PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init]; PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];
options.version = PHImageRequestOptionsVersionCurrent; // options.version = PHImageRequestOptionsVersionCurrent;
options.networkAccessAllowed = true; options.networkAccessAllowed = true;
options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic; // options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
[[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) { [[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
AVURLAsset *urlAsset = (AVURLAsset *)asset; AVURLAsset *urlAsset = (AVURLAsset *)asset;
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTempVideo] :[NSString stringWithFormat:@"%@",urlAsset.URL]]; [[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTempVideo] :[NSString stringWithFormat:@"%@",urlAsset.URL]];
......
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
dispatch_async(self.queue, ^{ dispatch_async(self.queue, ^{
PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init]; PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];
// options.version = PHImageRequestOptionsVersionCurrent; options.version = PHImageRequestOptionsVersionCurrent;
options.networkAccessAllowed = true; options.networkAccessAllowed = true;
// options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic; options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
[[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) { [[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
AVURLAsset *urlAsset = (AVURLAsset *)asset; AVURLAsset *urlAsset = (AVURLAsset *)asset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment