Merge remote-tracking branch 'origin/feature/v1.0.0' into feature/v1.0.0

This commit is contained in:
zhangyuanzhen
2020-01-12 15:35:39 +08:00
115 changed files with 354 additions and 143 deletions

View File

@@ -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();
}
}
}

View File

@@ -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 );
}
}

View File

@@ -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();
}

View File

@@ -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 = {"第二个"};
}

View File

@@ -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();

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -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>

View File

@@ -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

View File

@@ -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 );

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More