Commit f4c17948 authored by 林生雨's avatar 林生雨

co

parent 9363f117
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
<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 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$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/kotlin/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.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$/lib/ScanImagePlugn.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/ScanImagePlugn.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart" 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/" />
...@@ -30,8 +34,8 @@ ...@@ -30,8 +34,8 @@
<file pinned="false" current-in-tab="false"> <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="305"> <state relative-caret-position="417">
<caret line="63" column="32" selection-start-line="63" selection-start-column="22" selection-end-line="63" selection-end-column="32" /> <caret line="67" column="36" selection-start-line="67" selection-start-column="22" selection-end-line="67" selection-end-column="36" />
<folding> <folding>
<element signature="e#45#86#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#45#86#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
...@@ -101,8 +105,8 @@ ...@@ -101,8 +105,8 @@
<file pinned="false" current-in-tab="$ENABLE_FLUTTER_DESKTOP$"> <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="-1084"> <state relative-caret-position="462">
<caret line="36" selection-start-line="36" selection-end-line="36" /> <caret line="56" column="63" selection-start-line="56" selection-start-column="63" selection-end-line="56" selection-end-column="63" />
<folding> <folding>
<element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
...@@ -194,11 +198,11 @@ ...@@ -194,11 +198,11 @@
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds">
<option name="x" value="266" /> <option name="x" value="26" />
<option name="y" value="93" /> <option name="y" value="184" />
<option name="width" value="1440" /> <option name="width" value="1440" />
<option name="height" value="811" /> <option name="height" value="821" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="$ENABLE_FLUTTER_DESKTOP$" /> <component name="ProjectLevelVcsManager" settingsEditedManually="$ENABLE_FLUTTER_DESKTOP$" />
<component name="ProjectView"> <component name="ProjectView">
...@@ -206,6 +210,9 @@ ...@@ -206,6 +210,9 @@
<foldersAlwaysOnTop value="$ENABLE_FLUTTER_DESKTOP$" /> <foldersAlwaysOnTop value="$ENABLE_FLUTTER_DESKTOP$" />
</navigator> </navigator>
<panes> <panes>
<pane id="AndroidView" />
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
...@@ -222,9 +229,6 @@ ...@@ -222,9 +229,6 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="AndroidView" />
<pane id="Scope" />
<pane id="PackagesPane" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
...@@ -271,10 +275,9 @@ ...@@ -271,10 +275,9 @@
<servers /> <servers />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="26" width="1440" height="812" extended-state="6" /> <frame x="67" y="23" width="1440" height="821" extended-state="0" />
<editor active="$ENABLE_FLUTTER_DESKTOP$" />
<layout> <layout>
<window_info active="$ENABLE_FLUTTER_DESKTOP$" content_ui="combo" id="Project" order="0" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.19742489" /> <window_info 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" />
...@@ -287,9 +290,9 @@ ...@@ -287,9 +290,9 @@
<window_info anchor="bottom" id="Run" order="1" weight="0.4993046" /> <window_info anchor="bottom" id="Run" order="1" weight="0.4993046" />
<window_info anchor="bottom" id="TODO" order="2" /> <window_info anchor="bottom" id="TODO" order="2" />
<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.20166898" /> <window_info anchor="bottom" id="Logcat" order="4" weight="0.20164609" />
<window_info anchor="bottom" id="Debug" order="5" weight="0.32962447" /> <window_info anchor="bottom" id="Debug" order="5" weight="0.32962447" />
<window_info anchor="bottom" id="Terminal" order="6" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.32777777" /> <window_info active="$ENABLE_FLUTTER_DESKTOP$" anchor="bottom" id="Terminal" order="6" visible="$ENABLE_FLUTTER_DESKTOP$" weight="0.32647464" />
<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" />
...@@ -541,6 +544,13 @@ ...@@ -541,6 +544,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$/android/build.gradle"> <entry file="file://$PROJECT_DIR$/android/build.gradle">
<provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor"> <provider selected="$ENABLE_FLUTTER_DESKTOP$" editor-type-id="text-editor">
<state relative-caret-position="110"> <state relative-caret-position="110">
...@@ -589,17 +599,10 @@ ...@@ -589,17 +599,10 @@
</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$/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="305"> <state relative-caret-position="417">
<caret line="63" column="32" selection-start-line="63" selection-start-column="22" selection-end-line="63" selection-end-column="32" /> <caret line="67" column="36" selection-start-line="67" selection-start-column="22" selection-end-line="67" selection-end-column="36" />
<folding> <folding>
<element signature="e#45#86#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#45#86#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
...@@ -608,8 +611,8 @@ ...@@ -608,8 +611,8 @@
</entry> </entry>
<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="-1084"> <state relative-caret-position="462">
<caret line="36" selection-start-line="36" selection-end-line="36" /> <caret line="56" column="63" selection-start-line="56" selection-start-column="63" selection-end-line="56" selection-end-column="63" />
<folding> <folding>
<element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" /> <element signature="e#0#20#0" expanded="$ENABLE_FLUTTER_DESKTOP$" />
</folding> </folding>
......
...@@ -41,6 +41,7 @@ class GengmeiFlutterPlugin : MethodCallHandler { ...@@ -41,6 +41,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
var resultKey = 0L var resultKey = 0L
var isAdded = false; var isAdded = false;
private var record: HashMap<String, ArrayList<HashMap<String, Any>>>? = null; private var record: HashMap<String, ArrayList<HashMap<String, Any>>>? = null;
var albumNeedCache = false;
var isTaskingExectured: Boolean = false; var isTaskingExectured: Boolean = false;
@Volatile @Volatile
...@@ -70,6 +71,7 @@ class GengmeiFlutterPlugin : MethodCallHandler { ...@@ -70,6 +71,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
const val GET_STRINGLIST_SHARED = "GET_STRINGLIST_SHARED" const val GET_STRINGLIST_SHARED = "GET_STRINGLIST_SHARED"
const val ALBUM_PLAY_VIDEO = "play_album_video" const val ALBUM_PLAY_VIDEO = "play_album_video"
const val PREVIEW_IMAGE = "PREVIEW_IMAGE" const val PREVIEW_IMAGE = "PREVIEW_IMAGE"
const val ALBUM_NEED_CACHE = "ALBUM_NEED_CACHE"
const val CLEAR_SHARE = "CLEAR_SHARE" const val CLEAR_SHARE = "CLEAR_SHARE"
const val PREMISSION = 10090 const val PREMISSION = 10090
...@@ -345,6 +347,11 @@ class GengmeiFlutterPlugin : MethodCallHandler { ...@@ -345,6 +347,11 @@ class GengmeiFlutterPlugin : MethodCallHandler {
resign.startActivity(intent) resign.startActivity(intent)
} }
} }
ALBUM_NEED_CACHE -> {
val result = resultKey;
albumNeedCache=call.arguments as Boolean
ResultManager.getInstance().resultSuccess(result, true)
}
PREVIEW_IMAGE -> { PREVIEW_IMAGE -> {
val result = resultKey; val result = resultKey;
val path = call.arguments as String? val path = call.arguments as String?
...@@ -370,7 +377,7 @@ class GengmeiFlutterPlugin : MethodCallHandler { ...@@ -370,7 +377,7 @@ class GengmeiFlutterPlugin : MethodCallHandler {
fun ScanImage(resultKey: Long) { fun ScanImage(resultKey: Long) {
quit_page = false; quit_page = false;
ImageRespository.getInstance().scanPhoneImage(resign).subscribe( ImageRespository.getInstance().scanPhoneImage(resign,albumNeedCache).subscribe(
{ {
record = it record = it
if (!quit_page) { if (!quit_page) {
......
...@@ -50,12 +50,12 @@ class ImageRespository { ...@@ -50,12 +50,12 @@ class ImageRespository {
//: HashMap<String, ArrayList<HashMap<String, Any>>> //: HashMap<String, ArrayList<HashMap<String, Any>>>
fun scanPhoneImage(context: Context): Observable<HashMap<String, ArrayList<HashMap<String, Any>>>> { fun scanPhoneImage(context: Context, needCache: Boolean): Observable<HashMap<String, ArrayList<HashMap<String, Any>>>> {
val file = File(fileDir); val file = File(fileDir);
if (!file.exists()) { if (!file.exists()) {
file.mkdirs(); file.mkdirs();
} }
if (!recordImageListMap.isEmpty() && finishOneTask) { if (!recordImageListMap.isEmpty() && finishOneTask && needCache) {
return Observable.just( return Observable.just(
toMap(context, recordImageListMap)) toMap(context, recordImageListMap))
.subscribeOn(Schedulers.computation()).observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.computation()).observeOn(AndroidSchedulers.mainThread())
...@@ -145,7 +145,7 @@ class ImageRespository { ...@@ -145,7 +145,7 @@ class ImageRespository {
} }
} }
} else { } else {
Log.e("lsy"," !!!! ${realPath} ${getFileName(realPath)==null}") Log.e("lsy", " !!!! ${realPath} ${getFileName(realPath) == null}")
val tempFilePngString = fileDir + "/" + getFileName(realPath)!! + ".png"; val tempFilePngString = fileDir + "/" + getFileName(realPath)!! + ".png";
val tempFilePngExists = File(tempFilePngString).exists() val tempFilePngExists = File(tempFilePngString).exists()
if (tempFilePngExists) { if (tempFilePngExists) {
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
@property(atomic,strong)NSMutableArray<NSMutableDictionary*>* channelList; @property(atomic,strong)NSMutableArray<NSMutableDictionary*>* channelList;
@property(atomic)int channelSize; @property(atomic)int channelSize;
@property(atomic)int channelAllSize; @property(atomic)int channelAllSize;
@property(nonatomic)bool needAlbumCache;
@end @end
@implementation GengmeiFlutterPlugin @implementation GengmeiFlutterPlugin
...@@ -495,8 +496,11 @@ NSString *cacheDirectory; ...@@ -495,8 +496,11 @@ NSString *cacheDirectory;
NSString *tempPath = [tempPathBefore stringByAppendingPathComponent:@"REALPATH"]; NSString *tempPath = [tempPathBefore stringByAppendingPathComponent:@"REALPATH"];
[self removeAllFilesAtPath:tempPath]; [self removeAllFilesAtPath:tempPath];
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES]; [[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES];
} }else if([@"ALBUM_NEED_CACHE" isEqualToString:call.method]){
else{ long resultTemp=self.resultKey;
self.needAlbumCache=call.arguments;
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES];
}else{
result(FlutterMethodNotImplemented); result(FlutterMethodNotImplemented);
} }
} }
...@@ -631,7 +635,7 @@ NSString *cacheDirectory; ...@@ -631,7 +635,7 @@ NSString *cacheDirectory;
CFAbsoluteTime startTime; CFAbsoluteTime startTime;
-(void)scanPhone:(long)resultId{ -(void)scanPhone:(long)resultId{
self.quitPage=false; self.quitPage=false;
if (self.finishScanImg) { if (self.finishScanImg&&self.needAlbumCache!=nil&&self.needAlbumCache) {
[[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultId] :self.finalMap]; [[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultId] :self.finalMap];
return; return;
} }
......
...@@ -65,6 +65,10 @@ class ScanImagePlugn { ...@@ -65,6 +65,10 @@ class ScanImagePlugn {
return await channel.invokeMethod("clear_data"); return await channel.invokeMethod("clear_data");
} }
static Future<bool> albumNeedCache(MethodChannel channel,bool need) async{
return await channel.invokeMethod("ALBUM_NEED_CACHE",need);
}
static Future<List> ios_album_path( static Future<List> ios_album_path(
MethodChannel channel, List<String> path) async { MethodChannel channel, List<String> path) async {
return await channel.invokeMethod("IOS_IMAGE_BY_PATH", path); return await channel.invokeMethod("IOS_IMAGE_BY_PATH", path);
......
...@@ -53,6 +53,10 @@ class GengmeiFlutterPlugin { ...@@ -53,6 +53,10 @@ class GengmeiFlutterPlugin {
return await ScanImagePlugn.quitPage(_channel); return await ScanImagePlugn.quitPage(_channel);
} }
static Future<bool> albumNeedCache(bool need) async {
return await ScanImagePlugn.albumNeedCache(_channel, need);
}
static Future<int> getInt(String key, int value) async { static Future<int> getInt(String key, int value) async {
return await SharedPlugin.getInt(key, value, _channel); return await SharedPlugin.getInt(key, value, _channel);
} }
......
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