Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flutter_plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
flutter_plugin
Commits
592bc5ed
Commit
592bc5ed
authored
Oct 28, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
3636de24
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
593 additions
and
200 deletions
+593
-200
workspace.xml
.idea/workspace.xml
+127
-98
GengmeiFlutterPlugin.kt
...om/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt
+17
-4
ImageRespository.kt
...flutter_plugin/ImagePlugin/repository/ImageRespository.kt
+116
-26
MediaFile.kt
...i_flutter_plugin/ImagePlugin/repository/bean/MediaFile.kt
+4
-1
ImageScanner.kt
...utter_plugin/ImagePlugin/repository/local/ImageScanner.kt
+42
-30
Thumb.kt
...gmei_flutter_plugin/ImagePlugin/repository/local/Thumb.kt
+13
-0
ThumbUtil.java
...lutter_plugin/ImagePlugin/repository/local/ThumbUtil.java
+165
-0
VideoScanner.kt
...utter_plugin/ImagePlugin/repository/local/VideoScanner.kt
+45
-28
FileUtil.java
...va/com/example/gengmei_flutter_plugin/utils/FileUtil.java
+7
-4
MyUtil.kt
...n/java/com/example/gengmei_flutter_plugin/utils/MyUtil.kt
+50
-0
AlbumModel.dart
example/lib/AlbumModel/page/album/AlbumModel.dart
+2
-6
AlbumPage.dart
example/lib/AlbumModel/page/album/AlbumPage.dart
+4
-3
gengmei_flutter_plugin.iml
gengmei_flutter_plugin.iml
+1
-0
No files found.
.idea/workspace.xml
View file @
592bc5ed
...
...
@@ -6,21 +6,31 @@
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/Thumb.kt"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ThumbUtil.java"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/Thumb.kt"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ThumbUtil.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/
.idea/caches/build_file_checksums.ser"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/.idea/caches/build_file_checksums.ser
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/
src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/bean/MediaFile.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/bean/MediaFile.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ImageScanner.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ImageScanner.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/VideoScanner.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/VideoScanner.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/utils/FileUtil.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/utils/FileUtil.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/utils/MyUtil.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/utils/MyUtil.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/android/
.idea/caches/build_file_checksums.ser"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/.idea/caches/build_file_checksums.ser
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/
src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/pubspec.lock"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/pubspec.lock"
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/pubspec.lock"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/pubspec.lock"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/bean/MediaFile.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/bean/MediaFile.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ImageScanner.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ImageScanner.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/utils/FileUtil.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/utils/FileUtil.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/utils/MyUtil.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/utils/MyUtil.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumPage.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumPage.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/gengmei_flutter_plugin.iml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/gengmei_flutter_plugin.iml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/gengmei_flutter_plugin.iml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/gengmei_flutter_plugin.iml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
...
...
@@ -37,34 +47,28 @@
<component
name=
"DefaultGradleProjectSettings"
>
<option
name=
"isMigrated"
value=
"true"
/>
</component>
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"
AKC0218316000622
"
/>
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"
Pixel_2_API_25
"
/>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"135"
>
<caret
line=
"26"
column=
"36"
selection-start-line=
"26"
selection-start-column=
"24"
selection-end-line=
"26"
selection-end-column=
"36"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.h"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"88"
>
<caret
line=
"4"
selection-start-line=
"4"
selection-end-line=
"4"
/>
<state
relative-caret-position=
"336"
>
<caret
line=
"68"
selection-start-line=
"68"
selection-end-line=
"68"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/Album
Model
.dart"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/Album
Page
.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11
1
"
>
<caret
line=
"
74"
column=
"7"
selection-start-line=
"59"
selection-start-column=
"4"
selection-end-line=
"74"
selection-end-column=
"7
"
/>
<state
relative-caret-position=
"11
9
"
>
<caret
line=
"
206"
column=
"106"
selection-start-line=
"206"
selection-start-column=
"106"
selection-end-line=
"206"
selection-end-column=
"106
"
/>
<folding>
<element
signature=
"e#4
6#66
#0"
expanded=
"true"
/>
<element
signature=
"e#4
5#62
#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
...
...
@@ -73,8 +77,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
1392
"
>
<caret
line=
"26
7"
column=
"13"
selection-start-line=
"267"
selection-start-column=
"13"
selection-end-line=
"267
"
selection-end-column=
"13"
/>
<state
relative-caret-position=
"
5258
"
>
<caret
line=
"26
8"
column=
"13"
selection-start-line=
"268"
selection-start-column=
"13"
selection-end-line=
"268
"
selection-end-column=
"13"
/>
</state>
</provider>
</entry>
...
...
@@ -84,7 +88,16 @@
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"true"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"181"
>
<caret
line=
"13"
selection-start-line=
"13"
selection-end-line=
"13"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/pubspec.yaml"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"44"
>
...
...
@@ -94,17 +107,21 @@
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/
ios/Classes/GengmeiFlutterPlugin.m
"
>
<entry
file=
"file://$PROJECT_DIR$/
lib/SharedPlugin.dart
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
183
"
>
<caret
line=
"
387"
column=
"22"
selection-start-line=
"387"
selection-start-column=
"12"
selection-end-line=
"387"
selection-end-column=
"22
"
/>
<state
relative-caret-position=
"
330
"
>
<caret
line=
"
18"
column=
"39"
selection-start-line=
"18"
selection-start-column=
"28"
selection-end-line=
"18"
selection-end-column=
"39
"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/AlbumItem.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"8514"
>
<caret
line=
"387"
column=
"22"
selection-start-line=
"387"
selection-start-column=
"12"
selection-end-line=
"387"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
...
...
@@ -114,9 +131,7 @@
</file>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-138"
/>
</provider>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
</file>
</leaf>
...
...
@@ -168,20 +183,19 @@
<option
value=
"$PROJECT_DIR$/.gitignore"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
/>
<option
value=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/luban/Engine.kt"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/SharedPlugin.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
</list>
</option>
</component>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"504"
/>
<option
name=
"y"
value=
"-895"
/>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"y"
value=
"23"
/>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"height"
value=
"81
2
"
/>
<option
name=
"height"
value=
"81
1
"
/>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectView"
>
...
...
@@ -189,9 +203,8 @@
<foldersAlwaysOnTop
value=
"true"
/>
</navigator>
<panes>
<pane
id=
"Scope"
/>
<pane
id=
"PackagesPane"
/>
<pane
id=
"
AndroidView
"
/>
<pane
id=
"
Scope
"
/>
<pane
id=
"ProjectPane"
>
<subPane>
<expand>
...
...
@@ -202,20 +215,37 @@
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"
android
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"
example
"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"
android
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"
main
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"
example
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"
lib
"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"android"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"main"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"AlbumModel"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"AlbumModel"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"page"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"AlbumModel"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"page"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"album"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
...
...
@@ -226,6 +256,7 @@
<select
/>
</subPane>
</pane>
<pane
id=
"AndroidView"
/>
</panes>
</component>
<component
name=
"PropertiesComponent"
>
...
...
@@ -271,10 +302,10 @@
<servers
/>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"
297"
y=
"-941"
width=
"1440"
height=
"812"
extended-state=
"0
"
/>
<frame
x=
"
0"
y=
"23"
width=
"1440"
height=
"811"
extended-state=
"6
"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.1
69527
9"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.1
50929
9"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"true"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
...
...
@@ -284,12 +315,12 @@
<window_info
id=
"Capture Tool"
order=
"7"
/>
<window_info
id=
"Favorites"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Dart Analysis"
order=
"0"
weight=
"0.32963988"
/>
<window_info
a
nchor=
"bottom"
id=
"Run"
order=
"1"
weight=
"0.4625
"
/>
<window_info
a
ctive=
"true"
anchor=
"bottom"
id=
"Run"
order=
"1"
visible=
"true"
weight=
"0.46175244
"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"2"
/>
<window_info
anchor=
"bottom"
id=
"Android Profiler"
order=
"3"
show_stripe_button=
"false"
/>
<window_info
a
ctive=
"true"
anchor=
"bottom"
id=
"Logcat"
order=
"4"
visible=
"true"
weight=
"0.21666667
"
/>
<window_info
a
nchor=
"bottom"
id=
"Logcat"
order=
"4"
weight=
"0.5486111
"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"6"
weight=
"0.
25555557
"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"6"
weight=
"0.
36717662
"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"7"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Flutter Performance"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"9"
/>
...
...
@@ -438,16 +469,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2200"
>
<caret
line=
"109"
column=
"17"
selection-start-line=
"109"
selection-start-column=
"17"
selection-end-line=
"109"
selection-end-column=
"17"
/>
<folding>
<element
signature=
"e#45#62#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/bean/DirBean.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
...
...
@@ -481,13 +502,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/SharedPlugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"330"
>
<caret
line=
"18"
column=
"39"
selection-start-line=
"18"
selection-start-column=
"28"
selection-end-line=
"18"
selection-end-column=
"39"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/main.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"682"
>
...
...
@@ -512,62 +526,77 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/AlbumItem.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
135
"
>
<caret
line=
"
26"
column=
"36"
selection-start-line=
"26"
selection-start-column=
"24"
selection-end-line=
"26"
selection-end-column=
"36
"
/>
<state
relative-caret-position=
"
88
"
>
<caret
line=
"
4"
selection-start-line=
"4"
selection-end-line=
"4
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/AlbumItem.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"
>
<entry
file=
"file://$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-138"
/>
<state
relative-caret-position=
"5258"
>
<caret
line=
"268"
column=
"13"
selection-start-line=
"268"
selection-start-column=
"13"
selection-end-line=
"268"
selection-end-column=
"13"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
ios/Classes/Image/ResultManager.h
"
>
<entry
file=
"file://$PROJECT_DIR$/
pubspec.lock
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
ios/Classes/GengmeiFlutterPlugin.h
"
>
<entry
file=
"file://$PROJECT_DIR$/
pubspec.yaml
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"88"
>
<caret
line=
"4"
selection-start-line=
"4"
selection-end-line=
"4"
/>
<state
relative-caret-position=
"44"
>
<caret
line=
"2"
column=
"9"
selection-start-line=
"2"
selection-start-column=
"9"
selection-end-line=
"2"
selection-end-column=
"16"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/SharedPlugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"330"
>
<caret
line=
"18"
column=
"39"
selection-start-line=
"18"
selection-start-column=
"28"
selection-end-line=
"18"
selection-end-column=
"39"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
183
"
>
<state
relative-caret-position=
"
8514
"
>
<caret
line=
"387"
column=
"22"
selection-start-line=
"387"
selection-start-column=
"12"
selection-end-line=
"387"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.h"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/Image/ResultManager.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"111"
>
<caret
line=
"74"
column=
"7"
selection-start-line=
"59"
selection-start-column=
"4"
selection-end-line=
"74"
selection-end-column=
"7"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
<state
relative-caret-position=
"181"
>
<caret
line=
"13"
selection-start-line=
"13"
selection-end-line=
"13"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.k
t"
>
<entry
file=
"file://$PROJECT_DIR$/
example/lib/AlbumModel/page/album/AlbumModel.dar
t"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1392"
>
<caret
line=
"267"
column=
"13"
selection-start-line=
"267"
selection-start-column=
"13"
selection-end-line=
"267"
selection-end-column=
"13"
/>
<state
relative-caret-position=
"336"
>
<caret
line=
"68"
selection-start-line=
"68"
selection-end-line=
"68"
/>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/pubspec.lock"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/pubspec.yaml"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"44"
>
<caret
line=
"2"
column=
"9"
selection-start-line=
"2"
selection-start-column=
"9"
selection-end-line=
"2"
selection-end-column=
"16"
/>
<state
relative-caret-position=
"119"
>
<caret
line=
"206"
column=
"106"
selection-start-line=
"206"
selection-start-column=
"106"
selection-end-line=
"206"
selection-end-column=
"106"
/>
<folding>
<element
signature=
"e#45#62#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/GengmeiFlutterPlugin.kt
View file @
592bc5ed
...
...
@@ -227,6 +227,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
}).
addTo
(
disposable
)
}
QUIT_PAGE
->
{
disposable
.
clear
()
disposable
.
dispose
()
disposable
=
CompositeDisposable
()
quit_page
=
true
;
...
...
@@ -297,10 +298,22 @@ class GengmeiFlutterPlugin : MethodCallHandler {
}
resign
.
addRequestPermissionsResultListener
{
id
,
permissions
,
grantResults
->
if
(
grantResults
.
size
>
0
&&
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
&&
grantResults
[
1
]
==
PackageManager
.
PERMISSION_GRANTED
&&
grantResults
[
2
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
listener
.
OK
();
if
(
grantResults
.
size
>
0
)
{
var
givePremission
=
true
;
grantResults
.
forEach
{
if
(
it
!=
PackageManager
.
PERMISSION_GRANTED
)
{
givePremission
=
false
;
}
}
if
(
givePremission
)
{
listener
.
OK
()
}
else
{
Toast
.
makeText
(
activity
.
applicationContext
,
"请同意权限"
,
Toast
.
LENGTH_SHORT
).
show
()
result
?.
run
{
this
.
error
(
"没有权限!!"
,
"no premission"
,
"没有权限!!"
);
}
}
}
else
{
Toast
.
makeText
(
activity
.
applicationContext
,
"请同意权限"
,
Toast
.
LENGTH_SHORT
).
show
()
result
?.
run
{
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt
View file @
592bc5ed
...
...
@@ -5,6 +5,7 @@ import android.graphics.BitmapFactory
import
android.os.Environment
import
android.provider.MediaStore
import
android.util.Log
import
com.example.gengmei_flutter_plugin.ImagePlugin.repository.local.ThumbUtil
import
com.example.gengmei_flutter_plugin.utils.MyUtil
import
com.example.gengmei_flutter_plugin.utils.MyUtil.Companion.getFileFullName
import
com.example.gengmei_flutter_plugin.utils.MyUtil.Companion.getFileName
...
...
@@ -24,6 +25,9 @@ import java.util.*
import
java.util.concurrent.*
import
kotlin.collections.ArrayList
import
kotlin.collections.HashMap
import
android.media.ThumbnailUtils
import
android.graphics.Bitmap
/**
* Created by lsy
...
...
@@ -31,12 +35,12 @@ import kotlin.collections.HashMap
*/
class
ImageRespository
{
private
val
globalThreadPool
=
ThreadPoolExecutor
(
0
,
15
,
30
,
TimeUnit
.
SECONDS
,
LinkedBlocking
Deque
());
private
val
globalThreadPool
=
ThreadPoolExecutor
(
10
,
10
,
30
,
TimeUnit
.
SECONDS
,
LinkedBlocking
Queue
<
Runnable
>
());
val
recordImageListMap
=
ArrayList
<
HashMap
<
String
,
Any
>>()
var
finishOneTask
=
false
val
fileDir
=
Environment
.
getExternalStorageDirectory
().
absolutePath
+
"/GMAlbum/.album"
;
val
fileDir
=
Environment
.
getExternalStorageDirectory
().
absolutePath
+
"/
.
GMAlbum/.album"
;
//: HashMap<String, ArrayList<HashMap<String, Any>>>
...
...
@@ -46,37 +50,121 @@ class ImageRespository {
file
.
mkdirs
();
}
if
(!
recordImageListMap
.
isEmpty
()
&&
finishOneTask
)
{
return
Observable
.
just
(
toMap
(
context
,
recordImageListMap
))
return
Observable
.
just
(
toMap
(
context
,
recordImageListMap
))
.
subscribeOn
(
Schedulers
.
computation
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
}
return
Observable
.
create
(
ObservableOnSubscribe
<
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>>
{
// val images = ArrayList<MediaFile>()
val
images
=
ImageScanner
(
context
).
queryMedia
()
val
videos
=
VideoScanner
(
context
).
queryMedia
()
images
.
addAll
(
videos
)
it
.
onNext
(
getFinalMap
(
context
,
images
))
}).
subscribeOn
(
Schedulers
.
computation
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
}
val
st
=
System
.
currentTimeMillis
();
val
images
=
ThumbUtil
.
getAllPictures
(
context
.
applicationContext
)
val
realImages
=
ImageScanner
(
context
.
applicationContext
).
queryMedia
()
Log
.
e
(
"lsy"
,
" SIZE ${images.size} ${realImages.size}"
)
val
iterator
=
realImages
.
iterator
()
while
(
iterator
.
hasNext
())
{
val
it2
=
iterator
.
next
()
for
(
item
in
images
)
{
if
(
item
.
id
==
it2
.
id
)
{
it2
.
path
=
item
.
path
it2
.
isVideo
=
false
break
}
}
}
val
videos
=
ThumbUtil
.
getAllVideos
(
context
.
applicationContext
)
val
realVideos
=
VideoScanner
(
context
.
applicationContext
).
queryMedia
()
Log
.
e
(
"lsy"
,
" SIZE ${videos.size} ${realVideos.size}"
)
val
iteratorVideo
=
realVideos
.
iterator
()
while
(
iteratorVideo
.
hasNext
())
{
val
it1
=
iteratorVideo
.
next
()
for
(
item
in
videos
)
{
if
(
item
.
id
==
it1
.
id
)
{
it1
.
path
=
item
.
path
it1
.
isVideo
=
true
break
}
}
}
realVideos
.
addAll
(
realImages
)
realVideos
.
sortByDescending
{
it
.
dateToken
}
Log
.
e
(
"lsy"
,
" T15555 !! "
+
(
System
.
currentTimeMillis
()
-
st
))
val
finalMap
=
getFinalMap
(
context
,
realVideos
)
it
.
onNext
(
finalMap
)
}).
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
}
fun
savePreviewImg
(
context
:
Context
,
listener
:
savePreviewListener
)
{
val
start
=
System
.
currentTimeMillis
();
val
needSize
=
recordImageListMap
.
size
;
var
currentSize
=
0
;
var
letSize
=
10
var
noPathSize
=
0
;
recordImageListMap
.
forEach
{
val
any
=
it
[
"path"
]
if
(
it
[
"realPath"
]
==
null
)
{
return
@forEach
}
val
realPath
=
it
[
"realPath"
]
as
String
if
(
any
==
null
)
{
globalThreadPool
.
execute
{
globalThreadPool
.
execute
{
if
(
any
==
null
||
!
File
(
any
as
String
).
exists
())
{
Log
.
e
(
"lsy"
,
" THREADMAME "
+
Thread
.
currentThread
().
name
)
if
(
it
[
"isVideo"
]
==
"T"
)
{
it
[
"path"
]
=
MyUtil
.
saveVideoImg
(
"${fileDir}/${getFileName(realPath)!!}.png"
,
realPath
,
MediaStore
.
Images
.
Thumbnails
.
MICRO_KIND
,
220
,
220
)
}
else
{
val
get
=
Luban
.
with
(
context
).
setTargetDir
(
fileDir
)
.
setName
(
getFileName
(
realPath
)
!!
)
.
get
(
realPath
);
it
[
"path"
]
=
get
.
absolutePath
;
val
tempFilePngString
=
fileDir
+
"/"
+
getFileName
(
realPath
)
!!
+
".png"
;
val
tempFilePngExists
=
File
(
tempFilePngString
).
exists
()
val
tempFileJpgString
=
fileDir
+
"/"
+
getFileName
(
realPath
)
!!
+
".jpg"
;
val
tempFileJpgExists
=
File
(
tempFileJpgString
).
exists
()
val
tempFileJpegString
=
fileDir
+
"/"
+
getFileName
(
realPath
)
!!
+
".jpeg"
val
tempFileJpegExists
=
File
(
tempFileJpegString
).
exists
()
if
(
tempFilePngExists
)
{
it
[
"path"
]
=
tempFilePngString
;
synchronized
(
this
)
{
currentSize
++;
Log
.
e
(
"lsy"
,
"HAVE PATH ${noPathSize} ${currentSize} ${needSize}"
)
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis()-start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
}
return
@execute
}
else
if
(
tempFileJpgExists
)
{
it
[
"path"
]
=
tempFileJpgString
;
synchronized
(
this
)
{
currentSize
++;
Log
.
e
(
"lsy"
,
"HAVE PATH ${noPathSize} ${currentSize} ${needSize}"
)
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis()-start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
}
return
@execute
}
else
if
(
tempFileJpegExists
)
{
it
[
"path"
]
=
tempFileJpegString
;
synchronized
(
this
)
{
currentSize
++;
Log
.
e
(
"lsy"
,
"HAVE PATH ${noPathSize} ${currentSize} ${needSize}"
)
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis()-start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
}
return
@execute
}
else
{
val
time
=
System
.
currentTimeMillis
();
// val get = Luban.with(context).setTargetDir(fileDir)
// .setName(getFileName(realPath)!!)
// .get(realPath);
// it["path"] = get.absolutePath;
it
[
"path"
]
=
MyUtil
.
scareImg
(
realPath
,
200f
,
tempFilePngString
,
75
)
Log
.
e
(
"lsy"
,
"TIMM${System.currentTimeMillis() - time}"
)
}
}
//getImageCacheDir(context, Luban.DEFAULT_DISK_CACHE_DIR)!!.absolutePath
synchronized
(
this
)
{
...
...
@@ -84,23 +172,25 @@ class ImageRespository {
noPathSize
++;
Log
.
e
(
"lsy"
,
"${noPathSize} ${currentSize} ${needSize}"
)
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis()-start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
else
{
if
(
noPathSize
>
letSize
)
{
letSize
+=
15
letSize
+=
70
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
}
}
}
}
else
{
synchronized
(
this
)
{
currentSize
++;
Log
.
e
(
"lsy"
,
"HAVE PATH ${noPathSize} ${currentSize} ${needSize}"
)
if
(
currentSize
==
needSize
)
{
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
else
{
synchronized
(
this
)
{
currentSize
++;
Log
.
e
(
"lsy"
,
"HAVE PATH ${noPathSize} ${currentSize} ${needSize}"
)
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis()-start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
}
}
}
}
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/bean/MediaFile.kt
View file @
592bc5ed
...
...
@@ -6,6 +6,7 @@ package com.example.myimagepicker.bean
*/
data class
MediaFile
(
var
id
:
Int
?
=
0
,
var
path
:
String
?
=
null
,
var
mime
:
String
?
=
null
,
var
folderId
:
Int
?
=
null
,
...
...
@@ -16,5 +17,7 @@ data class MediaFile(
var
isBigIm
:
Boolean
=
false
,
var
bigScare
:
Float
=
0f
,
var
realPath
:
String
?
=
null
,
var
isVideo
:
Boolean
?
=
null
var
isVideo
:
Boolean
?
=
null
,
var
width
:
Int
?
=
0
,
var
height
:
Int
?
=
0
)
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ImageScanner.kt
View file @
592bc5ed
...
...
@@ -24,7 +24,13 @@ class ImageScanner(var context: Context) : AbsMediaScanner<MediaFile>(context) {
override
val
projection
:
Array
<
String
>
get
()
=
arrayOf
(
MediaStore
.
Images
.
Media
.
DATA
,
MediaStore
.
Images
.
Media
.
MIME_TYPE
,
MediaStore
.
Images
.
Media
.
BUCKET_ID
,
MediaStore
.
Images
.
Media
.
BUCKET_DISPLAY_NAME
,
MediaStore
.
Images
.
Media
.
DATE_TAKEN
,
MediaStore
.
Images
.
Media
.
SIZE
)
arrayOf
(
MediaStore
.
Images
.
Media
.
DATA
,
// MediaStore.Images.Media.MIME_TYPE,
// MediaStore.Images.Media.BUCKET_ID,
MediaStore
.
Images
.
Media
.
BUCKET_DISPLAY_NAME
,
MediaStore
.
Images
.
Media
.
DATE_TAKEN
,
MediaStore
.
Images
.
Media
.
SIZE
,
MediaStore
.
Audio
.
Media
.
_ID
)
override
val
selection
:
String
get
()
=
...
...
@@ -46,41 +52,47 @@ class ImageScanner(var context: Context) : AbsMediaScanner<MediaFile>(context) {
* @return
*/
override
fun
parse
(
cursor
:
Cursor
):
MediaFile
{
val
path
=
cursor
.
getString
(
cursor
.
getColumnIndex
(
MediaStore
.
Images
.
Media
.
DATA
))
val
mime
=
cursor
.
getString
(
cursor
.
getColumnIndex
(
MediaStore
.
Images
.
Media
.
MIME_TYPE
))
val
folderId
=
cursor
.
getInt
(
cursor
.
getColumnIndex
(
MediaStore
.
Images
.
Media
.
BUCKET_ID
))
val
folderName
=
cursor
.
getString
(
cursor
.
getColumnIndex
(
MediaStore
.
Images
.
Media
.
BUCKET_DISPLAY_NAME
))
val
dateToken
=
cursor
.
getLong
(
cursor
.
getColumnIndex
(
MediaStore
.
Images
.
Media
.
DATE_TAKEN
))
val
size
=
cursor
.
getLong
(
cursor
.
getColumnIndex
(
MediaStore
.
Images
.
Media
.
SIZE
))
val
mediaFile
=
MediaFile
()
// val path = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA))
// val mime = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.MIME_TYPE))
// val folderId = cursor.getInt(cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID))
// val folderName = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME))
// val dateToken = cursor.getLong(cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN))
// val size = cursor.getLong(cursor.getColumnIndex(MediaStore.Images.Media.SIZE))
mediaFile
.
mime
=
mime
mediaFile
.
folderId
=
folderId
val
path
=
cursor
.
getString
(
0
)
val
folderName
=
cursor
.
getString
(
1
)
val
dateToken
=
cursor
.
getLong
(
2
)
val
size
=
cursor
.
getLong
(
3
)
val
id
=
cursor
.
getInt
(
4
);
val
mediaFile
=
MediaFile
()
mediaFile
.
id
=
id
// mediaFile.mime = mime
// mediaFile.folderId = folderId
mediaFile
.
folderName
=
folderName
mediaFile
.
dateToken
=
dateToken
mediaFile
.
size
=
size
mediaFile
.
realPath
=
path
mediaFile
.
isVideo
=
false
val
dir
=
Environment
.
getExternalStorageDirectory
().
absolutePath
+
"/GMAlbum/.album"
;
// val dir = getImageCacheDir(context, Luban.DEFAULT_DISK_CACHE_DIR)!!.absolutePath;
val
tempFilePngString
=
dir
+
"/"
+
getFileName
(
path
)
!!
+
".png"
;
val
tempFilePngExists
=
File
(
tempFilePngString
).
exists
()
if
(
tempFilePngExists
)
{
mediaFile
.
path
=
tempFilePngString
;
}
val
tempFileJpgString
=
dir
+
"/"
+
getFileName
(
path
)
!!
+
".jpg"
;
val
tempFileJpgExists
=
File
(
tempFileJpgString
).
exists
()
if
(
tempFileJpgExists
)
{
mediaFile
.
path
=
tempFileJpgString
;
}
val
tempFileJpegString
=
dir
+
"/"
+
getFileName
(
path
)
!!
+
".jpeg"
val
tempFileJpegExists
=
File
(
tempFileJpegString
).
exists
()
if
(
tempFileJpegExists
)
{
mediaFile
.
path
=
tempFileJpegString
;
}
if
(
size
<
1024
*
160
)
{
mediaFile
.
path
=
path
}
//
val dir = Environment.getExternalStorageDirectory().absolutePath + "/GMAlbum/.album";
//
//
val dir = getImageCacheDir(context, Luban.DEFAULT_DISK_CACHE_DIR)!!.absolutePath;
//
val tempFilePngString = dir + "/" + getFileName(path)!! + ".png";
//
val tempFilePngExists = File(tempFilePngString).exists()
//
if (tempFilePngExists) {
//
mediaFile.path = tempFilePngString;
//
}
//
val tempFileJpgString = dir + "/" + getFileName(path)!! + ".jpg";
//
val tempFileJpgExists = File(tempFileJpgString).exists()
//
if (tempFileJpgExists) {
//
mediaFile.path = tempFileJpgString;
//
}
//
val tempFileJpegString = dir + "/" + getFileName(path)!! + ".jpeg"
//
val tempFileJpegExists = File(tempFileJpegString).exists()
//
if (tempFileJpegExists) {
//
mediaFile.path = tempFileJpegString;
//
}
//
if (size < 1024 * 160) {
//
mediaFile.path = path
//
}
//
// if (it.size > 1024 * 1024 && !tempFilePngExists
// && !tempFileJpgExists && !tempFileJpegExists) {
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/Thumb.kt
0 → 100644
View file @
592bc5ed
package
com.example.gengmei_flutter_plugin.ImagePlugin.repository.local
/**
* @author lsy
* @date 2019-10-27
*/
class
Thumb
{
companion
object
{
}
}
\ No newline at end of file
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/ThumbUtil.java
0 → 100644
View file @
592bc5ed
package
com
.
example
.
gengmei_flutter_plugin
.
ImagePlugin
.
repository
.
local
;
import
android.content.ContentResolver
;
import
android.content.Context
;
import
android.database.Cursor
;
import
android.provider.MediaStore
;
import
android.util.Log
;
import
com.example.myimagepicker.bean.MediaFile
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
/**
* @author lsy
* @date 2019-10-27
*/
public
class
ThumbUtil
{
public
static
ArrayList
<
MediaFile
>
getAllPictures
(
Context
context
)
{
long
st
=
System
.
currentTimeMillis
();
ArrayList
<
MediaFile
>
scanList
=
new
ArrayList
<>();
ContentResolver
cr
=
context
.
getContentResolver
();
Cursor
cursor
=
cr
.
query
(
MediaStore
.
Images
.
Thumbnails
.
EXTERNAL_CONTENT_URI
,
new
String
[]{
MediaStore
.
Images
.
Thumbnails
.
IMAGE_ID
,
MediaStore
.
Images
.
Thumbnails
.
DATA
,
MediaStore
.
Images
.
Thumbnails
.
WIDTH
,
MediaStore
.
Images
.
Thumbnails
.
HEIGHT
,
},
null
,
null
,
null
);
if
(
cursor
!=
null
&&
cursor
.
moveToFirst
())
{
do
{
MediaFile
mediaFile
=
new
MediaFile
();
mediaFile
.
setId
(
cursor
.
getInt
(
0
));
mediaFile
.
setPath
(
cursor
.
getString
(
1
));
mediaFile
.
setWidth
(
cursor
.
getInt
(
2
));
mediaFile
.
setHeight
(
cursor
.
getInt
(
3
));
mediaFile
.
setVideo
(
false
);
scanList
.
add
(
mediaFile
);
}
while
(
cursor
.
moveToNext
());
cursor
.
close
();
}
Log
.
e
(
"lsy"
,
" T1122 !! "
+
(
System
.
currentTimeMillis
()
-
st
));
return
scanList
;
}
// public static ArrayList<MediaFile> getAllRealImages(Context context){
// ArrayList<MediaFile> scanList = new ArrayList<>();
// ContentResolver cr = context.getContentResolver();
// Cursor cursor = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
// new String[]{
// MediaStore.Images.Media.DATA,
// MediaStore.Images.Media.MIME_TYPE,
// MediaStore.Images.Media.BUCKET_ID,
// MediaStore.Images.Media.BUCKET_DISPLAY_NAME,
// MediaStore.Images.Media.DATE_TAKEN,
// MediaStore.Images.Media.SIZE,
// MediaStore.Audio.Media._ID
//
// },
// MediaStore.Audio.Media._ID + "=" + file.getId(),
// null,
// MediaStore.Images.Media.DATE_TAKEN +
// " DESC"
// );
//
//
// for (int i = 0; i < scanList.size(); i++) {
// MediaFile file = scanList.get(i);
//
// if (cursor.moveToFirst()) {
// do {
// String path = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.DATA));
// String mime = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.MIME_TYPE));
// int folderId = cursor.getInt(cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_ID));
// String folderName = cursor.getString(cursor.getColumnIndex(MediaStore.Images.Media.BUCKET_DISPLAY_NAME));
// long dateToken = cursor.getLong(cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN));
// long size = cursor.getLong(cursor.getColumnIndex(MediaStore.Images.Media.SIZE));
// long aLong = cursor.getLong(6);
// Log.e("lsy", " LONGGG " + aLong);
// file.setRealPath(path);
// file.setMime(mime);
// file.setFolderId(folderId);
// file.setFolderName(folderName);
// file.setDateToken(dateToken);
// file.setSize(size);
// scanList.set(i, file);
// } while (cursor.moveToNext());
// cursor.close();
// }
// }
// return scanList;
// }
public
static
ArrayList
<
MediaFile
>
getAllVideos
(
Context
context
)
{
ArrayList
<
MediaFile
>
scanList
=
new
ArrayList
<>();
ContentResolver
cr
=
context
.
getContentResolver
();
Cursor
cursor
=
cr
.
query
(
MediaStore
.
Video
.
Thumbnails
.
EXTERNAL_CONTENT_URI
,
new
String
[]{
MediaStore
.
Video
.
Thumbnails
.
VIDEO_ID
,
MediaStore
.
Video
.
Thumbnails
.
DATA
,
MediaStore
.
Video
.
Thumbnails
.
WIDTH
,
MediaStore
.
Video
.
Thumbnails
.
HEIGHT
,
},
null
,
null
,
null
);
if
(
cursor
!=
null
&&
cursor
.
moveToFirst
())
{
do
{
MediaFile
mediaFile
=
new
MediaFile
();
mediaFile
.
setId
(
cursor
.
getInt
(
0
));
mediaFile
.
setPath
(
cursor
.
getString
(
1
));
mediaFile
.
setWidth
(
cursor
.
getInt
(
2
));
mediaFile
.
setHeight
(
cursor
.
getInt
(
3
));
scanList
.
add
(
mediaFile
);
}
while
(
cursor
.
moveToNext
());
cursor
.
close
();
}
// for (int i = 0; i < scanList.size(); i++) {
// MediaFile file = scanList.get(i);
// cursor = cr.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
// new String[]{
// MediaStore.Video.Media.DATA,
// MediaStore.Video.Media.MIME_TYPE,
// MediaStore.Video.Media.BUCKET_ID,
// MediaStore.Video.Media.BUCKET_DISPLAY_NAME,
// MediaStore.Video.Media.DURATION,
// MediaStore.Video.Media.DATE_TAKEN,
// MediaStore.Images.Media.SIZE
// },
// MediaStore.Audio.Media._ID + "=" + file.getId(),
// null,
// MediaStore.Images.Media.DATE_TAKEN +
// " DESC"
// );
// if (cursor.moveToFirst()) {
// do {
// String path = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.DATA));
// String mime = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.MIME_TYPE));
// int folderId = cursor.getInt(cursor.getColumnIndex(MediaStore.Video.Media.BUCKET_ID));
// String folderName = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.BUCKET_DISPLAY_NAME));
// long duration = cursor.getLong(cursor.getColumnIndex(MediaStore.Video.Media.DURATION));
// long dateToken = cursor.getLong(cursor.getColumnIndex(MediaStore.Video.Media.DATE_TAKEN));
// file.setRealPath(path);
// file.setMime(mime);
// file.setFolderId(folderId);
// file.setFolderName(folderName);
// file.setDateToken(dateToken);
// file.setDuration(duration);
// scanList.set(i, file);
// } while (cursor.moveToNext());
// cursor.close();
// }
// }
return
scanList
;
}
}
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/VideoScanner.kt
View file @
592bc5ed
...
...
@@ -5,6 +5,7 @@ import android.database.Cursor
import
android.net.Uri
import
android.os.Environment
import
android.provider.MediaStore
import
android.util.Log
import
com.example.gengmei_flutter_plugin.utils.MyUtil
import
com.example.myimagepicker.bean.MediaFile
import
java.io.File
...
...
@@ -22,14 +23,21 @@ class VideoScanner(private val mContext: Context) : AbsMediaScanner<MediaFile>(m
override
val
projection
:
Array
<
String
>
get
()
=
arrayOf
(
MediaStore
.
Video
.
Media
.
DATA
,
MediaStore
.
Video
.
Media
.
MIME_TYPE
,
MediaStore
.
Video
.
Media
.
BUCKET_ID
,
MediaStore
.
Video
.
Media
.
BUCKET_DISPLAY_NAME
,
MediaStore
.
Video
.
Media
.
DURATION
,
MediaStore
.
Video
.
Media
.
DATE_TAKEN
,
MediaStore
.
Images
.
Media
.
SIZE
arrayOf
(
MediaStore
.
Video
.
Media
.
DATA
,
// MediaStore.Video.Media.MIME_TYPE,
// MediaStore.Video.Media.BUCKET_ID,
MediaStore
.
Video
.
Media
.
BUCKET_DISPLAY_NAME
,
MediaStore
.
Video
.
Media
.
DURATION
,
MediaStore
.
Video
.
Media
.
DATE_TAKEN
,
MediaStore
.
Images
.
Media
.
SIZE
,
MediaStore
.
Audio
.
Media
.
_ID
)
override
val
order
:
String
get
()
=
MediaStore
.
Video
.
Media
.
DATE_TAKEN
+
" desc"
override
val
selectionArgs
:
Array
<
String
>?
// get() = null
// get() = null
get
()
=
arrayOf
(
"video/mp4"
,
"video/avi"
)
override
val
selection
:
String
...
...
@@ -45,38 +53,47 @@ class VideoScanner(private val mContext: Context) : AbsMediaScanner<MediaFile>(m
*/
protected
override
fun
parse
(
cursor
:
Cursor
):
MediaFile
{
val
path
=
cursor
.
getString
(
cursor
.
getColumnIndex
(
MediaStore
.
Video
.
Media
.
DATA
))
val
mime
=
cursor
.
getString
(
cursor
.
getColumnIndex
(
MediaStore
.
Video
.
Media
.
MIME_TYPE
))
val
folderId
=
cursor
.
getInt
(
cursor
.
getColumnIndex
(
MediaStore
.
Video
.
Media
.
BUCKET_ID
))
val
folderName
=
cursor
.
getString
(
cursor
.
getColumnIndex
(
MediaStore
.
Video
.
Media
.
BUCKET_DISPLAY_NAME
))
val
duration
=
cursor
.
getLong
(
cursor
.
getColumnIndex
(
MediaStore
.
Video
.
Media
.
DURATION
))
val
dateToken
=
cursor
.
getLong
(
cursor
.
getColumnIndex
(
MediaStore
.
Video
.
Media
.
DATE_TAKEN
))
// val path = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.DATA))
// val mime = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.MIME_TYPE))
// val folderId = cursor.getInt(cursor.getColumnIndex(MediaStore.Video.Media.BUCKET_ID))
// val folderName = cursor.getString(cursor.getColumnIndex(MediaStore.Video.Media.BUCKET_DISPLAY_NAME))
// val duration = cursor.getLong(cursor.getColumnIndex(MediaStore.Video.Media.DURATION))
// val dateToken = cursor.getLong(cursor.getColumnIndex(MediaStore.Video.Media.DATE_TAKEN))
val
path
=
cursor
.
getString
(
0
)
val
folderName
=
cursor
.
getString
(
1
)
val
duration
=
cursor
.
getLong
(
2
)
val
dateToken
=
cursor
.
getLong
(
3
)
val
size
=
cursor
.
getLong
(
4
)
val
id
=
cursor
.
getInt
(
5
);
val
mediaFile
=
MediaFile
()
mediaFile
.
realPath
=
path
mediaFile
.
mime
=
mime
mediaFile
.
folderId
=
folderId
//
mediaFile.mime = mime
//
mediaFile.folderId = folderId
mediaFile
.
folderName
=
folderName
mediaFile
.
duration
=
duration
mediaFile
.
dateToken
=
dateToken
mediaFile
.
isVideo
=
true
val
dir
=
Environment
.
getExternalStorageDirectory
().
absolutePath
+
"/GMAlbum/.album"
// val dir = getImageCacheDir(context, Luban.DEFAULT_DISK_CACHE_DIR)!!.absolutePath;
val
tempFilePngString
=
dir
+
"/"
+
MyUtil
.
getFileName
(
path
)
!!
+
".png"
;
val
tempFilePngExists
=
File
(
tempFilePngString
).
exists
()
if
(
tempFilePngExists
)
{
mediaFile
.
path
=
tempFilePngString
;
}
val
tempFileJpgString
=
dir
+
"/"
+
MyUtil
.
getFileName
(
path
)
!!
+
".jpg"
;
val
tempFileJpgExists
=
File
(
tempFileJpgString
).
exists
()
if
(
tempFileJpgExists
)
{
mediaFile
.
path
=
tempFileJpgString
;
}
val
tempFileJpegString
=
dir
+
"/"
+
MyUtil
.
getFileName
(
path
)
!!
+
".jpeg"
val
tempFileJpegExists
=
File
(
tempFileJpegString
).
exists
()
if
(
tempFileJpegExists
)
{
mediaFile
.
path
=
tempFileJpegString
;
}
mediaFile
.
isVideo
=
true
mediaFile
.
size
=
size
mediaFile
.
id
=
id
// val dir = Environment.getExternalStorageDirectory().absolutePath + "/GMAlbum/.album"
//// val dir = getImageCacheDir(context, Luban.DEFAULT_DISK_CACHE_DIR)!!.absolutePath;
// val tempFilePngString = dir + "/" + MyUtil.getFileName(path)!! + ".png";
// val tempFilePngExists = File(tempFilePngString).exists()
// if (tempFilePngExists) {
// mediaFile.path = tempFilePngString;
// }
// val tempFileJpgString = dir + "/" + MyUtil.getFileName(path)!! + ".jpg";
// val tempFileJpgExists = File(tempFileJpgString).exists()
// if (tempFileJpgExists) {
// mediaFile.path = tempFileJpgString;
// }
// val tempFileJpegString = dir + "/" + MyUtil.getFileName(path)!! + ".jpeg"
// val tempFileJpegExists = File(tempFileJpegString).exists()
// if (tempFileJpegExists) {
// mediaFile.path = tempFileJpegString;
// }
return
mediaFile
}
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/utils/FileUtil.java
View file @
592bc5ed
package
com
.
example
.
gengmei_flutter_plugin
.
utils
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.util.Log
;
import
java.io.File
;
...
...
@@ -18,9 +20,8 @@ public class FileUtil {
if
(
fileNames
.
length
>
0
)
{
// directory
File
file
=
new
File
(
newPath
);
if
(!
file
.
mkdirs
())
{
Log
.
d
(
"mkdir"
,
"can't make folder"
);
if
(!
file
.
mkdirs
())
{
Log
.
d
(
"mkdir"
,
"can't make folder"
);
}
...
...
@@ -47,7 +48,9 @@ public class FileUtil {
}
}
public
static
void
copyAssetsFileToSD
(
Context
context
,
String
name
,
String
predictorPath
)
{
public
static
void
copyAssetsFileToSD
(
Context
context
,
String
name
,
String
predictorPath
)
{
// File file = new File(predictorPath);
// if (file.exists()) {
// return;
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/utils/MyUtil.kt
View file @
592bc5ed
...
...
@@ -6,8 +6,11 @@ import com.example.myimagepicker.luban.Luban
import
java.io.File
import
android.media.ThumbnailUtils
import
android.graphics.Bitmap
import
android.graphics.BitmapFactory
import
android.util.DebugUtils
import
java.io.FileNotFoundException
import
java.io.FileOutputStream
import
java.io.IOException
import
java.lang.Exception
...
...
@@ -77,6 +80,53 @@ class MyUtil {
return
filePath
}
fun
scareImg
(
imgPath
:
String
,
scareSize
:
Float
,
filePath
:
String
,
quality
:
Int
):
String
{
val
newOpts
=
BitmapFactory
.
Options
()
// 开始读入图片,此时把options.inJustDecodeBounds 设回true,即只读边不读内容
newOpts
.
inJustDecodeBounds
=
true
newOpts
.
inPreferredConfig
=
Bitmap
.
Config
.
RGB_565
// 获取位图信息,但请注意位图现在为空
var
bitmap
=
BitmapFactory
.
decodeFile
(
imgPath
,
newOpts
)
newOpts
.
inJustDecodeBounds
=
false
val
w
=
newOpts
.
outWidth
val
h
=
newOpts
.
outHeight
val
max
=
Math
.
max
(
w
,
h
)
var
scare
=
1f
if
(
max
>
scareSize
)
{
scare
=
max
/
scareSize
}
// 想要缩放的目标尺寸,现在大部分手机都是1080*1920,参考值可以让宽高都缩小一倍
// float hh = w * scare;// 设置高度为960f时,可以明显看到图片缩小了
// float ww = h * scare;// 设置宽度为540f,可以明显看到图片缩小了
// // 缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可
// int be = 1;// be=1表示不缩放
// if (w > h && w > ww) {// 如果宽度大的话根据宽度固定大小缩放
// be = (int) (newOpts.outWidth / ww);
// } else if (w < h && h > hh) {// 如果高度高的话根据宽度固定大小缩放
// be = (int) (newOpts.outHeight / hh);
// }
// if (be <= 0)
// be = 1;
newOpts
.
inSampleSize
=
scare
.
toInt
()
// 设置缩放比例
// 开始压缩图片,注意此时已经把options.inJustDecodeBounds 设回false了
bitmap
=
BitmapFactory
.
decodeFile
(
imgPath
,
newOpts
)
val
file
=
File
(
filePath
)
try
{
val
out
=
FileOutputStream
(
file
)
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
PNG
,
quality
,
out
)
out
.
flush
()
out
.
close
()
bitmap
.
recycle
()
}
catch
(
e
:
FileNotFoundException
)
{
e
.
printStackTrace
()
}
catch
(
e
:
IOException
)
{
e
.
printStackTrace
()
}
return
filePath
}
}
}
example/lib/AlbumModel/page/album/AlbumModel.dart
View file @
592bc5ed
...
...
@@ -64,12 +64,8 @@ class AlbumModel {
if
(
key
[
i
]
==
null
)
{
continue
;
}
if
(
itemList
[
i
].
path
==
null
)
{
itemList
[
i
].
path
=
key
[
i
][
"path"
];
}
if
(
itemList
[
i
].
realPath
==
null
)
{
itemList
[
i
].
realPath
=
key
[
i
][
"realPath"
];
}
itemList
[
i
].
path
=
key
[
i
][
"path"
];
itemList
[
i
].
realPath
=
key
[
i
][
"realPath"
];
}
}
});
...
...
example/lib/AlbumModel/page/album/AlbumPage.dart
View file @
592bc5ed
...
...
@@ -127,9 +127,9 @@ class AlbumState extends State<AlbumPage> {
}
return
GridView
.
builder
(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
3
,
crossAxisSpacing:
5
,
mainAxisSpacing:
5
,
crossAxisCount:
4
,
crossAxisSpacing:
1
,
mainAxisSpacing:
1
,
childAspectRatio:
1
),
itemCount:
imgList
.
data
.
length
+
2
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
...
...
@@ -204,6 +204,7 @@ class AlbumState extends State<AlbumPage> {
color:
Colors
.
grey
,
size:
25
,
),
imgList
.
data
[
newIndex
].
isVideo
?
Icon
(
Icons
.
cancel
,
color:
Colors
.
yellow
,):
Container
(),
_model
.
isFullSelect
()
&&
!
_model
.
isSelect
(
newIndex
)
?
Container
(
width:
double
.
maxFinite
,
...
...
gengmei_flutter_plugin.iml
View file @
592bc5ed
...
...
@@ -17,6 +17,7 @@
<excludeFolder
url=
"file://$MODULE_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/.dart_tool"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/.pub"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/build"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/ios/Flutter/App.framework/flutter_assets/packages"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/ios/Flutter/App.framework/flutter_assets/packages"
/>
</content>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment