new#速度仪表盘适配
This commit is contained in:
@@ -38,7 +38,7 @@ import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_T
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IMogoStatusChangedListener, IV2XListener {
|
||||
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IV2XListener {
|
||||
private static final String TAG = "MainLauncherActivity";
|
||||
protected boolean mIsHomeKeyDown = false;
|
||||
private static Handler handlerV2XEvent = new Handler();
|
||||
@@ -53,9 +53,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
DebugConfig.setNeedRequestUserInfo(true);
|
||||
Log.d(TAG, "onCreate");
|
||||
mServiceApis.getV2XListenerManager().registerIntentListener(MogoReceiver.ACTION_V2X_FRONT_WARNING, this);
|
||||
mServiceApis.getStatusManagerApi().registerStatusChangedListener(TAG,
|
||||
StatusDescriptor.VR_MODE, this);
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,28 +161,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
Logger.d(TAG, "send msg to AI Voice");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
FrameLayout.LayoutParams entranceParams = ((FrameLayout.LayoutParams) mEntrance.getLayoutParams());
|
||||
if (isTrue) {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode);
|
||||
mLeftShadowFrame.setVisibility(View.GONE);
|
||||
mApps.setVisibility(View.GONE);
|
||||
} else {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_id_entrance_fragment_container_marginLeft);
|
||||
mLeftShadowFrame.setVisibility(View.VISIBLE);
|
||||
mApps.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mEntrance.setLayoutParams(entranceParams);
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
clSpecialEffect.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
clSpecialEffect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warningChangedWithDirection(int type) {
|
||||
@@ -252,4 +228,15 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
EXPIRE_TIMER = ALL_EXPIRE_TIMER;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (isTrue) {
|
||||
mLeftShadowFrame.setVisibility(View.GONE);
|
||||
mApps.setVisibility(View.GONE);
|
||||
} else {
|
||||
mLeftShadowFrame.setVisibility(View.VISIBLE);
|
||||
mApps.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,9 @@ import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.v2x.IV2XListener;
|
||||
import com.mogo.skin.support.SkinMode;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
@@ -50,6 +52,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoADASControlStatusChangedListener,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
@@ -151,8 +154,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
super.onCreate(savedInstanceState);
|
||||
ContextHolderUtil.holdContext(this);
|
||||
mPresenter.postLoadModuleMsg();
|
||||
|
||||
NetworkUtils.listenNetStrength(this);
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
mServiceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@@ -402,4 +406,23 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mServiceApis.getShareManager().releaseContext();
|
||||
mServiceApis.getSkinSupportInstallerApi().onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
FrameLayout.LayoutParams entranceParams = ((FrameLayout.LayoutParams) mEntrance.getLayoutParams());
|
||||
if (isTrue) {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode);
|
||||
} else {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_id_entrance_fragment_container_marginLeft);
|
||||
}
|
||||
mEntrance.setLayoutParams(entranceParams);
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
clSpecialEffect.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
clSpecialEffect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">350px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">10px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">590px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">30px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">70px</dimen>
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">800px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">20px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">30px</dimen>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">350px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">10px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
|
||||
Reference in New Issue
Block a user