Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0
2
.idea/misc.xml
generated
@@ -5,7 +5,7 @@
|
||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -55,19 +55,18 @@ android {
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
api rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
implementation rootProject.ext.dependencies.androidxmultidex
|
||||
debugImplementation rootProject.ext.dependencies.leakcanary
|
||||
testImplementation rootProject.ext.dependencies.leakcanary
|
||||
releaseImplementation rootProject.ext.dependencies.leakcanarynoop
|
||||
releaseImplementation rootProject.ext.dependencies.androidxmultidex
|
||||
|
||||
// implementation rootProject.ext.dependencies.moduledemo
|
||||
// implementation rootProject.ext.dependencies.moduledemo2
|
||||
implementation rootProject.ext.dependencies.carcallprovider
|
||||
implementation rootProject.ext.dependencies.carcall
|
||||
implementation rootProject.ext.dependencies.modulemedia
|
||||
|
||||
|
||||
implementation rootProject.ext.dependencies.moduleonlinecar
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.carchatting.card.CallChatConstant;
|
||||
@@ -12,6 +13,8 @@ import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.media.MediaConstants;
|
||||
import com.mogo.module.onlinecar.OnLineCarConstants;
|
||||
import com.mogo.module.tanlu.constant.TanluConstants;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -27,10 +30,17 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
|
||||
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
||||
DebugConfig.setNetMode( DebugConfig.NET_MODE_QA );
|
||||
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
||||
MogoModulePaths.addModule( new MogoModule( OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR" ) );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CONDITION" ) );
|
||||
MogoModulePaths.addModule(new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
MogoModulePaths.addModule(new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE) );
|
||||
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
IMogoSocketManager mMogoSocketManager = ( IMogoSocketManager ) ARouter.getInstance().build( MogoServicePaths.PATH_SOCKET_MANAGER ).navigation();
|
||||
mMogoSocketManager.init( getApplicationContext(), BuildConfig.APPLICATION_ID );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,10 @@ import android.content.Context;
|
||||
|
||||
import com.zhidao.auto.platform.voice.VoiceClient;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -33,7 +36,8 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
}
|
||||
|
||||
private final VoiceClient mVoiceClient;
|
||||
private Map< String, IMogoVoiceCmdCallBack > mCmdMap = new HashMap<>();
|
||||
private Map< String, List< IMogoVoiceCmdCallBack > > mCmdMap = new HashMap<>();
|
||||
private Map< String, IMogoVoiceCmdCallBack > mVoiceMap = new HashMap<>();
|
||||
|
||||
private AIAssist( Context context ) {
|
||||
// private constructor
|
||||
@@ -43,15 +47,22 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
final IMogoVoiceCmdCallBack cmdCallBack = mCmdMap.get( cmd );
|
||||
if ( cmdCallBack != null ) {
|
||||
cmdCallBack.onCmdSelected( cmd );
|
||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
||||
return;
|
||||
}
|
||||
final List< IMogoVoiceCmdCallBack > cmdCallBacks = mCmdMap.get( cmd );
|
||||
Iterator< IMogoVoiceCmdCallBack > iterator = cmdCallBacks.iterator();
|
||||
while ( iterator.hasNext() ) {
|
||||
IMogoVoiceCmdCallBack callBack = iterator.next();
|
||||
if ( callBack != null ) {
|
||||
callBack.onCmdSelected( cmd );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdAction( String speakText ) {
|
||||
IMogoVoiceCmdCallBack cmdCallBack = mCmdMap.remove( speakText );
|
||||
IMogoVoiceCmdCallBack cmdCallBack = mVoiceMap.remove( speakText );
|
||||
if ( cmdCallBack != null ) {
|
||||
cmdCallBack.onCmdAction( speakText );
|
||||
}
|
||||
@@ -59,7 +70,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
|
||||
@Override
|
||||
public void onCmdCancel( String speakText ) {
|
||||
IMogoVoiceCmdCallBack cmdCallBack = mCmdMap.remove( speakText );
|
||||
IMogoVoiceCmdCallBack cmdCallBack = mVoiceMap.remove( speakText );
|
||||
if ( cmdCallBack != null ) {
|
||||
cmdCallBack.onCmdCancel( speakText );
|
||||
}
|
||||
@@ -67,7 +78,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
|
||||
@Override
|
||||
public void onSpeakEnd( String speakText ) {
|
||||
IMogoVoiceCmdCallBack callBack = mCmdMap.remove( speakText );
|
||||
IMogoVoiceCmdCallBack callBack = mVoiceMap.remove( speakText );
|
||||
if ( callBack != null ) {
|
||||
callBack.onSpeakEnd( speakText );
|
||||
}
|
||||
@@ -75,7 +86,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
|
||||
@Override
|
||||
public void onSpeakSelectTimeOut( String speakText ) {
|
||||
IMogoVoiceCmdCallBack callBack = mCmdMap.remove( speakText );
|
||||
IMogoVoiceCmdCallBack callBack = mVoiceMap.remove( speakText );
|
||||
if ( callBack != null ) {
|
||||
callBack.onSpeakSelectTimeOut( speakText );
|
||||
}
|
||||
@@ -88,7 +99,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
*/
|
||||
public void speakTTSVoice( String text, IMogoVoiceCmdCallBack callBack ) {
|
||||
try {
|
||||
mCmdMap.put( text, callBack );
|
||||
mVoiceMap.put( text, callBack );
|
||||
mVoiceClient.speakDefault( text );
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
@@ -103,7 +114,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
*/
|
||||
public void speakTTSVoice( String text, VoicePreemptType type, IMogoVoiceCmdCallBack callBack ) {
|
||||
try {
|
||||
mCmdMap.put( text, callBack );
|
||||
mVoiceMap.put( text, callBack );
|
||||
mVoiceClient.speakTypeText( text, type.getPreemptType() );
|
||||
} catch ( Exception e ) {
|
||||
}
|
||||
@@ -115,7 +126,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
* @param tts 播报内容
|
||||
*/
|
||||
public void speakQAndACmd( String tts, IMogoVoiceCmdCallBack callBack ) {
|
||||
mCmdMap.put( tts, callBack );
|
||||
mVoiceMap.put( tts, callBack );
|
||||
mVoiceClient.speakTtsAndRegistCmd( tts );
|
||||
}
|
||||
|
||||
@@ -127,7 +138,7 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
* @param cancelCmds 取消命令唤醒词
|
||||
*/
|
||||
public void speakQAndACmd( String tts, String[] okCmds, String[] cancelCmds, IMogoVoiceCmdCallBack callBack ) {
|
||||
mCmdMap.put( tts, callBack );
|
||||
mVoiceMap.put( tts, callBack );
|
||||
mVoiceClient.speakTtsAndRegistCmd( tts, okCmds, cancelCmds );
|
||||
}
|
||||
|
||||
@@ -139,17 +150,56 @@ public class AIAssist implements VoiceClient.VoiceCmdCallBack {
|
||||
* @param callBack
|
||||
*/
|
||||
public void registerUnWakeupCommand( String cmd, String[] cmdWords, IMogoVoiceCmdCallBack callBack ) {
|
||||
mCmdMap.put( cmd, callBack );
|
||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
||||
mCmdMap.put( cmd, new ArrayList< IMogoVoiceCmdCallBack >() );
|
||||
}
|
||||
mCmdMap.get( cmd ).add( callBack );
|
||||
mVoiceClient.registerCustomWakeupCmd( cmd, cmdWords );
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册免唤醒命令
|
||||
*
|
||||
* @param cmd
|
||||
* @param cmdWords
|
||||
*/
|
||||
public void registerUnWakeupCommand( String cmd, String[] cmdWords ) {
|
||||
mVoiceClient.registerCustomWakeupCmd( cmd, cmdWords );
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册免唤醒命令回调
|
||||
*
|
||||
* @param cmd
|
||||
* @param callBack
|
||||
*/
|
||||
public synchronized void registerUnWakeupCommandCallback( String cmd, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
||||
mCmdMap.put( cmd, new ArrayList< IMogoVoiceCmdCallBack >() );
|
||||
}
|
||||
mCmdMap.get( cmd ).add( callBack );
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销免唤醒命令
|
||||
*
|
||||
* @param cmd
|
||||
*/
|
||||
public void unregisterUnWakeupCommand( String cmd ) {
|
||||
public synchronized void unregisterUnWakeupCommand( String cmd ) {
|
||||
mCmdMap.remove( cmd );
|
||||
mVoiceClient.unRegisterCustomWakeupCmd( cmd );
|
||||
}
|
||||
|
||||
/**
|
||||
* 注销免唤醒命令
|
||||
*
|
||||
* @param cmd
|
||||
*/
|
||||
public synchronized void unregisterUnWakeupCommand( String cmd, IMogoVoiceCmdCallBack callBack ) {
|
||||
if ( !mCmdMap.containsKey( cmd ) ) {
|
||||
return;
|
||||
}
|
||||
List< IMogoVoiceCmdCallBack > callBacks = mCmdMap.get( cmd );
|
||||
callBacks.remove( callBack );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.mogo.map.impl.amap.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.amap.api.navi.model.RouteOverlayOptions;
|
||||
import com.mogo.map.impl.amap.R;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -36,7 +40,7 @@ public class MapStyleUtils {
|
||||
public static RouteOverlayOptions getRouteOverlayOptions() {
|
||||
RouteOverlayOptions options = new RouteOverlayOptions();
|
||||
// 设置导航线路的宽度
|
||||
options.setLineWidth( 32 );
|
||||
options.setLineWidth( 16 );
|
||||
// 设置交通状况情况良好下的纹理位图
|
||||
options.setSmoothTraffic( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) );
|
||||
// 设置路线的图标
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.mogo.service.module.IMogoModuleProvider;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AppNavigatorFragment extends MvpFragment< IView, Presenter< IView > > implements IView {
|
||||
public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavigatorPresenter > implements AppNavigatorView {
|
||||
|
||||
private View mNavigation;
|
||||
private View mMediaCenter;
|
||||
@@ -62,16 +62,14 @@ public class AppNavigatorFragment extends MvpFragment< IView, Presenter< IView >
|
||||
mCarSettings.setOnClickListener( view -> {
|
||||
} );
|
||||
mApps.setOnClickListener( view -> {
|
||||
mAppsFragment = new AppsFragment();
|
||||
mMogoFragmentManager.push( new FragmentDescriptor.Builder().fragment( mAppsFragment ).tag( "apps" ).notifyMainModule( false ).build() );
|
||||
openAppsPanel();
|
||||
} );
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected Presenter< IView > createPresenter() {
|
||||
return new Presenter< IView >( this ) {
|
||||
};
|
||||
protected AppNavigatorPresenter createPresenter() {
|
||||
return new AppNavigatorPresenter( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,4 +77,17 @@ public class AppNavigatorFragment extends MvpFragment< IView, Presenter< IView >
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation( getContext() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openAppsPanel() {
|
||||
mAppsFragment = new AppsFragment();
|
||||
mMogoFragmentManager.push( new FragmentDescriptor.Builder().hasTransition( true ).fragment( mAppsFragment ).tag( "apps" ).notifyMainModule( false ).build() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeAppsPanel() {
|
||||
if ( getActivity() != null ) {
|
||||
getActivity().onBackPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.mogo.module.apps;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-12
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AppNavigatorPresenter extends Presenter< AppNavigatorView > implements IMogoVoiceCmdCallBack {
|
||||
|
||||
public AppNavigatorPresenter( AppNavigatorView view ) {
|
||||
super( view );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL, AppsConst.CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL, AppsConst.CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
if ( mView == null ) {
|
||||
return;
|
||||
}
|
||||
switch ( cmd ) {
|
||||
case AppsConst.CMD_OPEN_APPS_PANEL:
|
||||
mView.openAppsPanel();
|
||||
break;
|
||||
case AppsConst.CMD_CLOSE_APPS_PANEL:
|
||||
mView.closeAppsPanel();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdAction( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdCancel( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeakEnd( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpeakSelectTimeOut( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
super.onDestroy( owner );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.mogo.module.apps;
|
||||
|
||||
|
||||
import com.mogo.commons.mvp.IView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-12
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface AppNavigatorView extends IView {
|
||||
|
||||
/**
|
||||
* 打开全部应用
|
||||
*/
|
||||
void openAppsPanel();
|
||||
|
||||
/**
|
||||
* 关闭全部应用
|
||||
*/
|
||||
void closeAppsPanel();
|
||||
}
|
||||
@@ -8,5 +8,14 @@ package com.mogo.module.apps;
|
||||
*/
|
||||
public class AppsConst {
|
||||
|
||||
/**
|
||||
* 每页显示多少个app
|
||||
*/
|
||||
public static final int TOTAL_SIZE_EACH_PAGE = 12;
|
||||
|
||||
public static final String CMD_OPEN_APPS_PANEL = "CMD_OPEN_APPS_PANEL";
|
||||
public static final String[] CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS = {"第一个"};
|
||||
|
||||
public static final String CMD_CLOSE_APPS_PANEL = "CMD_CLOSE_APPS_PANEL";
|
||||
public static final String[] CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS = {"第二个"};
|
||||
}
|
||||
|
||||
@@ -2,12 +2,16 @@ package com.mogo.module.apps;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.view.LinePageIndicator;
|
||||
@@ -28,7 +32,7 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
|
||||
|
||||
public static final String TAG = "AppsFragment";
|
||||
|
||||
// private BottomSheetBehavior mBottomSheetBehavior;
|
||||
private BottomSheetBehavior mBottomSheetBehavior;
|
||||
private ViewPager mAppsPager;
|
||||
private AppsPagerAdapter mAppsPagerAdapter;
|
||||
|
||||
@@ -48,24 +52,28 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
|
||||
mAppsPager = findViewById( R.id.module_apps_id_apps_pager );
|
||||
mExit = findViewById( R.id.module_apps_id_apps_exit );
|
||||
mExit.setOnClickListener( view -> {
|
||||
mMogoFragmentManager.pop();
|
||||
if ( getActivity() != null ) {
|
||||
getActivity().onBackPressed();
|
||||
}
|
||||
} );
|
||||
// mAppsList = findViewById( R.id.module_apps_id_apps );
|
||||
// mAppsList.setLayoutManager( new GridLayoutManager( getContext(), 8 ) );
|
||||
// mBottomSheetBehavior = BottomSheetBehavior.from( mAppsList );
|
||||
// mBottomSheetBehavior.setSkipCollapsed( true );
|
||||
// mBottomSheetBehavior.setBottomSheetCallback( new BottomSheetBehavior.BottomSheetCallback() {
|
||||
// @Override
|
||||
// public void onStateChanged( @NonNull View bottomSheet, int newState ) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSlide( @NonNull View bottomSheet, float slideOffset ) {
|
||||
//
|
||||
// }
|
||||
// } );
|
||||
// mBottomSheetBehavior.setState( BottomSheetBehavior.STATE_COLLAPSED );
|
||||
mBottomSheetBehavior = BottomSheetBehavior.from( findViewById( R.id.module_apps_id_apps_container ) );
|
||||
mBottomSheetBehavior.setSkipCollapsed( true );
|
||||
mBottomSheetBehavior.setBottomSheetCallback( new BottomSheetBehavior.BottomSheetCallback() {
|
||||
@Override
|
||||
public void onStateChanged( @NonNull View bottomSheet, int newState ) {
|
||||
if ( newState == BottomSheetBehavior.STATE_COLLAPSED ) {
|
||||
mMogoFragmentManager.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlide( @NonNull View bottomSheet, float slideOffset ) {
|
||||
|
||||
}
|
||||
} );
|
||||
mBottomSheetBehavior.setState( BottomSheetBehavior.STATE_EXPANDED );
|
||||
mLoadingView = findViewById( R.id.module_apps_id_loading );
|
||||
mLoadingView.setVisibility( View.VISIBLE );
|
||||
mIndicator = findViewById( R.id.module_apps_id_indicator );
|
||||
@@ -100,6 +108,34 @@ public class AppsFragment extends MvpFragment< AppsView, AppsPresenter > impleme
|
||||
mLoadingView.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Animation onCreateAnimation( int transit, boolean enter, int nextAnim ) {
|
||||
TranslateAnimation animation = null;
|
||||
if ( transit == FragmentTransaction.TRANSIT_FRAGMENT_OPEN ) {
|
||||
if ( enter ) {
|
||||
animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
|
||||
Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 0 );
|
||||
} else {
|
||||
animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, -1,
|
||||
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0 );
|
||||
}
|
||||
} else if ( FragmentTransaction.TRANSIT_FRAGMENT_CLOSE == transit ) {
|
||||
if ( enter ) {
|
||||
animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, -1, Animation.RELATIVE_TO_SELF, 0,
|
||||
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0 );
|
||||
} else {
|
||||
animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1,
|
||||
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0 );
|
||||
}
|
||||
}
|
||||
if ( animation == null ) {
|
||||
animation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
|
||||
Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1 );
|
||||
}
|
||||
animation.setDuration( 300 );
|
||||
return animation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
|
||||
BIN
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_apps.png
Executable file
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
BIN
modules/mogo-module-apps/src/main/res/drawable-ldpi/module_apps_ic_retract.png
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
@@ -12,40 +12,50 @@
|
||||
<!-- app:layout_behavior="@string/bottom_sheet_behavior" />-->
|
||||
<!--</androidx.coordinatorlayout.widget.CoordinatorLayout>-->
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#0C0C0C">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_apps_id_apps_exit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/module_apps_ic_retract" />
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/module_apps_id_apps_pager"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_marginTop="@dimen/dp_210" />
|
||||
android:background="#0C0C0C"
|
||||
app:behavior_hideable="false"
|
||||
android:id="@+id/module_apps_id_apps_container"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior="@string/bottom_sheet_behavior">
|
||||
|
||||
<com.mogo.module.apps.view.LinePageIndicator
|
||||
android:id="@+id/module_apps_id_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
app:lineWidth="@dimen/dp_30"
|
||||
app:selectedColor="#ffffffff"
|
||||
app:strokeWidth="@dimen/dp_5"
|
||||
app:unselectedColor="#33ffffff" />
|
||||
<ImageView
|
||||
android:id="@+id/module_apps_id_apps_exit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/module_apps_ic_retract" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/module_apps_id_loading"
|
||||
android:layout_width="@dimen/dp_75"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_gravity="center" />
|
||||
</FrameLayout>
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/module_apps_id_apps_pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_210"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<com.mogo.module.apps.view.LinePageIndicator
|
||||
android:id="@+id/module_apps_id_indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_2"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_marginBottom="@dimen/dp_100"
|
||||
app:lineWidth="@dimen/dp_30"
|
||||
app:selectedColor="#ffffffff"
|
||||
app:strokeWidth="@dimen/dp_5"
|
||||
app:unselectedColor="#33ffffff" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/module_apps_id_loading"
|
||||
android:layout_width="@dimen/dp_75"
|
||||
android:layout_height="@dimen/dp_75"
|
||||
android:layout_gravity="center" />
|
||||
</FrameLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@@ -91,7 +91,7 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
|
||||
return;
|
||||
}
|
||||
//绘制透明色
|
||||
mCanvas.drawColor( Color.TRANSPARENT, PorterDuff.Mode.CLEAR );
|
||||
mCanvas.drawColor( Color.parseColor( "#0C0C0C" ) );
|
||||
Bitmap mBitmap = BitmapFactory.decodeResource( getResources(), mFrames[mCurrentPos % mFrames.length] );
|
||||
|
||||
Paint paint = new Paint();
|
||||
@@ -112,7 +112,6 @@ public class JSurfaceView extends SurfaceView implements Runnable, SurfaceHolder
|
||||
|
||||
@Override
|
||||
public void surfaceCreated( SurfaceHolder holder ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -107,14 +107,12 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mCompany = findViewById( R.id.module_entrance_id_company );
|
||||
mCompany.setOnClickListener( view -> {
|
||||
mMogoAddressManager.goCompany();
|
||||
//mMogoMarkerManager.addMarker( "tag", new MogoMarkerOptions().owner( "tag" )
|
||||
// .latitude( 39.000 ).longitude( 136.000 ).icon( BitmapFactory.decodeResource( getResources(), R.drawable.module_ext_ic_voice ) ).anchor( 0.5f, 0.5f ) );
|
||||
} );
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
ShareControl shareControl = new ShareControl();
|
||||
shareControl.showDialog(getActivity());
|
||||
shareControl.showDialog( getActivity() );
|
||||
} );
|
||||
|
||||
mVRMode = findViewById( R.id.module_entrance_id_vr_mode );
|
||||
|
||||
|
After Width: | Height: | Size: 834 B |
|
After Width: | Height: | Size: 403 B |
BIN
modules/mogo-module-extensions/src/main/res/drawable-ldpi/module_map_ic_home.png
Executable file
|
After Width: | Height: | Size: 402 B |
|
After Width: | Height: | Size: 657 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.4 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 988 B After Width: | Height: | Size: 988 B |
|
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 551 B |
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 934 B After Width: | Height: | Size: 934 B |
|
Before Width: | Height: | Size: 801 B After Width: | Height: | Size: 801 B |
|
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
|
Before Width: | Height: | Size: 631 B After Width: | Height: | Size: 631 B |
|
Before Width: | Height: | Size: 929 B After Width: | Height: | Size: 929 B |