[Update]
增加了系统状态栏透明功能 TODO UI需要部分适配下 Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
android:resizeableActivity="false"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
android:theme="@style/Main"
|
||||
tools:replace="android:label">
|
||||
|
||||
<!-- 配置APP ID -->
|
||||
|
||||
@@ -5,5 +5,4 @@
|
||||
<color name="colorAccent">#D81B60</color>
|
||||
|
||||
|
||||
<color name="app_window_background">#1C1C1C</color>
|
||||
</resources>
|
||||
|
||||
@@ -8,31 +8,5 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.App" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:statusBarColor" tools:ignore="NewApi">@null</item>
|
||||
<item name="android:windowEnterAnimation">@null</item>
|
||||
<item name="android:windowExitAnimation">@null</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowBackground">@color/app_window_background</item>
|
||||
<item name="android:windowTranslucentNavigation">false</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowAnimationStyle">@style/Animation</item>
|
||||
</style>
|
||||
|
||||
<style name="Animation">
|
||||
<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>
|
||||
|
||||
@@ -12,8 +12,8 @@ ext {
|
||||
commonIndependentAmapApiValue : "1c3fbc5f5e183619ffb1e7bc01e6751f",
|
||||
compileSdkVersion : 29,
|
||||
buildToolsVersion : "29.0.2",
|
||||
minSdkVersion : 19,
|
||||
targetSdkVersion : 19,
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 21,
|
||||
minSdkVersionPadLenovo : 23,
|
||||
targetSdkVersionPadLenovo : 23,
|
||||
]
|
||||
|
||||
@@ -61,7 +61,7 @@ internal class BadCaseView: ConstraintLayout {
|
||||
close?.onClick {
|
||||
onDismiss?.invoke()
|
||||
}
|
||||
fitsSystemWindows = true
|
||||
//fitsSystemWindows = true
|
||||
cancel?.also {
|
||||
it.background = shape(solid = Color.parseColor("#3B4577"), radius = 16)
|
||||
it.onClick {
|
||||
|
||||
@@ -246,7 +246,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT, offsetY = 72)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(WindowManager.LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
@@ -765,7 +765,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 280)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
android:resumeWhilePausing="true"
|
||||
android:screenOrientation="landscape"
|
||||
android:stateNotNeeded="true"
|
||||
android:theme="@style/Main"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/main_splash_bg"
|
||||
android:clipChildren="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 地图 -->
|
||||
@@ -15,100 +13,104 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_special_effect"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
android:fitsSystemWindows="true"
|
||||
android:paddingTop="25dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wu1"
|
||||
android:layout_width="wrap_content"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_special_effect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:src="@drawable/wu1"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wu2"
|
||||
android:layout_width="wrap_content"
|
||||
<ImageView
|
||||
android:id="@+id/iv_wu1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:src="@drawable/wu1"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_wu2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:src="@drawable/wu2"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!--预警视图 OBU、云端下发、自车感知、自车策略-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_waring_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 快捷操作浮层 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_entrance_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0"
|
||||
android:src="@drawable/wu2"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
|
||||
android:paddingLeft="@dimen/module_main_apps_fragment_container_padding"
|
||||
android:paddingTop="@dimen/module_main_apps_fragment_container_paddingTop"
|
||||
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
|
||||
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop" />
|
||||
|
||||
<!--预警视图 OBU、云端下发、自车感知、自车策略-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_waring_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<!-- 浮层-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_floating_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 快捷操作浮层 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_entrance_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft"
|
||||
android:paddingLeft="@dimen/module_main_apps_fragment_container_padding"
|
||||
android:paddingTop="@dimen/module_main_apps_fragment_container_paddingTop"
|
||||
android:paddingRight="@dimen/module_main_apps_fragment_container_padding"
|
||||
android:paddingBottom="@dimen/module_main_apps_fragment_container_paddingTop" />
|
||||
<!-- 目的地车友 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_message_history_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
|
||||
|
||||
<!-- 浮层-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_floating_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 目的地车友 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_message_history_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/module_main_id_entrance_fragment_container_marginLeft" />
|
||||
|
||||
<!--搜索视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_search_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<!--搜索视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_search_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
<!--网约车视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_och_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<!--网约车视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_och_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--小地图视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_smp_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<!--小地图视图-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_smp_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!--冷启动过渡Logo-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/module_main_id_cover_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/main_splash_bg"
|
||||
android:clipChildren="true"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/main_bitmap_splash_icon"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.47" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!--冷启动过渡Logo-->
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/module_main_id_cover_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/main_splash_bg">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/main_bitmap_splash_icon"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.47" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="module_main_window_background_color">#212831</color>
|
||||
|
||||
</resources>
|
||||
@@ -2,8 +2,12 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Main" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
<item name="android:statusBarColor" tools:ignore="NewApi">@null</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:windowTranslucentStatus">true</item>
|
||||
<item name="android:windowEnterAnimation">@null</item>
|
||||
<item name="android:windowExitAnimation">@null</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
|
||||
@@ -513,7 +513,9 @@ public final class BarUtils {
|
||||
* @param isVisible True to set navigation bar visible, false otherwise.
|
||||
*/
|
||||
public static void setNavBarVisibility(@NonNull final Activity activity, boolean isVisible) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
return;
|
||||
}
|
||||
setNavBarVisibility(activity.getWindow(), isVisible);
|
||||
|
||||
}
|
||||
@@ -525,7 +527,9 @@ public final class BarUtils {
|
||||
* @param isVisible True to set navigation bar visible, false otherwise.
|
||||
*/
|
||||
public static void setNavBarVisibility(@NonNull final Window window, boolean isVisible) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
return;
|
||||
}
|
||||
final ViewGroup decorView = (ViewGroup) window.getDecorView();
|
||||
for (int i = 0, count = decorView.getChildCount(); i < count; i++) {
|
||||
final View child = decorView.getChildAt(i);
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
package com.mogo.commons.mvp;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.SoftKeyBoardJobber;
|
||||
|
||||
/**
|
||||
@@ -32,12 +25,9 @@ public abstract class MvpActivity<V extends IView, P extends Presenter<V>> exten
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
BarUtils.transparentStatusBar(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
beforeSetContentView(savedInstanceState);
|
||||
if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_BYD) {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
setContentView(getLayoutId());
|
||||
initViews();
|
||||
mPresenter = createPresenter();
|
||||
@@ -47,19 +37,9 @@ public abstract class MvpActivity<V extends IView, P extends Presenter<V>> exten
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
hideBottomUIMenu();
|
||||
BarUtils.setNavBarVisibility(this, false);
|
||||
}
|
||||
|
||||
//隐藏导航栏
|
||||
protected void hideBottomUIMenu() {
|
||||
//隐藏虚拟按键
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
//for new api versions.
|
||||
View decorView = getWindow().getDecorView();
|
||||
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
decorView.setSystemUiVisibility(uiOptions);
|
||||
}
|
||||
}
|
||||
|
||||
protected void beforeSetContentView(Bundle savedInstanceState) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user