1. v2x调用隐藏逻辑
2. 优化
This commit is contained in:
@@ -30,14 +30,11 @@ class OnlineCarListPanelProvider implements IMogoOnlineCarListPanelProvider {
|
||||
|
||||
@Override
|
||||
public void showPanel() {
|
||||
Fragment fragment = null;
|
||||
if ( ( fragment = isFragmentAdded( ContainerHandler.sAttachContext ) ) != null ) {
|
||||
if ( fragment instanceof OnlineCarPanelFragment ) {
|
||||
( ( OnlineCarPanelFragment ) fragment ).refreshPanel();
|
||||
}
|
||||
if ( ContainerHandler.sAttachContext == null ) {
|
||||
return;
|
||||
}
|
||||
fragment = new OnlineCarPanelFragment();
|
||||
Fragment fragment = new OnlineCarPanelFragment();
|
||||
Logger.d( TAG, "showPanel" );
|
||||
ContainerHandler.sAttachContext
|
||||
.getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
@@ -45,20 +42,12 @@ class OnlineCarListPanelProvider implements IMogoOnlineCarListPanelProvider {
|
||||
.commitNowAllowingStateLoss();
|
||||
}
|
||||
|
||||
private Fragment isFragmentAdded( Context context ) {
|
||||
if ( !( context instanceof FragmentActivity ) ) {
|
||||
Logger.w( TAG, "context is not a instance of FragmentActivity" );
|
||||
return null;
|
||||
}
|
||||
Fragment fragment = null;
|
||||
return ( fragment = ( ( FragmentActivity ) context )
|
||||
.getSupportFragmentManager()
|
||||
.findFragmentByTag( TAG ) ) != null && fragment.isAdded()
|
||||
? fragment : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hidePanel() {
|
||||
if ( ContainerHandler.sAttachContext == null ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "hidePanel" );
|
||||
Fragment fragment = ContainerHandler.sAttachContext.getSupportFragmentManager().findFragmentByTag( TAG );
|
||||
if ( fragment != null ) {
|
||||
ContainerHandler.sAttachContext
|
||||
|
||||
Reference in New Issue
Block a user