private void initValue(Activity activity) { this.activity = activity; leftMenuItems = new ArrayList<ResideMenuItem>(); rightMenuItems = new ArrayList<ResideMenuItem>(); ignoredViews = new ArrayList<View>(); // viewDecor是Activity 中最顶层的View viewDecor = (ViewGroup) activity.getWindow().getDecorView(); viewActivity = new TouchDisableView(this.activity); View mContent = viewDecor.getChildAt(0); viewDecor.removeViewAt(0); viewActivity.setContent(mContent); addView(viewActivity); ViewGroup parent = (ViewGroup) scrollViewLeftMenu.getParent(); parent.removeView(scrollViewLeftMenu); parent.removeView(scrollViewRightMenu); }
private void hideScrollViewMenu(ScrollView scrollViewMenu) { if (scrollViewMenu != null && scrollViewMenu.getParent() != null) { removeView(scrollViewMenu); } }
private void showScrollViewMenu(ScrollView scrollViewMenu) { if (scrollViewMenu != null && scrollViewMenu.getParent() == null) { addView(scrollViewMenu); } }