opt
This commit is contained in:
@@ -88,7 +88,7 @@ public class FragmentStack {
|
||||
|
||||
if ( descriptor.isNotifyMainModule() ) {
|
||||
if ( mFragmentStackTransactionListener != null ) {
|
||||
mFragmentStackTransactionListener.onTransaction(getStackSize());
|
||||
mFragmentStackTransactionListener.onTransaction( getStackSize() );
|
||||
}
|
||||
}
|
||||
invokeCallback();
|
||||
@@ -96,6 +96,7 @@ public class FragmentStack {
|
||||
|
||||
public void pop() {
|
||||
if ( mFragmentStack.isEmpty() ) {
|
||||
invokeCallback();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,7 +110,7 @@ public class FragmentStack {
|
||||
mFragmentTransaction.commitAllowingStateLoss();
|
||||
if ( mCurrentFragment.isNotifyMainModule() ) {
|
||||
if ( mFragmentStackTransactionListener != null ) {
|
||||
mFragmentStackTransactionListener.onTransaction(getStackSize());
|
||||
mFragmentStackTransactionListener.onTransaction( getStackSize() );
|
||||
}
|
||||
}
|
||||
invokeCallback();
|
||||
@@ -124,7 +125,7 @@ public class FragmentStack {
|
||||
|
||||
if ( mCurrentFragment.isNotifyMainModule() ) {
|
||||
if ( mFragmentStackTransactionListener != null ) {
|
||||
mFragmentStackTransactionListener.onTransaction(getStackSize());
|
||||
mFragmentStackTransactionListener.onTransaction( getStackSize() );
|
||||
}
|
||||
}
|
||||
invokeCallback();
|
||||
@@ -134,7 +135,7 @@ public class FragmentStack {
|
||||
private void invokeCallback() {
|
||||
if ( mFragmentStackTransactionListeners != null ) {
|
||||
for ( FragmentStackTransactionListener fragmentStackTransactionListener : mFragmentStackTransactionListeners ) {
|
||||
fragmentStackTransactionListener.onTransaction(getStackSize());
|
||||
fragmentStackTransactionListener.onTransaction( getStackSize() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -151,12 +152,18 @@ public class FragmentStack {
|
||||
this.mFragmentStackTransactionListeners.add( fragmentStackTransactionListener );
|
||||
}
|
||||
|
||||
public void removeFragmentStackTransactionListener( FragmentStackTransactionListener fragmentStackTransactionListener ) {
|
||||
this.mFragmentStackTransactionListeners.remove( fragmentStackTransactionListener );
|
||||
}
|
||||
|
||||
public void setFragmentStackTransactionListener( FragmentStackTransactionListener fragmentStackTransactionListener ) {
|
||||
this.mFragmentStackTransactionListener = fragmentStackTransactionListener;
|
||||
}
|
||||
|
||||
public void clearAll() {
|
||||
|
||||
if ( mFragmentStack.isEmpty() ) {
|
||||
invokeCallback();
|
||||
return;
|
||||
}
|
||||
mFragmentTransaction = mFragmentManager.beginTransaction();
|
||||
@@ -167,7 +174,7 @@ public class FragmentStack {
|
||||
mFragmentStack.clear();
|
||||
mCurrentFragment = null;
|
||||
if ( mFragmentStackTransactionListener != null ) {
|
||||
mFragmentStackTransactionListener.onTransaction(getStackSize());
|
||||
mFragmentStackTransactionListener.onTransaction( getStackSize() );
|
||||
}
|
||||
invokeCallback();
|
||||
}
|
||||
|
||||
@@ -49,6 +49,11 @@ public class MogoFragmentManager implements IMogoFragmentManager {
|
||||
FragmentStack.getInstance().addFragmentStackTransactionListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeMainFragmentStackTransactionListener( FragmentStackTransactionListener listener ) {
|
||||
FragmentStack.getInstance().removeFragmentStackTransactionListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( AppCompatActivity activity, int containerId ) {
|
||||
FragmentStack.getInstance().init( activity, containerId );
|
||||
|
||||
@@ -78,8 +78,10 @@ public class IntentManager implements IMogoIntentManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterIntentListener( String command ) {
|
||||
mListeners.remove( command );
|
||||
public void unregisterIntentListener( String command, IMogoIntentListener listener ) {
|
||||
if ( mListeners.containsKey( command ) ) {
|
||||
mListeners.get( command ).remove( listener );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,8 @@ import com.mogo.service.intent.IMogoIntentManager;
|
||||
public class MogoIntentManager implements IMogoIntentManager {
|
||||
|
||||
@Override
|
||||
public void unregisterIntentListener( String command ) {
|
||||
IntentManager.getInstance().unregisterIntentListener( command );
|
||||
public void unregisterIntentListener( String command, IMogoIntentListener listener ) {
|
||||
IntentManager.getInstance().unregisterIntentListener( command, listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.mogo.service.impl.intent;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-09
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_VOICE_MANAGER )
|
||||
public class MogoVoiceManager implements IMogoVoiceManager {
|
||||
|
||||
@Override
|
||||
public void unregisterIntentListener( String command ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invoke( String command, Intent intent ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIntentListener( String intent, IMogoIntentListener listener ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user