TabFragment(@IdRes int menuId, Class<? extends Fragment> clazz) { this.menuId = menuId; this.clazz = clazz; }
/** * The method being called when currently visible {@link BottomBarTab} is * reselected. Use this method for scrolling to the top of your content, * as recommended by the Material Design spec * * @param tabId the {@link BottomBarTab} that was reselected. */ void onTabReSelected(@IdRes int tabId); }
/** * The method being called when currently visible {@link BottomBarTab} is about to change. * <p> * This listener is fired when the current {@link BottomBar} is about to change. This gives * an opportunity to interrupt the {@link BottomBarTab} change. * * @param oldTabId the currently visible {@link BottomBarTab} * @param newTabId the {@link BottomBarTab} that will be switched to * @return true if you want to override/stop the tab change, false to continue as normal */ boolean shouldInterceptTabSelection(@IdRes int oldTabId, @IdRes int newTabId); }
/** * The method being called when currently visible {@link BottomBarTab} changes. * * This listener is fired for the first time after the items have been set and * also after a configuration change, such as when screen orientation changes * from portrait to landscape. * * @param tabId the new visible {@link BottomBarTab} */ void onTabSelected(@IdRes int tabId); }
@Override public void onTabSelected(@IdRes int tabId) { } });
/** * Display the bottom sheet, adding the fragment using an excising transaction and then * committing the transaction. * * @param transaction An existing transaction in which to add the fragment. * @param bottomSheetLayoutId The bottom sheet layoutId in the parent view to attach the * fragment to. */ int show(FragmentTransaction transaction, @IdRes int bottomSheetLayoutId);
public void check(@IdRes int id) { this.checkedButtonId = id; }
/** * Display the bottom sheet, adding the fragment to the given FragmentManager. This does * <em>not</em> add the transaction to the back stack. When teh fragment is dismissed, a new * transaction will be executed to remove it from the activity. * * @param manager The FragmentManager this fragment will be added to. * @param bottomSheetLayoutId The bottom sheet layoutId in the parent view to attach the * fragment to. */ void show(FragmentManager manager, @IdRes int bottomSheetLayoutId);
/** * Find a BottomBarTab with the corresponding id. */ public BottomBarTab getTabWithId(@IdRes int tabId) { return (BottomBarTab) tabContainer.findViewById(tabId); }
/** * Override the android resource id to store temporary state allowing loads to be automatically * cancelled and resources re-used in scrolling lists. * * <p>Unlike {@link ViewTarget}, it is <b>not</b> necessary to set a custom tag id if your app * uses {@link View#setTag(Object)}. It is only necessary if loading several Glide resources into * the same view, for example one foreground and one background view. * * @param tagId The android resource id to use. */ // Public API. @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public final CustomViewTarget<T, Z> useTagId(@IdRes int tagId) { if (this.overrideTag != 0) { throw new IllegalArgumentException("You cannot change the tag id once it has been set."); } this.overrideTag = tagId; return this; }
public CommonBuilder setMainFrameErrorView(@LayoutRes int errorLayout, @IdRes int clickViewId) { this.mAgentBuilder.mErrorLayout = errorLayout; this.mAgentBuilder.mReloadId = clickViewId; return this; }
void setErrorLayoutRes(@LayoutRes int resLayout, @IdRes int id) { this.mClickId = id; if (this.mClickId <= 0) { this.mClickId = -1; } this.mErrorLayoutRes = resLayout; if (this.mErrorLayoutRes <= 0) { this.mErrorLayoutRes = R.layout.agentweb_error_page; } }
/** * 查找View * * @param id 控件的id * @param <VT> View类型 * @return */ protected <VT extends View> VT getViewById(@IdRes int id) { return (VT) mContentView.findViewById(id); }
@SuppressWarnings("unchecked") public <T extends View> T $(@IdRes int id) { return (T) parentView.findViewById(id); } }
@Override public void onTabSelected(@IdRes int tabId) { messageView.setText(TabMessage.get(tabId, false)); } });
@Override public void onTabSelected(@IdRes int tabId) { messageView.setText(TabMessage.get(tabId, false)); } });
@Override public void onTabSelected(@IdRes int tabId) { messageView.setText(TabMessage.get(tabId, false)); } });
@Override public void onTabSelected(@IdRes int tabId) { messageView.setText(TabMessage.get(tabId, false)); } });
@Override public void onTabSelected(@IdRes int tabId) { messageView.setText(TabMessage.get(tabId, false)); } });
/** * 查找View * * @param id 控件的id * @param <VT> View类型 */ protected <VT extends View> VT getViewById(@IdRes int id) { return (VT) findViewById(id); }