diff --git a/assets/images/empty/3.0x/empty.png b/assets/images/empty/3.0x/empty.png old mode 100755 new mode 100644 diff --git a/assets/images/qrcode/default_qrcode.png b/assets/images/qrcode/default_qrcode.png old mode 100755 new mode 100644 diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index b2d34e9..2acdd0b 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -112,9 +112,9 @@ android { // 智夜生活 zhiying { applicationId "cn.zhios.zhiying" - versionCode 24 + versionCode 25 dimension "app" - versionName '1.2.4' + versionName '1.2.5' // 签名信息 signingConfig signingConfigs.zhiying } diff --git a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java index 346d43f..472c5f3 100644 --- a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java +++ b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java @@ -7,8 +7,12 @@ import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; +import android.util.Log; +import android.view.Gravity; import android.view.Window; import android.view.WindowManager; +import android.widget.FrameLayout; +import android.widget.ImageView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -30,15 +34,58 @@ import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommNativable { + FrameLayout view; + + FrameLayout launchImageFrame; + @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); configureWindowForTransparency(); configureStatusBarForFullscreenFlutterExperience(); - MobLink.setRestoreSceneListener(new MoblinkPlugin.SceneListener()); + addLaunchView(); + + } + + + ///添加启动页 + void addLaunchView() { + view = (FrameLayout) this.getWindow().getDecorView(); + + launchImageFrame = new FrameLayout(this); + + FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT); + + params.gravity = Gravity.CENTER; + + launchImageFrame.setLayoutParams(params); + + ImageView launchImageView = new ImageView(this); + + FrameLayout.LayoutParams b_p = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT); + + b_p.gravity = Gravity.CENTER_HORIZONTAL; + launchImageView.setScaleType(ImageView.ScaleType.FIT_XY); + launchImageView.setLayoutParams(b_p); + launchImageView.setImageResource(R.mipmap.start); + + launchImageFrame.addView(launchImageView, b_p); + + view.addView(launchImageFrame, params); + } + + ///移除启动页 + void removeLaunchView() { + + if(view!=null&&launchImageFrame!=null){ + Log.d("----------------","----------------------清除启动页---------------"); + view.removeView(launchImageFrame); + } + launchImageFrame=null; + view=null; } @Override @@ -92,7 +139,7 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN Map map = new HashMap(); map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989"); // map.put("domain", "http://192.168.0.113:5000"); - map.put("master_id", "123456"); + map.put("master_id", "ios_review"); map.put("secret_key", "123456"); // map.put("token", "123465"); return map; @@ -103,16 +150,23 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN return; } + @Override + public void initSuccess() { + Log.d("----------------","----------------------清除启动页---------------"); + removeLaunchView(); + } + @Override protected void onDestroy() { super.onDestroy(); ZhiyingFlutterCommNative.getInstance().unregist(); } + @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); - if (newConfig.fontScale != 1){ + if (newConfig.fontScale != 1) { getResources(); }//非默认值 } diff --git a/example/android/app/src/main/res/values/strings.xml b/example/android/app/src/main/res/values/strings.xml index ceb8c9d..a70b49a 100644 --- a/example/android/app/src/main/res/values/strings.xml +++ b/example/android/app/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ - 智莺生活_内测版 + 智莺生活 diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml index c99df43..8ad286f 100644 --- a/example/android/app/src/main/res/values/styles.xml +++ b/example/android/app/src/main/res/values/styles.xml @@ -7,16 +7,11 @@ @mipmap/start - true - true + false @android:color/transparent @android:color/transparent - false true - true - portrait - stateHidden - orientation|keyboardHidden|screenSize + @@ -32,13 +27,7 @@ true true @android:color/transparent - @android:color/transparent - false - true - true - portrait - stateHidden - orientation|keyboardHidden|screenSize + diff --git a/example/assets/fonts/PingFang.otf b/example/assets/fonts/PingFang.otf new file mode 100644 index 0000000..842cafb Binary files /dev/null and b/example/assets/fonts/PingFang.otf differ diff --git a/example/lib/main.dart b/example/lib/main.dart index 153c9d4..f49cc08 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -71,10 +71,14 @@ class _MyAppState extends State { ], child: MaterialApp( builder: (context,child){ - MediaQuery.of(context).copyWith(textScaleFactor: 1); - return child; + return MediaQuery( + //设置文字大小不随系统设置改变 + data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0), + child: child, + ); }, theme: ThemeData( + fontFamily: 'PingFang', primaryColor: HexColor.fromHex('#FF4242'), accentColor: HexColor.fromHex('#FF4242'), ), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index f039220..4773dcc 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -52,17 +52,9 @@ flutter: # "family" key with the font family name, and a "fonts" key with a # list giving the asset and other descriptors for the font. For # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # + fonts: + - family: PingFang + fonts: + - asset: assets/fonts/PingFang.otf # For details regarding fonts from package dependencies, # see https://flutter.dev/custom-fonts/#from-packages diff --git a/lib/pages/launch_page/launch_page.dart b/lib/pages/launch_page/launch_page.dart index d1133aa..d74c5fd 100644 --- a/lib/pages/launch_page/launch_page.dart +++ b/lib/pages/launch_page/launch_page.dart @@ -55,7 +55,10 @@ class _LaunchPageState extends State with TickerProviderStateMixin { Logger.debug('ConnectivityResult.wifi'); print('ConnectivityResult.wifi'); Application.init().then((_) async { - NativeUtil.notifyInitSuccess(); + + Timer(Duration(milliseconds: 300), (){ + NativeUtil.notifyInitSuccess(); + }); PackageInfo packageInfo = await PackageInfo.fromPlatform(); String versionNumber = await SharedPreferencesUtil.getStringValue(Constants.versionNumber); @@ -134,11 +137,11 @@ class _LaunchPageState extends State with TickerProviderStateMixin { Widget build(BuildContext context) { return Container( color: Colors.white, - child: Image.asset( - 'assets/images/launch_image/launch_image.png', - package: 'zhiying_base_widget', - fit: BoxFit.fill, - ), + // child: Image.asset( + // 'assets/images/launch_image/launch_image.png', + // package: 'zhiying_base_widget', + // fit: BoxFit.fill, + // ), ); } }