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

co

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