diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 3e43e26..131eab7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -29,6 +29,7 @@ def releaseTime() { } apply plugin: 'com.android.application' +apply plugin: 'com.mob.sdk' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" @@ -91,50 +92,50 @@ android { // // // 签名配置 -// signingConfigs { -// // 智夜生活 -// zhiying { -// storeFile file('zhiying.jks') -// storePassword 'zhioscom' -// keyAlias 'zysh' -// keyPassword 'zhioscom' -// v1SigningEnabled true -// v2SigningEnabled true -// } -// -// } -// -// flavorDimensions "app" -// -// -// // 应用信息配置 -// productFlavors { -// // 智夜生活 -// zhiying { -// applicationId "cn.zhios.zhiying" -// versionCode 1 -// dimension "app" -// versionName '1.0.0' -// // 签名信息 -// signingConfig signingConfigs.zhiying -// } -// } -// -// // 打包脚本 -// android.applicationVariants.all { variant -> -// if (variant.buildType.name != "debug") { -// variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") -// } -// -// variant.outputs.all { output -> -// def outputFile = output.outputFile -// if (outputFile != null && outputFile.name.endsWith('.apk')) { -// //这里修改apk文件名 -// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" -// outputFileName = fileName -// } -// } -// } + signingConfigs { + // 智夜生活 + zhiying { + storeFile file('zhiying.jks') + storePassword 'zhioscom' + keyAlias 'zysh' + keyPassword 'zhioscom' + v1SigningEnabled true + v2SigningEnabled true + } + + } + + flavorDimensions "app" + + + // 应用信息配置 + productFlavors { + // 智夜生活 + zhiying { + applicationId "cn.zhios.zhiying" + versionCode 1 + dimension "app" + versionName '1.0.0' + // 签名信息 + signingConfig signingConfigs.zhiying + } + } + + // 打包脚本 + android.applicationVariants.all { variant -> + if (variant.buildType.name != "debug") { + variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk") + } + + variant.outputs.all { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.apk')) { + //这里修改apk文件名 + def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk" + outputFileName = fileName + } + } + } configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> @@ -162,6 +163,25 @@ dependencies { } +MobSDK { + appKey "30dc33054b635" + appSecret "396e98c293130c9976fb7428b6b434d6" + + ShareSDK { + + // platform configuration information + devInfo { + QQ { + appId "1111030588" + appKey "XoHKlrBybXy7ORBt" + shareByAppClient true + bypassApproval false + enable true + } + } + } +} + // 注册SecVerify的相关信息 //MobSDK { //// appKey "2ed488d929488" diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 46ba8c4..f488c56 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -8,10 +8,10 @@ FlutterApplication and put your custom class here. --> + tools:replace="android:name"> + + + + diff --git a/example/android/app/src/main/res/values/strings.xml b/example/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..a70b49a --- /dev/null +++ b/example/android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + 智莺生活 + diff --git a/lib/widgets/search/history_tag/search_history_tag.dart b/lib/widgets/search/history_tag/search_history_tag.dart index 07b8173..270c1ab 100644 --- a/lib/widgets/search/history_tag/search_history_tag.dart +++ b/lib/widgets/search/history_tag/search_history_tag.dart @@ -40,7 +40,7 @@ class _SearchHistoryTagWidgetState extends State { /// 点击历史标签 void _historyTagClick(String tag) { if (!EmptyUtil.isEmpty(tag)) { - Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': tag ?? ''}))); + Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': tag ?? '', 'tag': 'search_page'}))); } } diff --git a/lib/widgets/search/hot_tag/search_hot_tag_widget.dart b/lib/widgets/search/hot_tag/search_hot_tag_widget.dart index c2cbac0..df92a9c 100644 --- a/lib/widgets/search/hot_tag/search_hot_tag_widget.dart +++ b/lib/widgets/search/hot_tag/search_hot_tag_widget.dart @@ -31,7 +31,7 @@ class SearchHotTagWidget extends StatelessWidget { await Provider.of(context, listen: false).addTag(model.keyword); - Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': model?.keyword ?? ''}))); + Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': model?.keyword ?? '', 'tag': 'search_page'}))); } } diff --git a/lib/widgets/search/input/search_input_widget.dart b/lib/widgets/search/input/search_input_widget.dart index 8cdcb0e..165dbc7 100644 --- a/lib/widgets/search/input/search_input_widget.dart +++ b/lib/widgets/search/input/search_input_widget.dart @@ -40,7 +40,7 @@ class _SearchInputWidgetState extends State { /// TODO 保存历史标签 if (!EmptyUtil.isEmpty(content)) { await Provider.of(context, listen: false).addTag(content); - Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': content}))); + Navigator.push(context, MaterialPageRoute(builder: (_) => SearchResultPage({'keywords': content, 'tag': 'search_page'}))); }else{ Fluttertoast.showToast(msg: '输入内容不能为空!'); } @@ -190,6 +190,7 @@ class _SearchInputWidgetState extends State { style: TextStyle(fontSize: 14, color: HexColor.fromHex('#333333')), decoration: InputDecoration( filled: false, + contentPadding: const EdgeInsets.only(left: 0, right: 0, bottom: 12, top: 0), // focusColor: Colors.transparent, // fillColor: Colors.transparent, border: InputBorder.none, diff --git a/lib/widgets/search/tabbar/search_tab_widget.dart b/lib/widgets/search/tabbar/search_tab_widget.dart index bb0affb..6b7a764 100644 --- a/lib/widgets/search/tabbar/search_tab_widget.dart +++ b/lib/widgets/search/tabbar/search_tab_widget.dart @@ -37,7 +37,7 @@ class _SearchTabWidgetState extends State { /// 联想列表的item点击事件 _onThinkItemClick(SearchThinkModel model){ Navigator.push(context, MaterialPageRoute( - builder: (_)=> SearchResultPage(model.toJson()) + builder: (_)=> SearchResultPage(model.toJson()..['tag'] = 'search_page') )); } diff --git a/lib/widgets/search_result/search_input/search_result_input.dart b/lib/widgets/search_result/search_input/search_result_input.dart index cc4d22c..0dd0a60 100644 --- a/lib/widgets/search_result/search_input/search_result_input.dart +++ b/lib/widgets/search_result/search_input/search_result_input.dart @@ -153,6 +153,7 @@ class _SearchResultInputWidgetState extends State { style: TextStyle(fontSize: 14, color: HexColor.fromHex('#333333')), decoration: InputDecoration( filled: false, + contentPadding: const EdgeInsets.only(left: 0, right: 0, top: 0, bottom: 12), // focusColor: Colors.transparent, // fillColor: Colors.transparent, border: InputBorder.none,