Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -148,7 +148,7 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
} else {
|
||||
properties.put( "appversion", CommonUtils.getVersionName( getContext() ) );
|
||||
}
|
||||
AppServiceHandler.getMogoAnalytics().track( "Launcher_APP_Icon", properties );
|
||||
AppServiceHandler.getApis().getAnalyticsApi().track( "Launcher_APP_Icon", properties );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.mogo.module.apps;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
|
||||
/**
|
||||
* author : zyz
|
||||
@@ -21,23 +17,6 @@ public class AppServiceHandler {
|
||||
private static final String TAG = "AppServiceHandler";
|
||||
|
||||
private static IMogoServiceApis mApis;
|
||||
private static IMogoCardManager mMogoCardManager;
|
||||
private static IMogoAnalytics mMogoAnalytics;
|
||||
|
||||
public static void init( final Context context ) {
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( context );
|
||||
mMogoCardManager = mApis.getCardManagerApi();
|
||||
mMogoAnalytics = mApis.getAnalyticsApi();
|
||||
|
||||
}
|
||||
|
||||
public static IMogoCardManager getMogoCardManager() {
|
||||
return mMogoCardManager;
|
||||
}
|
||||
|
||||
public static IMogoAnalytics getMogoAnalytics() {
|
||||
return mMogoAnalytics;
|
||||
}
|
||||
|
||||
public static IMogoServiceApis getApis() {
|
||||
if ( mApis == null ) {
|
||||
|
||||
@@ -53,8 +53,6 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
|
||||
getActivity().overridePendingTransition( 0, R.anim.module_apps_anim_exit);
|
||||
}
|
||||
} );
|
||||
// mAppsList = findViewById( R.id.module_apps_id_apps );
|
||||
// mAppsList.setLayoutManager( new GridLayoutManager( getContext(), 8 ) );
|
||||
mLoadingView = findViewById( R.id.module_apps_id_loading );
|
||||
mLoadingView.setVisibility( View.VISIBLE );
|
||||
mIndicator = findViewById( R.id.module_apps_id_indicator );
|
||||
|
||||
@@ -74,7 +74,6 @@ public class AppsFragmentProvider implements IMogoModuleProvider {
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
AppServiceHandler.init( context );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public class AppsListPresenter extends Presenter< AppsListView > implements IMog
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
mIntentManager = ( IMogoIntentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_INTENT_MANAGER ).navigation( getContext() );
|
||||
mIntentManager = AppServiceHandler.getApis().getIntentManagerApi();
|
||||
mIntentManager.registerIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
mIntentManager.registerIntentListener( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_UN_WAKE_CLOSE_APP_LIST, AppsConst.CMD_UN_WAKE_WORDS_CLOSE_APP_LIST, this );
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.module.apps;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.apps.applaunch.AppLaunchFilter;
|
||||
import com.mogo.module.apps.applaunch.AppLauncher;
|
||||
@@ -13,11 +12,8 @@ import com.mogo.module.apps.applaunch.InternalFunctionLauncher;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.model.AppsModel;
|
||||
import com.mogo.module.apps.model.UnScannedApps;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -42,17 +38,14 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
private IMogoAnalytics mAnalytics;
|
||||
private AppLaunchFilter mLauncher;
|
||||
|
||||
private IMogoServiceApis mApis;
|
||||
|
||||
private IMogoCardManager mCardManager;
|
||||
|
||||
public AppsPresenter( AppsView view ) {
|
||||
super( view );
|
||||
mApis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation( getContext() );
|
||||
mCardManager = mApis.getCardManagerApi();
|
||||
mCardManager = AppServiceHandler.getApis().getCardManagerApi();
|
||||
InternalFunctionLauncher internalFunctionLauncher = new InternalFunctionLauncher( getContext() );
|
||||
CardAppLauncher cardAppLauncher = new CardAppLauncher( this, mCardManager );
|
||||
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( mApis.getMapServiceApi().getNavi( getContext() ) );
|
||||
GuideShowLauncher guideShowLauncher = new GuideShowLauncher( AppServiceHandler.getApis().getMapServiceApi().getNavi( getContext() ) );
|
||||
internalFunctionLauncher.setNext( cardAppLauncher );
|
||||
cardAppLauncher.setNext( guideShowLauncher );
|
||||
guideShowLauncher.setNext( new AppLauncher() );
|
||||
@@ -69,7 +62,7 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
}
|
||||
} );
|
||||
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mAnalytics = AppServiceHandler.getApis().getAnalyticsApi();
|
||||
}
|
||||
|
||||
private void renderAppsList() {
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.module.back;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-02-26
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class Back2LauncherFragment extends Fragment {
|
||||
|
||||
private static final String TAG = "Back2LauncherFragment";
|
||||
|
||||
@Override
|
||||
public void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
BackToMainHomeManager.addMainHomeView();
|
||||
Logger.d( TAG, "addMainHomeView" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
BackToMainHomeManager.removeMainHomeView();
|
||||
Logger.d( TAG, "removeMainHomeView" );
|
||||
}
|
||||
}
|
||||
@@ -49,46 +49,11 @@ public class BackToLauncherModuleProvider implements IMogoModuleProvider {
|
||||
return BackToLauncherConst.MODULE_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoModuleLifecycle getCardLifecycle() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapListener getMapListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getType() {
|
||||
return ModuleType.TYPE_SERVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoLocationListener getLocationListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarkerClickListener getMarkerClickListener() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppPackage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAppName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
package com.mogo.module.back;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.back.utils.WindowManagerViewHelper;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class BackToMainHomeManager {
|
||||
|
||||
private static final String TAG = "BackToMainHomeManager";
|
||||
|
||||
private static View mBackView;
|
||||
|
||||
private static IMogoFragmentManager mFragmentManager;
|
||||
private static IMogoStatusManager mStatusManager;
|
||||
private static IMogoServiceApis mApis;
|
||||
@@ -45,7 +37,7 @@ public class BackToMainHomeManager {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent2 = new Intent( );
|
||||
Intent intent2 = new Intent();
|
||||
// 是否发自系统消息
|
||||
intent2.putExtra( "isHomeKeyDown", false );
|
||||
mApis.getIntentManagerApi().invoke( Intent.ACTION_CLOSE_SYSTEM_DIALOGS, intent2 );
|
||||
@@ -58,40 +50,34 @@ public class BackToMainHomeManager {
|
||||
AbsMogoApplication.getApp().startActivity( intent );
|
||||
}
|
||||
|
||||
private static WindowManagerView mWindowManagerView;
|
||||
|
||||
public static void addMainHomeView() {
|
||||
Logger.d( "BackToMainHomeManager", "addMainHomeView" );
|
||||
if ( mBackView != null ) WindowManagerViewHelper.removeView( mBackView );
|
||||
mBackView = LayoutInflater.from( AbsMogoApplication.getApp() ).inflate( R.layout.mogo_module_back_home_back_layout, null );
|
||||
final Context context = mBackView.getContext();
|
||||
if ( context == null || context.getApplicationContext() == null ) {
|
||||
return;
|
||||
|
||||
if ( mWindowManagerView == null ) {
|
||||
mWindowManagerView = new WindowManagerView.Builder( AbsMogoApplication.getApp() )
|
||||
.contentView( R.layout.mogo_module_back_home_back_layout )
|
||||
.position( AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_left ),
|
||||
AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_top ) )
|
||||
.size( WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT )
|
||||
.gravity( Gravity.LEFT | Gravity.TOP )
|
||||
.showInWindowManager();
|
||||
mWindowManagerView.attachTouchEvent( view -> {
|
||||
backToLauncher();
|
||||
} );
|
||||
}
|
||||
WindowManager windowManager = ( WindowManager ) context.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
if ( windowManager == null ) {
|
||||
return;
|
||||
try {
|
||||
mWindowManagerView.show();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
mBackView.setOnClickListener( view -> {
|
||||
backToLauncher();
|
||||
} );
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.x = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_left );
|
||||
params.y = AbsMogoApplication.getApp().getResources().getDimensionPixelOffset( R.dimen.module_back_main_home_icon_top );
|
||||
params.gravity = Gravity.LEFT | Gravity.CENTER;
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ) {
|
||||
params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
|
||||
} else {
|
||||
params.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
}
|
||||
params.format = PixelFormat.RGBA_8888;
|
||||
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||
windowManager.addView( mBackView, params );
|
||||
WindowManagerViewHelper.attachMovementEvent( mBackView, params );
|
||||
}
|
||||
|
||||
public static void removeMainHomeView() {
|
||||
WindowManagerViewHelper.removeView( mBackView );
|
||||
if ( mWindowManagerView != null ) {
|
||||
mWindowManagerView.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
|
||||
public class Utils {
|
||||
public static boolean isActivityExits( String packageName, String classStr ) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClassName( packageName, classStr );
|
||||
ResolveInfo resolveInfo = AbsMogoApplication.getApp().getPackageManager().resolveActivity( intent, PackageManager.MATCH_DEFAULT_ONLY );
|
||||
if ( resolveInfo != null ) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.os.Build;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-04-30
|
||||
* <p>
|
||||
* 向 window manager 添加 view
|
||||
*/
|
||||
public class WindowManagerViewHelper {
|
||||
|
||||
public static void addView( View view ) {
|
||||
|
||||
final Context context = view.getContext();
|
||||
if ( context == null || context.getApplicationContext() == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager windowManager = ( WindowManager ) context.getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
if ( windowManager == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.LEFT | Gravity.CENTER;
|
||||
params.type = getFitWindowParamsType();
|
||||
params.format = PixelFormat.RGBA_8888;
|
||||
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
|
||||
windowManager.addView( view, params );
|
||||
|
||||
attachMovementEvent( view, params );
|
||||
}
|
||||
|
||||
private static int getFitWindowParamsType() {
|
||||
int type;
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 ) {
|
||||
// Need request permission.
|
||||
type = WindowManager.LayoutParams.TYPE_PHONE;
|
||||
} else if ( Build.MODEL.equalsIgnoreCase( "MI 5" ) ) {
|
||||
// MI 5 phone not display crawler dot in android 7.0
|
||||
type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
|
||||
} else {
|
||||
// It's will be dismissed automatically 3s after showing in Android 25.
|
||||
type = WindowManager.LayoutParams.TYPE_TOAST;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
public static void removeView( View view ) {
|
||||
if ( view == null || view.getContext() == null || view.getContext().getApplicationContext() == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager windowManager = ( WindowManager ) view.getContext().getApplicationContext().getSystemService( Context.WINDOW_SERVICE );
|
||||
if ( windowManager == null ) {
|
||||
return;
|
||||
}
|
||||
windowManager.removeViewImmediate( view );
|
||||
DispatchTouchEventWrapper.getInstance().release();
|
||||
|
||||
}
|
||||
|
||||
public static void attachMovementEvent( View view, WindowManager.LayoutParams params ) {
|
||||
if ( view == null ) {
|
||||
return;
|
||||
}
|
||||
view.setOnTouchListener( ( v, event ) -> {
|
||||
DispatchTouchEventWrapper.getInstance()
|
||||
.attach( view, params )
|
||||
.handle( event );
|
||||
return false;
|
||||
} );
|
||||
}
|
||||
|
||||
static class DispatchTouchEventWrapper {
|
||||
|
||||
private WindowViewHandler mWindowViewHandler;
|
||||
|
||||
int mActionDownX = -1;
|
||||
int mActionDownY = -1;
|
||||
|
||||
/**
|
||||
* Flag whether move after touch down.
|
||||
*/
|
||||
boolean mMoveFlag = false;
|
||||
|
||||
private static volatile DispatchTouchEventWrapper INST;
|
||||
|
||||
private DispatchTouchEventWrapper() {
|
||||
}
|
||||
|
||||
public static DispatchTouchEventWrapper getInstance() {
|
||||
if ( INST == null ) {
|
||||
synchronized ( DispatchTouchEventWrapper.class ) {
|
||||
if ( INST == null ) {
|
||||
INST = new DispatchTouchEventWrapper();
|
||||
}
|
||||
}
|
||||
}
|
||||
return INST;
|
||||
}
|
||||
|
||||
public DispatchTouchEventWrapper attach( View windowView, WindowManager.LayoutParams params ) {
|
||||
if ( mWindowViewHandler == null || mWindowViewHandler.getWindowView() != windowView ) {
|
||||
mWindowViewHandler = new WindowViewHandler.DefaultHandler( windowView, params );
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean handle( MotionEvent event ) {
|
||||
switch ( event.getAction() & MotionEvent.ACTION_MASK ) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
if ( onActionDown( event ) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if ( onActionMove( event ) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
if ( onActionUp( event ) ) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onActionDown( MotionEvent event ) {
|
||||
mActionDownX = ( ( int ) event.getRawX() );
|
||||
mActionDownY = ( ( int ) event.getRawY() );
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.recordNewPosition();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onActionMove( MotionEvent event ) {
|
||||
|
||||
if ( Math.abs( event.getRawX() - mActionDownX ) >= 20
|
||||
|| Math.abs( event.getRawY() - mActionDownY ) >= 20 ) {
|
||||
mMoveFlag = true;
|
||||
}
|
||||
|
||||
if ( isLastDownValueLegal() ) {
|
||||
moveWindowView( event );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onActionUp( MotionEvent event ) {
|
||||
if ( isClickEventLike() ) {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.performClickLike();
|
||||
}
|
||||
} else {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.moveToEdge();
|
||||
mWindowViewHandler.recordNewPosition();
|
||||
}
|
||||
}
|
||||
mMoveFlag = false;
|
||||
clearLastDownAxisValue();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void clearLastDownAxisValue() {
|
||||
mActionDownX = mActionDownY = -1;
|
||||
}
|
||||
|
||||
private boolean isLastDownValueLegal() {
|
||||
return mActionDownX != -1 && mActionDownY != -1;
|
||||
}
|
||||
|
||||
private void moveWindowView( MotionEvent event ) {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.move( event, mActionDownX, mActionDownY );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Simulate click event just like set {@link View.OnClickListener}
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isClickEventLike() {
|
||||
System.out.println( mMoveFlag );
|
||||
return isLastDownValueLegal() && !mMoveFlag;
|
||||
}
|
||||
|
||||
public void release() {
|
||||
if ( mWindowViewHandler != null ) {
|
||||
mWindowViewHandler.release();
|
||||
}
|
||||
mWindowViewHandler = null;
|
||||
mActionDownX = -1;
|
||||
mActionDownY = -1;
|
||||
mMoveFlag = false;
|
||||
INST = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
|
||||
/**
|
||||
* Created by congtaowang on 2017/6/20.
|
||||
*/
|
||||
|
||||
public interface WindowViewHandler {
|
||||
|
||||
View getWindowView();
|
||||
|
||||
void recordNewPosition();
|
||||
|
||||
void move(MotionEvent event, int downX, int downY);
|
||||
|
||||
void release();
|
||||
|
||||
void moveToEdge();
|
||||
|
||||
void performClickLike();
|
||||
|
||||
class DefaultHandler implements WindowViewHandler {
|
||||
|
||||
protected View mWindowView;
|
||||
|
||||
protected int mWindowViewLeft = -1;
|
||||
protected int mWindowViewTop = -1;
|
||||
|
||||
private WindowManager.LayoutParams mParams;
|
||||
|
||||
public DefaultHandler( View windowView, WindowManager.LayoutParams params ) {
|
||||
this.mWindowView = windowView;
|
||||
mParams = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getWindowView() {
|
||||
return mWindowView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recordNewPosition() {
|
||||
mWindowViewLeft = mParams.x;
|
||||
mWindowViewTop = mParams.y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move( MotionEvent event, int downX, int downY ) {
|
||||
move( ( ( int ) ( event.getRawX() - downX ) ),
|
||||
( ( int ) ( event.getRawY() - downY ) ) );
|
||||
}
|
||||
|
||||
private void move( int distanceX, int distanceY ) {
|
||||
if ( mWindowView == null ) {
|
||||
return;
|
||||
}
|
||||
mParams.x = mWindowViewLeft + distanceX;
|
||||
mParams.y = mWindowViewTop + distanceY;
|
||||
WindowManager wm = ( ( WindowManager ) mWindowView.getContext().getSystemService( Context.WINDOW_SERVICE ) );
|
||||
|
||||
if ( wm == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mWindowView instanceof WindowViewUIController ) {
|
||||
if ( mParams.x > WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) / 2 ) {
|
||||
( ( WindowViewUIController ) mWindowView ).rightMode();
|
||||
} else {
|
||||
( ( WindowViewUIController ) mWindowView ).leftMode();
|
||||
}
|
||||
}
|
||||
|
||||
wm.updateViewLayout( mWindowView, alignLayoutParamsBoundary( mParams ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToEdge() {
|
||||
if ( mWindowView == null ) {
|
||||
return;
|
||||
}
|
||||
WindowManager wm = ( ( WindowManager ) mWindowView.getContext().getSystemService( Context.WINDOW_SERVICE ) );
|
||||
|
||||
if ( mParams.x > WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) / 2 ) {
|
||||
mParams.x = WindowUtils.getScreenWidth( AbsMogoApplication.getApp() ) - mWindowView.getMeasuredWidth();
|
||||
} else {
|
||||
mParams.x = 0;
|
||||
}
|
||||
|
||||
wm.updateViewLayout( mWindowView, alignLayoutParamsBoundary( mParams ) );
|
||||
}
|
||||
|
||||
protected WindowManager.LayoutParams alignLayoutParamsBoundary( WindowManager.LayoutParams params ) {
|
||||
return params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performClickLike() {
|
||||
if ( mWindowView instanceof WindowViewUIController ) {
|
||||
( ( WindowViewUIController ) mWindowView ).performClickLike();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
mWindowView = null;
|
||||
mWindowViewLeft = -1;
|
||||
mWindowViewTop = -1;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.module.back.utils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-05-12
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface WindowViewUIController {
|
||||
|
||||
void leftMode();
|
||||
|
||||
void rightMode();
|
||||
|
||||
void performClickLike();
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_back_main_home_icon_size">140px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">0px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">190px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">30px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">230px</dimen>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="module_back_main_home_icon_size">80px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">0px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">100px</dimen>
|
||||
<dimen name="module_back_main_home_icon_left">16px</dimen>
|
||||
<dimen name="module_back_main_home_icon_top">140px</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -12,6 +12,7 @@
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/module_ext_weather_container_paddingLeft"
|
||||
android:paddingEnd="@dimen/module_ext_weather_container_paddingRight"
|
||||
android:layout_marginEnd="@dimen/module_ext_msg_marginRight"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintRight_toLeftOf="@+id/module_ext_id_msg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -50,7 +50,6 @@ dependencies {
|
||||
api rootProject.ext.dependencies.moduleservice
|
||||
api rootProject.ext.dependencies.moduleapps
|
||||
api rootProject.ext.dependencies.moduleextensions
|
||||
api rootProject.ext.dependencies.mogomoduleback
|
||||
} else {
|
||||
api project(":foudations:mogo-utils")
|
||||
api project(":foudations:mogo-commons")
|
||||
@@ -61,7 +60,6 @@ dependencies {
|
||||
api project(':services:mogo-service')
|
||||
api project(':modules:mogo-module-apps')
|
||||
api project(':modules:mogo-module-extensions')
|
||||
api project(':modules:mogo-module-back')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMogoMapUIController, Scene.AIMLESS );
|
||||
|
||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||
addModule();
|
||||
loadContainerModules();
|
||||
MogoModulesManager.getInstance().loadModules();
|
||||
mPresenter.delayOperations();
|
||||
@@ -185,13 +184,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
startService( intent );
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模块
|
||||
*/
|
||||
protected void addModule() {
|
||||
|
||||
}
|
||||
|
||||
protected void loadContainerModules() {
|
||||
// MogoModulesManager.getInstance().loadExtensionsModule( R.id.module_main_id_header_fragment_container );
|
||||
MogoModulesManager.getInstance().loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
|
||||
|
||||
@@ -60,6 +60,7 @@ public class V2XConst {
|
||||
public static final String V2X_ROAD_SHOW = "v2x_road_show";
|
||||
public static final String V2X_ROAD_EVET = "v2x_road_event";
|
||||
public static final String V2X_ROAD_EVET_HISTORY_BUTTON = "V2X_button_click";
|
||||
public static final String V2X_ROAD_PRODUCE = "v2x_road_produce";
|
||||
/**
|
||||
* V2X 道路事件操作类型
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkScenario;
|
||||
import com.mogo.module.v2x.scenario.scene.park.V2XIllegalParkWindow;
|
||||
import com.mogo.module.v2x.utils.FatigueDrivingUtils;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
@@ -156,8 +155,6 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
// 刷新配置文件
|
||||
refreshStrategyConfig();
|
||||
// 清除V2X事件数据库中过期的数据,数据有效期为24小时
|
||||
V2XSQLiteUtils.clearYesterdayScenarioHistoryData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,38 +66,13 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
shareLoadStatusViewHolder holder = new shareLoadStatusViewHolder(v);
|
||||
return holder;
|
||||
}else {
|
||||
View v = shareLayoutInflater.inflate(R.layout.item_v2x_event_share_no_more, parent,
|
||||
View v = shareLayoutInflater.inflate(R.layout.footer_nomore_view, parent,
|
||||
false);
|
||||
shareLoadNoMoreViewHolder holder = new shareLoadNoMoreViewHolder(v);
|
||||
return holder;
|
||||
}
|
||||
}
|
||||
|
||||
private float getEnthusuasmIndex(double score) {
|
||||
if (score <= 0) {
|
||||
return 0;
|
||||
} else if (0 < score && score <= 5) {
|
||||
return (float) 0.5;
|
||||
} else if (5 < score && score <= 10) {
|
||||
return 1;
|
||||
} else if (10 < score && score <= 15) {
|
||||
return (float) 1.5;
|
||||
} else if (15 < score && score <= 20) {
|
||||
return 2;
|
||||
} else if (20 < score && score <= 25) {
|
||||
return (float) 2.5;
|
||||
} else if (25 < score && score <= 30) {
|
||||
return 3;
|
||||
} else if (30 < score && score <= 35) {
|
||||
return (float) 3.5;
|
||||
} else if (35 < score && score <= 40) {
|
||||
return 4;
|
||||
} else if (40 < score && score <= 45) {
|
||||
return (float) 4.5;
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
@@ -115,7 +90,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
if (likeNum != null) {
|
||||
((shareDescriptionViewHolder) holder).approveNumTextView.setText(likeNum);
|
||||
}
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating(getEnthusuasmIndex(enthusiasmIndex));
|
||||
((shareDescriptionViewHolder) holder).ratingBar.setRating((float) enthusiasmIndex);
|
||||
}
|
||||
}
|
||||
} else if (holder instanceof shareItemViewHolder) {
|
||||
@@ -207,7 +182,7 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
}
|
||||
|
||||
/*
|
||||
* 去分享
|
||||
* 去分享 刷新
|
||||
* */
|
||||
class shareEmptyViewHolder extends RecyclerView.ViewHolder {
|
||||
public shareEmptyViewHolder(@NonNull View itemView) {
|
||||
@@ -218,6 +193,14 @@ public class V2XShareEventAdapter extends RecyclerView.Adapter<RecyclerView.View
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
mApis.getShareManager().showShareDialog();
|
||||
});
|
||||
|
||||
Button refresh = itemView.findViewById(R.id.refresh_button);
|
||||
refresh.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
callback.getShareEventResponse();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,12 +170,22 @@ public class V2XOtherSeekHelpVH extends V2XBaseViewHolder<V2XEventShowEntity> {
|
||||
.displayImage(mV2XPushMessageEntity.getHeadImgUrl(), ivHead);
|
||||
}
|
||||
tvName.setText(mV2XPushMessageEntity.getDisplayName());
|
||||
SpanUtils.with(tvDistance)
|
||||
.append("" + (int) mV2XPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
|
||||
if (mV2XPushMessageEntity.getDistance() > 1000) {
|
||||
SpanUtils.with(tvDistance)
|
||||
.append("" + (int) mV2XPushMessageEntity.getDistance() / 1000)
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("km")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
} else {
|
||||
SpanUtils.with(tvDistance)
|
||||
.append("" + (int) mV2XPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
|
||||
String eventTime = String.format("%s发布求助信息",
|
||||
sdf.format(new Date(mV2XPushMessageEntity.getCreateTime())));
|
||||
|
||||
@@ -80,12 +80,21 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
.displayImage(xPushMessageEntity.getHeadImgUrl(), mIvFaultHelpHead);
|
||||
}
|
||||
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
if (xPushMessageEntity.getDistance() > 1000) {
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance() / 1000)
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("km")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
} else {
|
||||
SpanUtils.with(mTvFaultHelpDistance)
|
||||
.append("" + (int) xPushMessageEntity.getDistance())
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_text))
|
||||
.append("m")
|
||||
.setFontSize((int) itemView.getResources().getDimension(R.dimen.module_v2x_event_distance_title))
|
||||
.create();
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm", Locale.CHINA);
|
||||
String eventTime = String.format("%s发布求助信息",
|
||||
sdf.format(new Date(xPushMessageEntity.getCreateTime())));
|
||||
@@ -102,6 +111,7 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
}
|
||||
|
||||
mIvFaultHelpEventNavi.setOnClickListener(v -> {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
triggerStartNavi(mNoveltyInfo);
|
||||
});
|
||||
|
||||
@@ -125,6 +135,7 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
|
||||
mIvFaultHelpEventCall.setOnClickListener(v -> {
|
||||
if (!V2XUtils.isFastClick()) {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
try {
|
||||
mUserInfo.setSn(xPushMessageEntity.getSn());
|
||||
mUserInfo.setUserHead(xPushMessageEntity.getHeadImgUrl());
|
||||
@@ -147,7 +158,6 @@ public class V2XScenarioHistoryOtherSeekHelpVH extends V2XBaseViewHolder<V2XHist
|
||||
@Override
|
||||
public void delayedCloseWindow() {
|
||||
try {
|
||||
V2XServiceManager.getV2XRefreshModel().respondingToHelp(mUserInfo.getSn());
|
||||
|
||||
hideControlButton(View.GONE);
|
||||
// 进行数据库存储
|
||||
|
||||
@@ -64,7 +64,7 @@ public class V2XScenarioHistoryRoadEventVH extends V2XBaseViewHolder<V2XHistoryS
|
||||
|
||||
try {
|
||||
mTvIllegalNum.setText(mExploreWay.getUserInfo().getUserName() + " 的分享 时间:" +
|
||||
TimeUtils.millis2String(mExploreWay.getGenerateTime(), "MM月dd日 HH:mm"));
|
||||
TimeUtils.millis2String(mOldScenarioData.getTriggerTime(), "MM月dd日 HH:mm"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.v2x.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.widget.RadioGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
@@ -12,8 +12,10 @@ import com.mogo.module.v2x.V2XServiceManager
|
||||
import com.mogo.module.v2x.adapter.V2XEventPagerAdapter
|
||||
import com.mogo.module.v2x.presenter.EventPanelPresenter
|
||||
import com.mogo.module.v2x.utils.TrackUtils
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils
|
||||
import com.mogo.module.v2x.view.V2XEventPanelHistoryCountView
|
||||
import com.mogo.module.v2x.voice.V2XVoiceCallbackListener
|
||||
import com.mogo.module.v2x.voice.V2XVoiceConstants
|
||||
import com.mogo.module.v2x.voice.V2XVoiceManager
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.module_v2x_event_panel_fragment_event_panel.*
|
||||
|
||||
@@ -27,12 +29,16 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
|
||||
private val TAG = "EventPanelFragment"
|
||||
|
||||
private var isFirstLoad = false
|
||||
|
||||
private var fragments: Array<Fragment>? = null
|
||||
|
||||
private var mediator: TabLayoutMediator? = null
|
||||
|
||||
private var mV2XEventPanelHistoryCountView: V2XEventPanelHistoryCountView? = null
|
||||
|
||||
private val mV2XScenarioHistoryFragment = V2XScenarioHistoryFragment()
|
||||
|
||||
companion object {
|
||||
private val fragment = V2XEventPanelFragment()
|
||||
fun getInstance(): V2XEventPanelFragment {
|
||||
@@ -40,57 +46,94 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
}
|
||||
}
|
||||
|
||||
// 打开出行动态TAB
|
||||
private val mCheckHistoryEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
rbScenarioHistory?.isChecked=true
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
// 打开周边事件TAB
|
||||
private val mCheckSurroundingCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
rbSurroundingEvent?.isChecked=true
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
// 打开我的分享TAB
|
||||
private val mCheckShearEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
rbShareEvents?.isChecked=true
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
// 打关闭事件面板
|
||||
private val mCloeEventCb = V2XVoiceCallbackListener { command: String?, intent: Intent? ->
|
||||
try {
|
||||
TrackUtils.trackV2xHistoryEvent(5)
|
||||
hidePanel()
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.module_v2x_event_panel_fragment_event_panel
|
||||
}
|
||||
|
||||
override fun initViews() {
|
||||
Logger.d(MODULE_NAME, "事件面板初始化……")
|
||||
fragments = arrayOf(
|
||||
V2XScenarioHistoryFragment(),
|
||||
V2XSurroundingFragment(),
|
||||
V2XShareEventsFragment()
|
||||
)
|
||||
//禁用预加载
|
||||
vpEventPanel.offscreenPageLimit = ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT
|
||||
vpEventPanel.adapter = V2XEventPagerAdapter(this, fragments!!)
|
||||
vpEventPanel.isUserInputEnabled = false; //true:滑动,false:禁止滑动
|
||||
try {
|
||||
fragments = arrayOf(
|
||||
mV2XScenarioHistoryFragment,
|
||||
V2XSurroundingFragment(),
|
||||
V2XShareEventsFragment()
|
||||
)
|
||||
//禁用预加载
|
||||
vpEventPanel.offscreenPageLimit = ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT
|
||||
vpEventPanel.adapter = V2XEventPagerAdapter(this, fragments!!)
|
||||
vpEventPanel.isUserInputEnabled = false; //true:滑动,false:禁止滑动
|
||||
|
||||
val radioGroup = findViewById<View>(R.id.rgTabSelect) as RadioGroup?
|
||||
radioGroup!!.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbScenarioHistory -> {
|
||||
TrackUtils.trackV2xHistoryEvent(2)
|
||||
vpEventPanel.setCurrentItem(0, false)
|
||||
}
|
||||
R.id.rbSurroundingEvent -> {
|
||||
TrackUtils.trackV2xHistoryEvent(3)
|
||||
vpEventPanel.setCurrentItem(1, false)
|
||||
}
|
||||
R.id.rbShareEvents -> {
|
||||
TrackUtils.trackV2xHistoryEvent(4)
|
||||
vpEventPanel.setCurrentItem(2, false)
|
||||
rgTabSelect?.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.rbScenarioHistory -> {
|
||||
TrackUtils.trackV2xHistoryEvent(2)
|
||||
vpEventPanel.setCurrentItem(0, false)
|
||||
}
|
||||
R.id.rbSurroundingEvent -> {
|
||||
TrackUtils.trackV2xHistoryEvent(3)
|
||||
vpEventPanel.setCurrentItem(1, false)
|
||||
}
|
||||
R.id.rbShareEvents -> {
|
||||
TrackUtils.trackV2xHistoryEvent(4)
|
||||
vpEventPanel.setCurrentItem(2, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
btnHidePanels.setOnClickListener {
|
||||
TrackUtils.trackV2xHistoryEvent(5)
|
||||
hidePanel()
|
||||
}
|
||||
|
||||
mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context)
|
||||
mV2XEventPanelHistoryCountView!!.setOnClickListener {
|
||||
TrackUtils.trackV2xHistoryEvent(1)
|
||||
if (!isPanelShow()) {
|
||||
showPanel()
|
||||
} else {
|
||||
btnHidePanels.setOnClickListener {
|
||||
TrackUtils.trackV2xHistoryEvent(5)
|
||||
hidePanel()
|
||||
}
|
||||
}
|
||||
V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView)
|
||||
|
||||
changeEventCount()
|
||||
mV2XEventPanelHistoryCountView = V2XEventPanelHistoryCountView(context)
|
||||
mV2XEventPanelHistoryCountView!!.setOnClickListener {
|
||||
if (!isPanelShow()) {
|
||||
TrackUtils.trackV2xHistoryEvent(1)
|
||||
showPanel()
|
||||
}
|
||||
}
|
||||
V2XServiceManager.getMogoEntranceButtonController().addBottomLayerView(mV2XEventPanelHistoryCountView)
|
||||
changeEventCount()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
@@ -105,13 +148,29 @@ class V2XEventPanelFragment : MvpFragment<V2XEventPanelFragment, EventPanelPrese
|
||||
fun showPanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment show panel")
|
||||
clPanelContainer.visibility = View.VISIBLE
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, true)
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP, mCheckHistoryEventCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP, mCheckSurroundingCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP, mCheckShearEventCb)
|
||||
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP, mCloeEventCb)
|
||||
try {
|
||||
if (isFirstLoad) {
|
||||
mV2XScenarioHistoryFragment.presenter.loadHistory()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
isFirstLoad = true
|
||||
}
|
||||
|
||||
fun hidePanel() {
|
||||
Logger.d(MODULE_NAME, "in fragment hide panel")
|
||||
clPanelContainer.visibility = View.GONE
|
||||
V2XServiceManager.getMoGoV2XStatusManager().setEventPanelWindowShow(TAG, false)
|
||||
// 注册语音交互
|
||||
V2XVoiceManager.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP)
|
||||
.unRegisterUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP)
|
||||
}
|
||||
|
||||
fun isPanelShow(): Boolean {
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.mogo.module.v2x.adapter.V2XScenarioHistoryAdapter;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusChangedListener;
|
||||
import com.mogo.module.v2x.manager.V2XStatusDescriptor;
|
||||
import com.mogo.module.v2x.presenter.ScenarioHistoryPresenter;
|
||||
import com.mogo.module.v2x.utils.ThreadUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.module.v2x.view.V2XListEmptyView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -72,6 +74,7 @@ public class V2XScenarioHistoryFragment
|
||||
@Override
|
||||
public void onShearClick() {
|
||||
V2XServiceManager.getMogoShareManager().showShareDialog();
|
||||
V2XEventPanelFragment.Companion.getInstance().hidePanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,21 +111,28 @@ public class V2XScenarioHistoryFragment
|
||||
*/
|
||||
public void loadHistory(List<V2XHistoryScenarioData> v2XHistoryScenarioData) {
|
||||
Logger.d(TAG, "查询到历史消息:" + GsonUtil.jsonFromObject(v2XHistoryScenarioData));
|
||||
mV2XHistoryScenarioData.clear();
|
||||
if (v2XHistoryScenarioData.size() > 0) {
|
||||
mEmptyView.setVisibility(View.GONE);
|
||||
mClHistoryList.setVisibility(View.VISIBLE);
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
} else {
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
mClHistoryList.setVisibility(View.GONE);
|
||||
}
|
||||
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mV2XHistoryScenarioData.clear();
|
||||
if (v2XHistoryScenarioData.size() > 0) {
|
||||
mEmptyView.setVisibility(View.GONE);
|
||||
mClHistoryList.setVisibility(View.VISIBLE);
|
||||
mV2XHistoryScenarioData.addAll(v2XHistoryScenarioData);
|
||||
} else {
|
||||
mEmptyView.setVisibility(View.VISIBLE);
|
||||
mClHistoryList.setVisibility(View.GONE);
|
||||
}
|
||||
mV2XScenarioHistoryAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
// 清除V2X事件数据库中过期的数据,数据有效期为24小时
|
||||
V2XSQLiteUtils.clearYesterdayScenarioHistoryData();
|
||||
mPresenter.loadHistory();
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +77,10 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
/*
|
||||
* 获取热心指数,分享列表等分享内容
|
||||
* */
|
||||
private void getShareEventResponse() {
|
||||
@Override
|
||||
public void getShareEventResponse() {
|
||||
animatioonAcction(View.VISIBLE);
|
||||
|
||||
v2XShareNetworkModel.getShareEventResponse(pageNum, 10, new V2XRefreshCallback() {
|
||||
@Override
|
||||
public void onSuccess(Object result) {
|
||||
@@ -87,6 +89,9 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
if (resultData != null && resultData.getResult() != null
|
||||
&& resultData.getResult().getEnthusiasmIndex() != null) {
|
||||
if (dataArrayList.size() > 0) {
|
||||
dataArrayList.clear();
|
||||
}
|
||||
dataArrayList.add(resultData.getResult().getEnthusiasmIndex());
|
||||
Log.d(TAG, "热心指数:" + resultData.getResult().getEnthusiasmIndex());
|
||||
}
|
||||
@@ -97,7 +102,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
loadingView.stopWithError(msg);
|
||||
loadingView.stopWithError(msg, View.VISIBLE);
|
||||
loadingView.refresButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -106,6 +111,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@@ -182,7 +188,7 @@ public class V2XShareEventsFragment extends MvpFragment implements AdapterCallba
|
||||
|
||||
@Override
|
||||
public void onFail(String msg) {
|
||||
|
||||
loadingView.stopWithError(msg, View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,4 +6,6 @@ package com.mogo.module.v2x.listener;
|
||||
public interface AdapterCallback {
|
||||
//分享列表加载更多
|
||||
void loadMoreShareEventList();
|
||||
//分享列表首次刷新
|
||||
void getShareEventResponse();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.mogo.module.v2x.utils.ADASUtils;
|
||||
import com.mogo.module.v2x.utils.DrivingDirectionUtils;
|
||||
import com.mogo.module.v2x.utils.LocationUtils;
|
||||
import com.mogo.module.v2x.utils.MarkerUtils;
|
||||
import com.mogo.module.v2x.utils.TrackUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
@@ -157,6 +158,7 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList
|
||||
);
|
||||
// Logger.w(MODULE_NAME, "V2X预警--前方数据距离:" + v2XRoadEventEntity.getDistance());
|
||||
// 触发展示操作
|
||||
TrackUtils.trackV2xRoadProduceEvent(1);
|
||||
V2XMessageEntity<V2XRoadEventEntity> v2XMessageEntity = new V2XMessageEntity<>();
|
||||
v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING);
|
||||
v2XMessageEntity.setContent(v2XRoadEventEntity);
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.alarm.V2XAlarmServer;
|
||||
import com.mogo.module.v2x.utils.TimeConstants;
|
||||
import com.mogo.module.v2x.utils.TimeUtils;
|
||||
import com.mogo.module.v2x.utils.TrackUtils;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -42,6 +43,7 @@ public class V2XMessageListener_401012 implements IMogoOnMessageListener<MarkerC
|
||||
public void onMsgReceived(MarkerCardResult response) {
|
||||
Logger.d(MODULE_NAME, "V2XMessageListener_401012==V2X服务端下发:\n"
|
||||
+ GsonUtil.jsonFromObject(response));
|
||||
TrackUtils.trackV2xRoadProduceEvent(2);
|
||||
try {
|
||||
long timeSpan = TimeUtils.getTimeSpan(TimeUtils.getNowMills(), response.getMessageTime(), TimeConstants.MIN);
|
||||
// 三分钟以内的消息才会提示用户
|
||||
|
||||
@@ -132,20 +132,17 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
|
||||
|
||||
if (exploreWayList != null) {
|
||||
for (MarkerExploreWay markerExploreWay : exploreWayList) {
|
||||
// 因为目前探路卡片不支持直播,所以这里做了过滤 @李小鹏
|
||||
if (!markerExploreWay.getCanLive()) {
|
||||
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
// 记录道路事件
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(markerLocation);
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
|
||||
if (EventTypeUtils.isRoadEvent(markerExploreWay.getPoiType())) {
|
||||
MarkerLocation markerLocation = markerExploreWay.getLocation();
|
||||
// 记录道路事件
|
||||
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();
|
||||
v2XRoadEventEntity.setLocation(markerLocation);
|
||||
// 探路目前只有上报拥堵
|
||||
v2XRoadEventEntity.setPoiType(markerExploreWay.getPoiType());
|
||||
|
||||
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
}
|
||||
v2XRoadEventEntity.setNoveltyInfo(markerExploreWay);
|
||||
v2XRoadEventEntity.setExpireTime(20000);
|
||||
mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class V2XShareNetworkModel {
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
if (callback != null){
|
||||
callback.onFail("当前服务不可以, 请稍后重试");
|
||||
callback.onFail("网络异常,点击刷新重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -180,7 +180,7 @@ public class V2XShareNetworkModel {
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
if (callback != null){
|
||||
callback.onFail("当前服务不可以, 请稍后重试");
|
||||
callback.onFail("网络异常,点击刷新重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -4,7 +4,9 @@ package com.mogo.module.v2x.presenter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.module.common.entity.V2XHistoryScenarioData;
|
||||
import com.mogo.module.v2x.fragment.V2XScenarioHistoryFragment;
|
||||
import com.mogo.module.v2x.utils.ThreadUtils;
|
||||
import com.mogo.module.v2x.utils.V2XSQLiteUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,7 +20,9 @@ public class ScenarioHistoryPresenter extends Presenter<V2XScenarioHistoryFragme
|
||||
}
|
||||
|
||||
public void loadHistory() {
|
||||
List<V2XHistoryScenarioData> v2XHistoryScenarioData = V2XSQLiteUtils.getScenarioHistoryData();
|
||||
mView.loadHistory(v2XHistoryScenarioData);
|
||||
WorkThreadHandler.getInstance().post(() -> {
|
||||
List<V2XHistoryScenarioData> v2XHistoryScenarioData = V2XSQLiteUtils.getScenarioHistoryData();
|
||||
mView.loadHistory(v2XHistoryScenarioData);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,4 +62,19 @@ public class TrackUtils {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param type type=1 短距离角度匹配
|
||||
* type=2 历史轨迹匹配
|
||||
*/
|
||||
public static void trackV2xRoadProduceEvent(int type) {
|
||||
try {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
V2XServiceManager.getMogoAnalytics().track(V2XConst.V2X_ROAD_PRODUCE, properties);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
}
|
||||
}
|
||||
|
||||
public void stopWithError(String errormsg) {
|
||||
public void stopWithError(String errormsg, int showRefreshButton) {
|
||||
if (v2XAnimationManager != null) {
|
||||
v2XAnimationManager.soptWithError();
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class V2XNetworkLoadingView extends RelativeLayout {
|
||||
textView.setText(errormsg);
|
||||
}
|
||||
if (refresButton != null) {
|
||||
refresButton.setVisibility(VISIBLE);
|
||||
refresButton.setVisibility(showRefreshButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ public class V2XVoiceConstants {
|
||||
* 关闭路况详情
|
||||
*/
|
||||
public static final String COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP = "COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP";
|
||||
public static final String[] COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP_WORDS = {"关闭"};
|
||||
public static final String[] COMMAND_V2X_TO_CLOSE_WINDOW_UN_WAKEUP_WORDS = {"关闭", "关闭页面"};
|
||||
/**
|
||||
* 应用内免唤醒
|
||||
* 反馈"正确"语音回调
|
||||
@@ -207,6 +207,24 @@ public class V2XVoiceConstants {
|
||||
public static final String COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP_WORDS = {"没用"};
|
||||
|
||||
/**
|
||||
* 出行动态
|
||||
*/
|
||||
public static final String COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP_WORDS = {"出行动态"};
|
||||
|
||||
/**
|
||||
* 周边事件
|
||||
*/
|
||||
public static final String COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP_WORDS = {"周边事件"};
|
||||
|
||||
/**
|
||||
* 我的分享
|
||||
*/
|
||||
public static final String COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP = "COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP";
|
||||
public static final String[] COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP_WORDS = {"我的分享"};
|
||||
|
||||
static {
|
||||
// 免唤醒 默认
|
||||
sVoiceCmds.put(COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP, COMMAND_V2X_TO_CHAT_MORE_UN_WAKEUP_WORDS);
|
||||
@@ -230,6 +248,10 @@ public class V2XVoiceConstants {
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP, COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_YOUYONG_UN_WAKEUP_WORDS);
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP, COMMAND_ZHIDAO_V2X_ILLEGAL_PARKMARKER_FEEDBACK_MEIYONG_UN_WAKEUP_WORDS);
|
||||
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_HISTORY_EVENT_UN_WAKEUP_WORDS);
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_SURROUNDING_EVENT_UN_WAKEUP_WORDS);
|
||||
sVoiceCmds.put(COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP, COMMAND_ZHIDAO_V2X_OPEN_SHEAR_EVENT_UN_WAKEUP_WORDS);
|
||||
|
||||
|
||||
//默认
|
||||
/* sCmds.add(COMMAND_ZHIDAO_V2X_CALL_CHATTING);
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="40px"
|
||||
android:paddingBottom="40px">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/event_share_load_no_more"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:alpha="0.6"
|
||||
android:paddingTop="12px"
|
||||
android:paddingBottom="12px"
|
||||
android:text="没有更多记录了"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/left_line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0.5px"
|
||||
android:alpha="0.5"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="46px"
|
||||
android:layout_marginRight="16px"
|
||||
android:layout_toLeftOf="@id/event_share_load_no_more"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/right_line"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0.5px"
|
||||
android:alpha="0.5"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="16px"
|
||||
android:layout_marginRight="46px"
|
||||
android:layout_toRightOf="@id/event_share_load_no_more"
|
||||
android:background="#FFFFFF" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,100 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/clPanelContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="#10121E"
|
||||
android:clickable="true"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:visibility="gone"
|
||||
app:roundLayoutRadius="@dimen/dp_40"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.mogo.module.v2x.view.RoundConstraintLayout
|
||||
android:id="@+id/clPanelContainer"
|
||||
<RadioGroup
|
||||
android:id="@+id/rgTabSelect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#10121E"
|
||||
android:clickable="true"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:visibility="gone"
|
||||
app:roundLayoutRadius="@dimen/dp_40"
|
||||
tools:visibility="visible">
|
||||
android:layout_height="@dimen/dp_154"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rgTabSelect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<RadioButton
|
||||
android:id="@+id/rbScenarioHistory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="出行动态"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbScenarioHistory"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="出行动态"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
<RadioButton
|
||||
android:id="@+id/rbSurroundingEvent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="周边事件"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbSurroundingEvent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="周边事件"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="@dimen/dp_42"
|
||||
android:background="#757575" />
|
||||
<RadioButton
|
||||
android:id="@+id/rbShareEvents"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="我的分享"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
</RadioGroup>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbShareEvents"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_40"
|
||||
android:paddingEnd="@dimen/dp_40"
|
||||
android:text="我的分享"
|
||||
android:textColor="@color/radiobutton_textcolor"
|
||||
android:textSize="@dimen/dp_40"
|
||||
android:textStyle="bold" />
|
||||
</RadioGroup>
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vpEventPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rgTabSelect" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/vpEventPanel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rgTabSelect" />
|
||||
<ImageView
|
||||
android:id="@+id/btnHidePanels"
|
||||
android:layout_width="@dimen/dp_88"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:background="@drawable/icon_window_close"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rgTabSelect"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/rgTabSelect" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btnHidePanels"
|
||||
android:layout_width="@dimen/dp_88"
|
||||
android:layout_height="@dimen/dp_88"
|
||||
android:background="@drawable/icon_window_close"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/rgTabSelect"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/rgTabSelect" />
|
||||
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.mogo.module.v2x.view.RoundConstraintLayout>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/no_share_image"
|
||||
@@ -14,29 +14,52 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/share_event_null_des"
|
||||
android:layout_below="@+id/no_share_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/no_share_image"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="bottom"
|
||||
android:alpha="0.7"
|
||||
android:layout_marginTop="12.6px"
|
||||
android:textSize="18px"
|
||||
android:alpha="0.7"
|
||||
android:gravity="bottom"
|
||||
android:text="你还没有分享过道路事件,快去试试吧"
|
||||
android:textColor="#FFFFFF" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/share_event_button"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="48px"
|
||||
android:layout_below="@+id/share_event_null_des"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/bg_v2x_event_live_show"
|
||||
android:clickable="true"
|
||||
android:onClick="shareEventAction"
|
||||
android:layout_marginTop="21px"
|
||||
android:text="去分享"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25sp" />
|
||||
android:textSize="18px" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="33px">
|
||||
|
||||
<Button
|
||||
android:id="@+id/share_event_button"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="48px"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_toLeftOf="@id/center"
|
||||
android:background="@drawable/v2xt_dw_common_corner_bkg_dark"
|
||||
android:clickable="true"
|
||||
android:onClick="shareEventAction"
|
||||
android:text="去分享"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
<View
|
||||
android:id="@+id/center"
|
||||
android:layout_width="29px"
|
||||
android:layout_height="29px"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/refresh_button"
|
||||
android:layout_width="150px"
|
||||
android:layout_height="48px"
|
||||
android:layout_toRightOf="@id/center"
|
||||
android:background="@drawable/v2xt_dw_common_corner_bkg_light"
|
||||
android:text="刷新"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="18px" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -2,8 +2,8 @@
|
||||
"coordinates":[
|
||||
{
|
||||
"createTime":1593678359872,
|
||||
"distance":100,
|
||||
"lat":39.966668,
|
||||
"distance":1100,
|
||||
"lat":39.866668,
|
||||
"lon":116.411211,
|
||||
"sn":"ZD801B1932L00041",
|
||||
"targetId":20007,
|
||||
|
||||
Reference in New Issue
Block a user