bug fix
This commit is contained in:
@@ -662,4 +662,18 @@ public class TopViewAnimHelper {
|
||||
tvTurnInfo.setVisibility(visibility);
|
||||
|
||||
}
|
||||
|
||||
public void removeAllView(){
|
||||
isTopViewOut = true;
|
||||
int lastCount = topContainer.getChildCount();
|
||||
for (int i = 0; i < lastCount; i++) {
|
||||
View child = topContainer.getChildAt(i);
|
||||
viewCaches.remove(child);
|
||||
IMogoTopViewStatusListener listener = statusListenerMap.remove(child);
|
||||
if (listener != null) {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainer.removeAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,12 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.windowview.IMogoTopViewManager;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
|
||||
@@ -21,10 +25,18 @@ public class TopViewManager implements IMogoTopViewManager {
|
||||
|
||||
private Context context;
|
||||
private LayoutParams parentParams;
|
||||
private IMogoServiceApis serviceApis;
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
this.context = context;
|
||||
serviceApis =
|
||||
(IMogoServiceApis) ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS).navigation(context);
|
||||
serviceApis.getStatusManagerApi().registerStatusChangedListener(MogoServicePaths.PATH_EXTENSIONS_TOP_VIEW_MANAGER, StatusDescriptor.MAIN_PAGE_RESUME, (descriptor, isTrue) -> {
|
||||
if (!isTrue) {
|
||||
TopViewAnimHelper.getInstance().removeAllView();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user