opt
This commit is contained in:
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@@ -23,7 +23,7 @@
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-extensions" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-main" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-map" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-navi" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-search" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-service" />
|
||||
<option value="$PROJECT_DIR$/modules/mogo-module-tanlu" />
|
||||
<option value="$PROJECT_DIR$/services" />
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
|
||||
DebugConfig.setNetMode( DebugConfig.NET_MODE_QA );
|
||||
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CODITION" ) );
|
||||
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
||||
// MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, "CARD_TYPE_ROAD_ONLINECAR"));
|
||||
MogoModulePaths.addModule(new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.mogo.module.main.cards.OrientedViewPager;
|
||||
import com.mogo.module.main.cards.VerticalStackTransformer;
|
||||
import com.mogo.module.main.fragmentmanager.FragmentStack;
|
||||
import com.mogo.module.main.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
@@ -56,6 +55,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
private OrientedViewPager mCardsContainer;
|
||||
private CardModulesAdapter mCardModulesAdapter;
|
||||
|
||||
private View mHeader;
|
||||
private View mCards;
|
||||
private View mApps;
|
||||
private View mEntrance;
|
||||
|
||||
/**
|
||||
* 主模块管控定位,可以向各个模块发送统一定位信息
|
||||
*/
|
||||
@@ -90,12 +94,30 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
@Override
|
||||
public void onTransaction() {
|
||||
if ( FragmentStack.getInstance().isEmpty() ) {
|
||||
// TODO: 2020-01-08 动画
|
||||
show();
|
||||
} else if ( FragmentStack.getInstance().getStackSize() == 1 ) {
|
||||
|
||||
hide();
|
||||
}
|
||||
}
|
||||
} );
|
||||
mHeader = findViewById( R.id.module_main_id_header_fragment_container );
|
||||
mCards = findViewById( R.id.module_main_id_cards_container );
|
||||
mApps = findViewById( R.id.module_main_id_apps_fragment_container );
|
||||
mEntrance = findViewById( R.id.module_main_id_entrance_fragment_container );
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
mHeader.setVisibility( View.GONE );
|
||||
mCards.setVisibility( View.GONE );
|
||||
mApps.setVisibility( View.GONE );
|
||||
mEntrance.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
private void show() {
|
||||
mHeader.setVisibility( View.VISIBLE );
|
||||
mCards.setVisibility( View.VISIBLE );
|
||||
mApps.setVisibility( View.VISIBLE );
|
||||
mEntrance.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -130,7 +152,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
} );
|
||||
// 加载地图,触发地图加载完毕回调,在初始化其他卡片模块,保证卡片模块可以正确获取地图相关服务。
|
||||
mMogoModuleHandler.loadMap( R.id.module_main_id_map_fragment_container );
|
||||
mMogoModuleHandler.loadAppsList( R.id.module_main_id_fragment_container );
|
||||
mMogoModuleHandler.loadAppsList( R.id.module_main_id_apps_fragment_container );
|
||||
mMogoModuleHandler.loadExtensions( R.id.module_main_id_header_fragment_container );
|
||||
mMogoModuleHandler.loadEntrances( R.id.module_main_id_entrance_fragment_container );
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ public class CardModulesAdapter extends FragmentStatePagerAdapter {
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem( int position ) {
|
||||
Logger.i( TAG, "current position: %d", position );
|
||||
int factPosition = getFactPosition( position );
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt( "position", factPosition );
|
||||
Logger.d( TAG, "here" );
|
||||
final Fragment f = mProviders.get( factPosition ).createFragment( mActivity, bundle );
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class FragmentStack {
|
||||
if ( mCurrentFragment != null ) {
|
||||
mFragmentTransaction.hide( mCurrentFragment );
|
||||
}
|
||||
mFragmentTransaction.add( mContainerId, fragment, tag );
|
||||
mFragmentTransaction.add( mContainerId, fragment );
|
||||
mFragmentTransaction.addToBackStack( null );
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
mFragmentStack.push( fragment );
|
||||
@@ -95,6 +95,9 @@ public class FragmentStack {
|
||||
if ( mFragmentStack.isEmpty() ) {
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
mCurrentFragment = null;
|
||||
if ( getFragmentStackTransactionListener() != null ) {
|
||||
getFragmentStackTransactionListener().onTransaction();
|
||||
}
|
||||
return;
|
||||
}
|
||||
Fragment fragment = mFragmentStack.peek();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
android:id="@+id/module_main_id_map_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_main_id_fragment_container"
|
||||
app:layout_constraintLeft_toRightOf="@+id/module_main_id_apps_fragment_container"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -30,14 +30,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="@dimen/dp_10">
|
||||
<!-- 卡片 & 应用入口-->
|
||||
<!-- 卡片-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_fragment_container"
|
||||
android:layout_width="@dimen/dp_660"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp_70"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
android:layout_marginLeft="@dimen/dp_70">
|
||||
|
||||
<com.mogo.module.main.cards.OrientedViewPager
|
||||
android:id="@+id/module_main_id_cards_container"
|
||||
@@ -46,6 +43,15 @@
|
||||
android:layout_marginBottom="@dimen/dp_211"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="@dimen/dp_20" />
|
||||
<!-- 应用入口-->
|
||||
<FrameLayout
|
||||
android:id="@+id/module_main_id_apps_fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<!--快捷操作浮层-->
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.mogo.module.navi;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user