「Update」
1、增加动态皮肤加载SDK开发
This commit is contained in:
@@ -65,6 +65,7 @@ dependencies {
|
||||
implementation "com.mogo.cloud:realtime:${MOGO_REALTIME_VERSION}"
|
||||
implementation "com.mogo.cloud:trafficlive:${MOGO_TRAFFICLIVE_VERSION}"
|
||||
implementation "com.mogo.cloud:telematic:${MOGO_TELEMATIC_VERSION}"
|
||||
implementation "com.mogo.cloud:skin:${MOGO_SKIN_VERSION}"
|
||||
implementation "com.mogo.v2x:v2x:${MOGO_V2X_VERSION}"
|
||||
} else {
|
||||
implementation project(":foudations:mogo-location")
|
||||
@@ -72,6 +73,7 @@ dependencies {
|
||||
implementation project(":modules:mogo-realtime")
|
||||
implementation project(":modules:mogo-trafficlive")
|
||||
implementation project(":libraries:mogo-telematic")
|
||||
implementation project(":libraries:mogo-skin")
|
||||
implementation project(":foudations:mogo-v2x")
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
@@ -18,6 +19,9 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficCarLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.ITrafficIntersectionLiveCallBack;
|
||||
import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive;
|
||||
import com.mogo.skin.Skin;
|
||||
import com.mogo.skin.SkinManager;
|
||||
import com.mogo.skin.utils.SkinPreference;
|
||||
import com.mogo.v2x.V2XManager;
|
||||
import com.mogo.v2x.callback.IV2XCallback;
|
||||
import com.mogo.v2x.config.V2XConfig;
|
||||
@@ -32,6 +36,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
private Button btnJumpPassPort;
|
||||
private Button btnJumpConfigInfo;
|
||||
private Button btnJumpNetWorkPort;
|
||||
private ToggleButton btnChangeSkin;
|
||||
private Button btnJumpRealTime;
|
||||
private Button btnJumpLocation;
|
||||
private Button btnJumpRoadCondition;
|
||||
@@ -74,6 +79,25 @@ public class MainActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
btnChangeSkin = findViewById(R.id.btnChangeSkin);
|
||||
btnChangeSkin.setChecked(SkinPreference.getInstance().getSkin() != "");
|
||||
btnChangeSkin.setOnCheckedChangeListener((view, isCheck) -> {
|
||||
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");
|
||||
|
||||
//换肤
|
||||
SkinManager.getInstance().selectSkin(this, skin);
|
||||
|
||||
} else {
|
||||
SkinManager.getInstance().loadSkin("");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
btnJumpLocation = findViewById(R.id.btnJumpLocation);
|
||||
btnJumpLocation.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(MainActivity.this, LocationActivity.class);
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.cloud.passport.location.ICurrentLocation;
|
||||
import com.mogo.cloud.passport.location.SimpleLocation;
|
||||
import com.mogo.skin.SkinManager;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -24,6 +25,8 @@ public class MoGoApplication extends MultiDexApplication {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
SkinManager.init(this);
|
||||
|
||||
// Crash 日志收集
|
||||
CrashSystem crashSystem = CrashSystem.getInstance(this);
|
||||
crashSystem.init();
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/icon_notice_default.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_notice_default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
app/src/main/res/drawable-hdpi/text_drawable_left.png
Normal file
BIN
app/src/main/res/drawable-hdpi/text_drawable_left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -10,6 +10,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mogo.skin.widget.SkinImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_notice_default"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAppKey"
|
||||
android:layout_width="match_parent"
|
||||
@@ -60,6 +66,13 @@
|
||||
android:layout_height="match_parent"
|
||||
android:text="实时数据测试" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/btnChangeSkin"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textOff="切换皮肤"
|
||||
android:textOn="还原皮肤" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnJumpLocation"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user