Commit 2614a897 authored by 林生雨's avatar 林生雨

fix

parent 0431ebee
package io.flutter.plugins;
import io.flutter.plugin.common.PluginRegistry;
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin;
import com.idlefish.flutterboost.FlutterBoostPlugin;
import com.example.flutter_drag_scale.FlutterDragScalePlugin;
import com.example.gengmei_flutter_plugin.GengmeiFlutterPlugin;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
import com.tekartik.sqflite.SqflitePlugin;
import fleamarket.taobao.com.xservicekit.XserviceKitPlugin;
/**
* Generated file. Do not edit.
......@@ -16,12 +15,11 @@ public final class GeneratedPluginRegistrant {
if (alreadyRegisteredWith(registry)) {
return;
}
FlutterBoostPlugin.registerWith(registry.registrarFor("com.taobao.idlefish.flutterboost.FlutterBoostPlugin"));
FlutterBoostPlugin.registerWith(registry.registrarFor("com.idlefish.flutterboost.FlutterBoostPlugin"));
FlutterDragScalePlugin.registerWith(registry.registrarFor("com.example.flutter_drag_scale.FlutterDragScalePlugin"));
GengmeiFlutterPlugin.registerWith(registry.registrarFor("com.example.gengmei_flutter_plugin.GengmeiFlutterPlugin"));
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
XserviceKitPlugin.registerWith(registry.registrarFor("fleamarket.taobao.com.xservicekit.XserviceKitPlugin"));
}
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
......
......@@ -3,8 +3,6 @@ package com.example.gmalpha_flutter
import android.app.Activity
import android.app.Application
import android.content.Context
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin
import com.taobao.idlefish.flutterboost.interfaces.IPlatform
import io.flutter.BuildConfig
import io.flutter.Log
import io.flutter.view.FlutterMain
......
......@@ -8,8 +8,6 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.view.View
import com.taobao.idlefish.flutterboost.FlutterBoostPlugin
import com.taobao.idlefish.flutterboost.containers.BoostFlutterActivity
import io.flutter.app.FlutterActivity
import io.flutter.embedding.engine.plugins.FlutterPlugin
......
......@@ -175,6 +175,13 @@ function ios(){
cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/App.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
cp -r /Users/apple/lsy/gmalpha_flutter/ios/Flutter/Flutter.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/gengmei_flutter_plugin/gengmei_flutter_plugin.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/flutter_boost/flutter_boost.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/FMDB/FMDB.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/path_provider/path_provider.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/sqflite/sqflite.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
# cp -r /Users/apple/lsy/gmalpha_flutter/build/ios/Release-iphoneos/flutter_drag_scale/flutter_drag_scale.framework /Users/apple/lsy/GMAlpha/GMAlpha/Classes/APP/flutter_project
}
function ios_publish(){
......@@ -260,12 +267,12 @@ mkdir /Users/apple/lsy/aar_update/androd${message}/
mkdir /Users/apple/lsy/aar_update/ios${message}/
clean
android_apk
#android_apk
#android
#android_publish
#copyAAR
#upload_android_aar
#ios
ios
#ios_publish
#notifyDingDing
......
This diff is collapsed.
......@@ -10,6 +10,7 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gmalpha_flutter/AlbumModel/bean/DirBean.dart';
import 'package:gmalpha_flutter/AlbumModel/page/preview/AlbumPreviewPage.dart';
import 'package:gmalpha_flutter/AlbumModel/util/AlbumUtil.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/commonModel/base/BaseComponent.dart';
import 'package:gmalpha_flutter/commonModel/base/BasePage.dart';
......@@ -32,8 +33,17 @@ class AlbumPage extends StatefulWidget {
String fromPage,
String iosPushedPage,
String noVideoHint) {
model = new AlbumModel(provider, showCamera, maxCount, selectedList,
fromNative, maxVideo, videoSelectPath, fromPage, iosPushedPage,noVideoHint);
model = new AlbumModel(
provider,
showCamera,
maxCount,
selectedList,
fromNative,
maxVideo,
videoSelectPath,
fromPage,
iosPushedPage,
noVideoHint);
}
@override
......@@ -43,6 +53,7 @@ class AlbumPage extends StatefulWidget {
class AlbumState extends BasePage<AlbumPage>
with SingleTickerProviderStateMixin {
final AlbumModel _model;
ScrollController scrollController = new ScrollController();
AlbumState(this._model);
......@@ -177,6 +188,7 @@ class AlbumState extends BasePage<AlbumPage>
@override
void dispose() {
scrollController.dispose();
_model.dispose();
controller.dispose();
super.dispose();
......@@ -197,6 +209,7 @@ class AlbumState extends BasePage<AlbumPage>
);
}
return GridView.builder(
controller: scrollController,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
crossAxisSpacing: 1,
......@@ -224,7 +237,7 @@ class AlbumState extends BasePage<AlbumPage>
}
String during;
if (_model.isVideo(newIndex)) {
during = _model.getFormatTime(imgList.data[newIndex].during);
during = AlbumUtil.getFormatTime(imgList.data[newIndex].during);
}
return GestureDetector(
onTap: () {
......
......@@ -7,17 +7,29 @@ import 'dart:typed_data';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart';
import 'package:gmalpha_flutter/AlbumModel/repository/AlbumRepository.dart';
import 'package:gmalpha_flutter/commonModel/GMBase.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
class AlbumPreviewModel extends BaseModel {
AlbumRepository repo = AlbumRepository.getInstance();
var imageLive = LiveData<String>();
var pageList = LiveData<List<ScanImageItem>>();
var titleLive = LiveData<String>();
var selectLive = LiveData<bool>();
var nextLive = LiveData<int>();
final String imgPath;
int size;
int _maxCount;
int maxVideoCount;
String noVideoHint;
AlbumPreviewModel(this.imgPath, this.size);
AlbumPreviewModel(this.imgPath, this.size, this._maxCount, this.maxVideoCount,
this.noVideoHint);
getPreviewImage(BuildContext context) {
print("IMAGE SIZE ===> $size");
......@@ -33,6 +45,7 @@ class AlbumPreviewModel extends BaseModel {
// }
}
//
// Future<Codec> _loadAsync(ResizeFileImage key) async {
// assert(key == this);
// final Uint8List bytes = await file.readAsBytes();
......@@ -52,8 +65,129 @@ class AlbumPreviewModel extends BaseModel {
// });
// }
void getItem(String path, BuildContext context) {
List<String> temp = [path];
}
@override
void dispose() {
nextLive.dispost();
selectLive.dispost();
pageList.dispost();
imageLive.dispost();
titleLive.dispost();
}
void getRealPath(BuildContext context, int index) {
if(Platform.isAndroid){
pageList.notifyView(fromPage);
return;
}
GengmeiFlutterPlugin.ios_album_path([fromPage[index].path]).then((value) {
print("HEEEEEEE ");
var map = Map<String, String>.from(value[0]);
print(map);
fromPage[index].realPath = map["realImagePath"];
pageList.notifyView(fromPage);
}).catchError((error) {
Toast.show(context, error.toString());
print(error);
});
}
List<ScanImageItem> fromPage;
void setList(List<ScanImageItem> fromPage) {
this.fromPage = fromPage;
}
void init(BuildContext context) {
nextLive.notifyView(
repo.getSelectVideo().length + repo.getSelectPhoto().length);
}
void clickItem(BuildContext context) {
if (maxVideoCount == 0 && fromPage[currentIndex].isVideo) {
if (noVideoHint != null) {
Toast.show(context, noVideoHint);
}
return;
}
String path;
if (Platform.isAndroid) {
path = fromPage[currentIndex].realPath;
} else {
path = fromPage[currentIndex].path;
}
if (maxVideoCount > 0 && fromPage[currentIndex].isVideo) {
if (!repo.getSelectVideo().contains(path)) {
if (repo.getSelectVideo().length >= maxVideoCount) {
Toast.show(context, "最多选择${maxVideoCount}个视频");
return;
}
repo.addVideo(path);
selectLive.notifyView(true);
} else {
repo.removeVideo(path);
selectLive.notifyView(false);
}
} else {
if (!repo.getSelectPhoto().contains(path)) {
if (repo.getSelectPhoto().length >= _maxCount) {
Toast.show(context, "最多选择${_maxCount}张图片");
return;
}
repo.addPhoto(path);
selectLive.notifyView(true);
} else {
repo.removePhoto(path);
selectLive.notifyView(false);
}
}
nextLive.notifyView(
repo.getSelectPhoto().length + repo.getSelectVideo().length);
}
int currentIndex;
void pageIndex(int index) {
currentIndex = index;
bool haveIt = false;
repo.getSelectPhoto().forEach((value) {
if (Platform.isAndroid) {
if (value == fromPage[index].realPath) {
haveIt = true;
}
} else {
if (value == fromPage[index].path) {
haveIt = true;
}
}
});
repo.getSelectVideo().forEach((value) {
if (Platform.isAndroid) {
if (value == fromPage[index].realPath) {
haveIt = true;
}
} else {
if (value == fromPage[index].path) {
haveIt = true;
}
}
});
selectLive.notifyView(haveIt);
titleLive.notifyView("${currentIndex+1} / ${fromPage.length}");
}
void playVideo() {
if (fromPage[currentIndex].isVideo) {
String path = Platform.isAndroid
? fromPage[currentIndex].realPath
: fromPage[currentIndex].path;
GengmeiFlutterPlugin.playAlbumVideo(path);
}
}
void onNext() {
}
}
......@@ -7,6 +7,9 @@ import 'package:gengmei_flutter_plugin/ScanImagePlugn.dart';
import 'package:gengmei_flutter_plugin/gengmei_flutter_plugin.dart';
import 'package:rxdart/rxdart.dart';
const String MainDir = "IsGengmeiAlbumAllImages";
const String MainDirExplain = "全部相片";
class AlbumRepository {
AlbumRepository._();
......@@ -19,30 +22,38 @@ class AlbumRepository {
return _instance;
}
Map<String, List<ScanImageItem>> _cacheList = new Map();
Map<String, List<ScanImageItem>> _mainValue = Map();
List<String> _selectList = List();
List<String> _selectVideoList = List();
Observable<Map<String, List<ScanImageItem>>> scanPhoneImg() {
return Observable.fromFuture(GengmeiFlutterPlugin.phoneImages())
.map((value) {
// Map<String, List<ScanImageItem>> finalList = new Map();
// var all = value["IsGengmeiAlbumAllImages"];
// if (all != null) {
// value.forEach((k, v) {
// List<ScanImageItem> newList = List();
// v.forEach((value) {
//
// });
// });
// }
//
// if (value != null) {}
return Observable.fromFuture(GengmeiFlutterPlugin.phoneImages());
}
void updataMainValue(Map<String, List<ScanImageItem>> value) {
_mainValue = value;
}
Map<String, List<ScanImageItem>> getMainValue() {
return _mainValue;
}
return value;
});
void updateSelectPhoto(List<String> value) {
_selectList.clear();
_selectList.addAll(value);
}
void clearMemory() {
_cacheList.clear();
void updateSelectVideo(List<String> value) {
_selectVideoList.clear();
_selectVideoList.addAll(value);
}
List<String> getSelectPhoto() {
return _selectList;
}
List<String> getSelectVideo() {
return _selectVideoList;
}
Observable<Map> nativeCamera(String provider) {
......@@ -52,4 +63,39 @@ class AlbumRepository {
Observable<String> aiCamera() {
// return Observable.fromFuture(GengmeiFlutterPlugin.aiCamera());
}
void addItem(ScanImageItem item, String foldName) {
if (_mainValue != null) {
var list = _mainValue[foldName];
if (list == null) {
_mainValue[foldName] = new List();
_mainValue[foldName].add(item);
} else {
list.insert(0, item);
}
_mainValue[MainDir].insert(0, item);
}
}
void addVideo(String path) {
_selectVideoList.add(path);
}
void removeVideo(String path) {
_selectVideoList.remove(path);
}
void addPhoto(String path) {
_selectList.add(path);
}
void removePhoto(String path) {
_selectList.remove(path);
}
void clear() {
_selectList.clear();
_selectVideoList.clear();
_mainValue.clear();
}
}
/*
* @author lsy
* @date 2019-11-12
**/
class AlbumUtil{
static String getFormatTime(String during) {
if (during == null) {
return "";
} else {
try {
var parse = int.parse(during);
String min;
int minn;
if (parse > 60 * 1000) {
min = "00";
minn = 0;
} else {
minn = (parse / (60 * 1000)).floor();
min = "${minn}";
}
String second = "${((parse - minn * (60 * 1000)) / 1000).floor()}";
if (min.length == 1) {
min = "0$min";
}
if (second.length == 1) {
second = "0$second";
}
if (min.length > 2) {
min = "99";
}
return "$min:$second";
} catch (e) {
print(e);
return "";
}
}
}
}
\ No newline at end of file
......@@ -85,8 +85,8 @@ class TestPage extends StatelessWidget {
Navigator.push(
context,
new CustomRoute(RouterCenterImpl().findAlbumRouter()?.getAlbumPage(
"com.example.gmalpha_flutter", true, 1, null, false, "test",
maxVideoCount: 0)));
"com.example.gmalpha_flutter", true, 9, null, false, "test",
maxVideoCount: 0,noVideoHint: "测试测试测试")));
}, "相册页面");
}
......
......@@ -116,9 +116,9 @@ class UserSettingModel extends BaseModel {
if (value != null) {
print("$value");
selectImgPath = value[0];
File txt=File(selectImgPath);
var dir_bool=txt.exists().then((value){
print("RESULT!!!!!$selectImgPath bool ${value}" );
File txt = File(selectImgPath);
var dir_bool = txt.exists().then((value) {
print("RESULT!!!!!$selectImgPath bool ${value}");
});
headImgLive.notifyView(selectImgPath);
......@@ -213,7 +213,7 @@ class UserSettingModel extends BaseModel {
UserEntityImpl().savecountryInfoId(countryId);
UserEntityImpl().savecountryInfoName(cityLive.data);
Timer(Duration(milliseconds: 100), () {
FlutterBoost.singleton.closePageForContext(context);
Navigator.pop(context);
// Navigator.pop(context);
});
// FlutterBoost.singleton.closePageForContext(context);
......
......@@ -125,7 +125,6 @@ class _MyAppState extends State<MyApp> {
?.getFindPage(params["fromPage"]);
},
});
FlutterBoost.handleOnStartPage();
}
@override
......
......@@ -27,7 +27,11 @@ dependencies:
dio: ^2.2.2
rxdart: ^0.22.0 #链式编程
pull_to_refresh: ^1.5.0
flutter_boost: ^0.0.420
flutter_boost: ^0.1.60
# flutter_boost:
# git:
# url: 'https://github.com/alibaba/flutter_boost.git'
# ref: '0.1.60'
event_bus: ^1.1.0
# gengmei_flutter_plugin: ^0.0.731
# flutter_boost:
......@@ -39,14 +43,16 @@ dependencies:
gengmei_flutter_plugin:
git:
url: 'git@git.wanmeizhensuo.com:linshengyu/flutter_plugin.git'
ref: "85f3ca475ec55464ff29e68dfaf444add58a0b64"
ref: 'c4e2b08443761ea46bdef6dc8d2b93d13c2689f4'
# gengmei_flutter_plugin:
# path: /Users/apple/lsy/gengmei_flutter_plugin
flutter_drag_scale:
git: 'https://github.com/LiuC520/flutter_drag_scale.git'
protobuf: ^0.14.4
grpc: ^2.1.2
flutter_svg: ^0.14.1
flutter_drag_scale:
git:
url: 'https://github.com/LiuC520/flutter_drag_scale.git'
# ref: '33d4dfa904728e277f67d029767b833330655333'
dev_dependencies:
source_gen: '>=0.8.0'
......
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