「Update」
1、修复TextView 没有写内容的时候导致的崩溃异常
This commit is contained in:
@@ -32,14 +32,22 @@
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:supportsRtl="true">
|
||||
<activity
|
||||
android:name=".NSDNettyActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:launchMode="singleTask">
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTask"
|
||||
android:resizeableActivity="false"
|
||||
android:screenOrientation="landscape"
|
||||
android:resumeWhilePausing="true"
|
||||
android:stateNotNeeded="true"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||
android:theme="@style/AppTheme">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@@ -85,9 +85,11 @@ public class MainActivity extends AppCompatActivity {
|
||||
Skin skin;
|
||||
if (isCheck) {
|
||||
skin = new Skin(
|
||||
"d5493244467d3970834e42dc1a6f07c9",
|
||||
"app-skin-debug.skin",
|
||||
"https://carlife-static-1255510688.cos.ap-beijing.myqcloud.com/MoGoEagleEye/app-skin-debug.skin");
|
||||
"6992d2f7862d9255f7a02e0917302f4e",
|
||||
"YiXin-skin.skin",
|
||||
"https://carlife-static-1255510688.cos.ap-beijing.myqcloud.com/MoGoEagleEye/YiXin-skin.skin"
|
||||
|
||||
);
|
||||
|
||||
//换肤
|
||||
SkinManager.getInstance().selectSkin(this, skin);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/drawable-xhdpi/mogo_slogan.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/mogo_slogan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
23
app/src/main/res/drawable/main_bitmap_splash_bg.xml
Normal file
23
app/src/main/res/drawable/main_bitmap_splash_bg.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--黑色矩形 作为背景色-->
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:centerX="0.6"
|
||||
android:endColor="#0B0F17"
|
||||
android:startColor="#171D2B"
|
||||
android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
<!--单独的slogan图片 并且设置下间距-->
|
||||
<!--如果使用svg可以直接 drawable-->
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mogo_slogan"
|
||||
android:tileMode="disabled" />
|
||||
</item>
|
||||
</layer-list>
|
||||
12
app/src/main/res/drawable/main_bitmap_splash_icon.xml
Normal file
12
app/src/main/res/drawable/main_bitmap_splash_icon.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--单独的slogan图片 并且设置下间距-->
|
||||
<!--如果使用svg可以直接 drawable-->
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/mogo_slogan"
|
||||
android:tileMode="disabled" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -13,8 +13,14 @@
|
||||
<com.mogo.skin.widget.SkinImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_notice_default"
|
||||
/>
|
||||
android:src="@drawable/icon_notice_default" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAppKey"
|
||||
@@ -22,6 +28,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="AppKey:"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
@@ -30,6 +37,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="DevicesId:"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
@@ -38,6 +46,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="SN:"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textSize="20dp" />
|
||||
|
||||
<TextView
|
||||
@@ -45,6 +54,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:text="Token:"
|
||||
android:textSize="20dp" />
|
||||
|
||||
|
||||
13
app/src/main/res/layout/splash_screen.xml
Normal file
13
app/src/main/res/layout/splash_screen.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<!-- res/layout/splash_screen.xml -->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#0B0F17">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/mogo_slogan"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -2,7 +2,7 @@
|
||||
<resources>
|
||||
<color name="colorPrimary">#6200EE</color>
|
||||
<color name="colorPrimaryDark">#3700B3</color>
|
||||
<color name="colorAccent">#03DAC5</color>
|
||||
<color name="colorAccent">#FFFFFF</color>
|
||||
<color name="colorStartLive">#4CAF50</color>
|
||||
<color name="colorStopLive">#F44336</color>
|
||||
<color name="colorForcedStopLive">#9C27B0</color>
|
||||
|
||||
@@ -1,11 +1,37 @@
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="android:windowOverscan">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">@android:color/transparent
|
||||
</item>
|
||||
|
||||
<item name="android:windowEnterAnimation">@null</item>
|
||||
<item name="android:windowExitAnimation">@null</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@drawable/main_bitmap_splash_bg</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:windowAnimationStyle">@style/MainAnimation</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="MainAnimation">
|
||||
<item name="android:activityOpenEnterAnimation">@null</item>
|
||||
<item name="android:activityOpenExitAnimation">@null</item>
|
||||
<item name="android:activityCloseEnterAnimation">@null</item>
|
||||
<item name="android:activityCloseExitAnimation">@null</item>
|
||||
<item name="android:taskOpenEnterAnimation">@null</item>
|
||||
<item name="android:taskOpenExitAnimation">@null</item>
|
||||
<item name="android:taskCloseEnterAnimation">@null</item>
|
||||
<item name="android:taskCloseExitAnimation">@null</item>
|
||||
<item name="android:taskToFrontEnterAnimation">@null</item>
|
||||
<item name="android:taskToFrontExitAnimation">@null</item>
|
||||
<item name="android:taskToBackEnterAnimation">@null</item>
|
||||
<item name="android:taskToBackExitAnimation">@null</item>
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -58,4 +58,4 @@ MOGO_TELEMATIC_VERSION=1.4.7.42
|
||||
# v2x
|
||||
MOGO_V2X_VERSION=1.4.7.42
|
||||
# SKIN
|
||||
MOGO_SKIN_VERSION=1.4.7.42
|
||||
MOGO_SKIN_VERSION=1.4.7.44
|
||||
|
||||
@@ -79,7 +79,7 @@ public class SkinAttribute {
|
||||
if (isNumeric(attributeValue.substring(1))) {
|
||||
resId = Integer.parseInt(attributeValue.substring(1));
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
} catch (Exception e) {
|
||||
// 由于有时候TextView会直接配置文字,而不是用 @string/XXX 所以会导致这里转换异常,车里简单的处理异常跳过即可
|
||||
//e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import android.content.res.AssetManager;
|
||||
import android.content.res.Resources;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.mogo.skin.net.DownloadManager;
|
||||
import com.mogo.skin.utils.FileUtils;
|
||||
@@ -34,6 +35,7 @@ public class SkinManager extends Observable {
|
||||
public static void init(Application application) {
|
||||
synchronized (SkinManager.class) {
|
||||
if (null == instance) {
|
||||
Log.d(TAG, "SkinManager init …………");
|
||||
mApplication = application;
|
||||
instance = new SkinManager(application);
|
||||
}
|
||||
@@ -51,6 +53,8 @@ public class SkinManager extends Observable {
|
||||
//注册Activity生命周期回调
|
||||
skinActivityLifecycle = new SkinActivityLifecycle();
|
||||
application.registerActivityLifecycleCallbacks(skinActivityLifecycle);
|
||||
|
||||
// 加载皮肤,如果为空则为APP内默认皮肤
|
||||
loadSkin(SkinPreference.getInstance().getSkin());
|
||||
}
|
||||
|
||||
@@ -141,10 +145,10 @@ public class SkinManager extends Observable {
|
||||
//皮肤包的md5校验 防止下载文件损坏(但是会减慢速度。从数据库查询已下载皮肤表数据库中保留md5字段)
|
||||
if (TextUtils.equals(SkinUtils.getSkinMD5(skinFile), skin.md5)) {
|
||||
Log.d("SkinActivity", "校验成功,修改文件名。");
|
||||
|
||||
} else {
|
||||
Log.e("SkinActivity", "校验出错,本地文件MD5 与云端文件MD5 不一致。");
|
||||
|
||||
Log.e("SkinActivity", "皮肤文件校验出错,本地文件MD5 与云端文件MD5 不一致。");
|
||||
Toast.makeText(mApplication, "皮肤文件校验出错,本地文件MD5 与云端文件MD5 不一致。", Toast.LENGTH_SHORT).show();
|
||||
// TODO 删除本地皮肤文件,并重新下载(这个操作比较危险,需要严格保证配置文件中的md5与实际皮肤包一致,否则将是灾难)
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user