@Override @CallSuper public void unbind() { ListRoomsActivity target = this.target; if (target == null) throw new IllegalStateException("Bindings already cleared."); this.target = null; target.recyclerView = null; target.txtCurrentRooms = null; target.viewLoading = null; target.txtNoRoom = null; view2131689610.setOnClickListener(null); view2131689610 = null; view2131689612.setOnClickListener(null); view2131689612 = null; }
@Override @CallSuper public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View contentView = inflater.inflate(R.layout.list, container, false); list = (BriarRecyclerView) contentView.findViewById(R.id.list); list.setLayoutManager(new LinearLayoutManager(getActivity())); list.setEmptyText(getString(R.string.no_contacts_selector)); adapter = getAdapter(getContext(), this); list.setAdapter(adapter); // restore selected contacts if available if (savedInstanceState != null) { ArrayList<Integer> intContacts = savedInstanceState.getIntegerArrayList(CONTACTS); if (intContacts != null) { selectedContacts = getContactsFromIntegers(intContacts); } } return contentView; }
@CallSuper protected void onImageMatrixUpdated(Matrix imageMatrix) { float angle = getImageAngle(); if (angle != imageAngle) { imageAngle = angle; onImageRotate(angle); } float scaleX = getImageScaleX(); float scaleY = getImageScaleY(); if (imageScaleX != scaleX || imageScaleY != scaleY) { imageScaleX = scaleX; imageScaleY = scaleY; onImageScale(scaleX, scaleY); } float transX = getImageTranslateX(); float transY = getImageTranslateY(); if (imageTranslateX != transX || imageTranslateY != transY) { imageTranslateX = transX; imageTranslateY = transY; onImageTranslate(transX, transY); } }
@CallSuper public void bind(final I item, final ThreadItemListener<I> listener) { textView.setText(StringUtils.trim(item.getText())); author.setAuthor(item.getAuthor()); author.setDate(item.getTimestamp()); author.setAuthorStatus(item.getStatus()); if (item.isHighlighted()) { layout.setActivated(true); } else if (!item.isRead()) { layout.setActivated(true); animateFadeOut(); listener.onUnreadItemVisible(item); } else { layout.setActivated(false); } }
@CallSuper @Override public void runOnUiThreadUnlessDestroyed(final Runnable r) { final Activity activity = getActivity(); if (activity != null) { activity.runOnUiThread(new Runnable() { @Override public void run() { // Note that we don't have to check if the activity has // been destroyed as the Fragment has not been detached yet if (!isDetached() && !activity.isFinishing()) { r.run(); } } }); } }
@SuppressWarnings("CheckNullabilityTypes") @Initializer @CallSuper @Override protected void onCreate(@Nullable android.os.Bundle savedInstanceState) { super.onCreate(savedInstanceState); ViewGroup rootViewGroup = ((ViewGroup) findViewById(android.R.id.content)); lifecycleRelay.accept(ActivityLifecycleEvent.createOnCreateEvent(savedInstanceState)); router = createRouter(rootViewGroup); Bundle wrappedBundle = null; if (savedInstanceState != null) { wrappedBundle = new Bundle(savedInstanceState); } router.dispatchAttach(wrappedBundle); rootViewGroup.addView(router.getView()); }
/** * called on bind item data. * * @param position the position (reject headers and footers) * @param supplier the supplier, which is used to data-binding. this is from * {@linkplain DataBindingRecyclerAdapter#onCreateParameterSupplier()}. * @see DataBinding * @see DataBinding#bind(Object, int, DataBinding.ParameterSupplier, PropertyInterceptor) */ @CallSuper protected void onBindData(int position, @Nullable DataBinding.SimpleParameterSupplier supplier) { DataBindingRecyclerAdapter<T> adapter = getAdapter(); if (adapter == null) { return; } Binder<T> binder = adapter.mBinderMap.get(position); if (binder != null) { if(DEBUG) { Logger.i(TAG, "onBindData", "unbindAll() >>> pos = " + position); } binder.unbindAll(); } adapter.mBinderMap.put(position, mDataBinding.bindAndApply( adapter.getItem(position), 0, supplier, getPropertyInterceptor())); }
@CallSuper @Override public void onCacheResponse(K k, boolean isDone) { if (isCanceled()) { EventBus.getDefault().post(new EventRequestCanceled(this)); LogUtils.d("请求被取消:" + mDataType); return; } mResult = k; setDone(isDone); //通知ui缓存数据返回 EventBus.getDefault().post(new EventResponse(this, DataFrom.CACHE)); LogUtils.d("请求:"); LogUtils.d(mResult); }
@Override @CallSuper protected void onResume() { super.onResume(); lifecycleRelay.accept(ActivityLifecycleEvent.create(ActivityLifecycleEvent.Type.RESUME)); }
@CallSuper @Override public void eventOccurred(Event e) { if (e instanceof GroupRemovedEvent) { GroupRemovedEvent s = (GroupRemovedEvent) e; if (s.getGroup().getId().equals(getGroupId())) { LOG.info("Group removed"); listener.runOnUiThreadUnlessDestroyed(new Runnable() { @Override public void run() { listener.onGroupRemoved(); } }); } } }
@CallSuper @Override public void onResponse(Request<T> request, T response) { if (response == null) { Toast.makeText(_context, "Error executing " + request.getClass().getSimpleName() + ": Empty response returned", Toast.LENGTH_LONG).show(); } else if (!response.success()) { Toast.makeText(_context, "Error executing " + request.getClass().getSimpleName() + ": " + response.message(), Toast.LENGTH_LONG).show(); } }
@Override @CallSuper public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ComponentCache componentCache = getComponentCache(); componentDelegate.onCreate(componentCache, savedInstanceState, componentFactory); }
@CallSuper @Override public void onPresenterDestroy() { if (stateBundle != null && !stateBundle.isEmpty()) { stateBundle.clear(); } }
@Override @CallSuper public void onRenderSuccess(WXSDKInstance instance, int width, int height) { if(mWxAnalyzerDelegate != null){ mWxAnalyzerDelegate.onWeexRenderSuccess(instance); } }
@CallSuper @Override public void onStop() { mDelegate.onStop_beforeSuper(); super.onStop(); mDelegate.onStop_afterSuper(); }
@Override @CallSuper public void dismiss() { final View contentView = getContentView(); if (contentView != null && mKeyboardListener != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { contentView.getViewTreeObserver().removeOnGlobalLayoutListener(mKeyboardListener); mKeyboardListener = null; } else if (contentView != null && mKeyboardListener != null) { // noinspection deprecation contentView.getViewTreeObserver().removeGlobalOnLayoutListener(mKeyboardListener); } super.dismiss(); }
@CallSuper @Override public void run() { super.run(); stopGuardian(new GollumCallbackGetBoolean() { @Override public void done(boolean stopSuccess) { Log.d(TAG, "Pandwarf stopped"); toastShow("protection stopped"); cbThreadDone.done(stopSuccess); } }); }
/** * {@inheritDoc} */ @Override @CallSuper protected void onRestart() { setStopInvoked(false); setDestroyInvoked(false); super.onRestart(); }
@CallSuper public void resetListeners() { mOnPreparedListener = null; mOnBufferingUpdateListener = null; mOnCompletionListener = null; mOnSeekCompleteListener = null; mOnVideoSizeChangedListener = null; mOnErrorListener = null; mOnInfoListener = null; }
@CallSuper @Override public boolean onCreateOptionsMenu(Menu menu) { mScalpelMenu = menu.add(Menu.NONE, R.id.scalpel_menu, Menu.NONE, "Enable Scalpel"); return true; }
@CallSuper public void mkdirs() { if (!dirRoot.exists()) dirRoot.mkdirs(); if (!dirProject.exists()) dirProject.mkdirs(); if (!dirLibs.exists()) dirLibs.mkdirs(); if (!dirSrcMain.exists()) dirSrcMain.mkdirs(); if (!dirJava.exists()) dirJava.mkdirs(); if (!dirBuildClasses.exists()) dirBuildClasses.mkdirs(); if (!dirGenerated.exists()) dirGenerated.mkdirs(); if (!dirGeneratedSource.exists()) dirGeneratedSource.mkdirs(); }
/** * Show. */ @CallSuper public void show() { onShowPrepare(); popup.show(); LogUtils.debug("popup show"); }
@CallSuper @Override protected void drawableStateChanged() { super.drawableStateChanged(); final Drawable selectionDivider = mSelectionDivider; if (selectionDivider != null && selectionDivider.isStateful() && selectionDivider.setState(getDrawableState())) { invalidateDrawable(selectionDivider); } }
@CallSuper protected void loadViews() { try { YumLoader.parse(this); } catch (YumLoader.ParsingException ignored) {} }
@CallSuper @Override public void onAttach(@NonNull IView view) { try { mView = (T) view; } catch (ClassCastException e) { mView = null; } }
@CallSuper @Override public void release() { mOnUIViewListener = null; //mActivity = null; mChildILayout = null; //mParentILayout = null; //mILayout = null; mILifecycleList.clear(); }
/** * Every item in the group still exists but the data in each has changed (e.g. should rebind). * * @param group */ @CallSuper @Override public void onChanged(Group group) { if (parentDataObserver != null) { parentDataObserver.onItemRangeChanged(this, getItemCountBeforeGroup(group), group.getItemCount()); } }
/** * {@inheritDoc} */ @Override @CallSuper protected void onCreate(@Nullable final Bundle savedInstanceState) { super.onCreate(savedInstanceState); AnnotationParser.parseType(this, this); if (getLayoutId() > 0) { setContentView(getLayoutId()); } }
@Override @CallSuper public void onItemRangeRemoved(int positionStart, int itemCount) { super.onItemRangeRemoved(positionStart, itemCount); /** we detected removing event, so should process measuring manually * @see <a href="http://stackoverflow.com/questions/40242011/custom-recyclerviews-layoutmanager-automeasuring-after-animation-finished-on-i">Stack Overflow issue</a> */ isAfterRemoving = true; beforeRemovingWidth = autoMeasureWidth; beforeRemovingHeight = autoMeasureHeight; }
@Override @CallSuper protected void onStart() { super.onStart(); final View contentView = getContentView(); if (contentView != null && mKeyboardListener != null) { contentView.getViewTreeObserver().addOnGlobalLayoutListener(mKeyboardListener); } }
/** * {@inheritDoc} * With FlexibleAdapter v5.0.0 the default mode is {@link SelectableAdapter#MODE_IDLE}, if * you want single selection enabled change default mode with {@link #withDefaultMode(int)}. */ @CallSuper @Override public void onDestroyActionMode(ActionMode actionMode) { if (SelectableAdapter.DEBUG) Log.i(TAG, "ActionMode is about to be destroyed! New mode will be " + defaultMode); // Change mode and deselect everything mAdapter.setMode(defaultMode); mAdapter.clearSelection(); mActionMode = null; // Notify the provided callback if (mCallback != null) { mCallback.onDestroyActionMode(actionMode); } }
/** * Initializes the listener(s) of this Adapter. * <p>This method is automatically called from the Constructor.</p> * * @param listener the object(s) instance(s) of any listener * @return this Adapter, so the call can be chained * @since 5.0.0-b6 */ @CallSuper public FlexibleAdapter<T> addListener(@Nullable Object listener) { if (DEBUG && listener != null) { Log.i(TAG, "Adding listener class " + getClassName(listener) + " as:"); } if (listener instanceof OnItemClickListener) { if (DEBUG) Log.i(TAG, "- OnItemClickListener"); mItemClickListener = (OnItemClickListener) listener; } if (listener instanceof OnItemLongClickListener) { if (DEBUG) Log.i(TAG, "- OnItemLongClickListener"); mItemLongClickListener = (OnItemLongClickListener) listener; } if (listener instanceof OnItemMoveListener) { if (DEBUG) Log.i(TAG, "- OnItemMoveListener"); mItemMoveListener = (OnItemMoveListener) listener; } if (listener instanceof OnItemSwipeListener) { if (DEBUG) Log.i(TAG, "- OnItemSwipeListener"); mItemSwipeListener = (OnItemSwipeListener) listener; } if (listener instanceof OnStickyHeaderChangeListener) { if (DEBUG) Log.i(TAG, "- OnStickyHeaderChangeListener"); mStickyHeaderChangeListener = (OnStickyHeaderChangeListener) listener; } if (listener instanceof OnUpdateListener) { if (DEBUG) Log.i(TAG, "- OnUpdateListener"); mUpdateListener = (OnUpdateListener) listener; mUpdateListener.onUpdateEmptyView(getMainItemCount()); } return this; }
/** * Implementation is provided by the parent class. Can be overridden to * provide additional functionality, but subclasses <em>must</em> always * call the superclass. If the superclass returns {@code null}, the subclass * may implement custom behavior. */ @CallSuper @Override public Bundle call(String method, String arg, Bundle extras) { if (!method.startsWith("android:")) { // Ignore non-platform methods return super.call(method, arg, extras); } try { return callUnchecked(method, arg, extras); } catch (FileNotFoundException e) { throw new IllegalStateException("Failed call " + method, e); } }
@CallSuper @Override public synchronized void destroy() { mDestroyed = true; if (mOnDestroyListener != null) { mOnDestroyListener.onDestroy(this); } }
/** * Called after execution of each test method finishes. */ @After @CallSuper public void afterTest() throws Exception { // Inheritance hierarchies may for example release here resources acquired in beforeTest() call. this.mContext = null; }
@CallSuper @Override protected void onFirstViewAttach() { super.onFirstViewAttach(); for (final PresenterExtension extension : extensions) { extension.onFirstAttach(); } }
@CallSuper public void onAnimationEnd(Animation animation) { if (this.mView != null && this.mShouldRunOnHWLayer) { this.mView.post(new Runnable() { public void run() { ViewCompat.setLayerType(AnimateOnHWLayerIfNeededListener.this.mView, 0, null); } }); } if (this.mOrignalListener != null) { this.mOrignalListener.onAnimationEnd(animation); } }
/** * {@inheritDoc} */ @CallSuper @Override protected void onDetachedFromRecyclerView(@NonNull final RecyclerView recyclerView) { recyclerView.removeOnItemTouchListener(mOnItemTouchListener); mGestureDetector = null; }
@CallSuper @Override protected void beforeActivityLaunched() { super.beforeActivityLaunched(); Context appContext = InstrumentationRegistry.getInstrumentation() .getTargetContext() .getApplicationContext(); PreferenceManager.getDefaultSharedPreferences(appContext) .edit() .putBoolean(FIRSTRUN_PREF, !showFirstRun) .apply(); }