public ListRecyclerViewAdapter(Context context) { mContext = context; mInflater = AppUtils.createLayoutInflater(mContext); ((Injectable) mContext).inject(this); mMultiPaneListener = (MultiPaneListener) mContext; mMultiWindowEnabled = Preferences.multiWindowEnabled(mContext); }
@Override protected void onStart() { super.onStart(); mCustomTabsDelegate.bindCustomTabsService(this); mKeyDelegate.attach(this); }
@Override protected void onStop() { super.onStop(); mCustomTabsDelegate.unbindCustomTabsService(this); mKeyDelegate.detach(this); }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { mKeyDelegate.setScrollable(getScrollableList(), mAppBar); mKeyDelegate.setBackInterceptor(getBackInterceptor()); return mKeyDelegate.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event); }
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { mKeyDelegate.setScrollable(getCurrent(Scrollable.class), mAppBar); mKeyDelegate.setBackInterceptor(getCurrent(KeyDelegate.BackInterceptor.class)); return mKeyDelegate.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event); }
private void confirmLogout() { mAlertDialogBuilder.init(this) .setMessage(R.string.logout_confirm) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(android.R.string.ok, (dialog, which) -> Preferences.setUsername(this, null)) .show(); }
@Override protected void onStart() { super.onStart(); mCustomTabsDelegate.bindCustomTabsService(this); mKeyDelegate.attach(this); }
@Override protected void onStop() { super.onStop(); mCustomTabsDelegate.unbindCustomTabsService(this); mKeyDelegate.detach(this); }
@Override public ObjectGraph getApplicationGraph() { if (mActivityGraph == null) { mActivityGraph = ((Injectable) getApplication()).getApplicationGraph() .plus(new ActivityModule(this), new UiModule()); } return mActivityGraph; }
@Override public void onDetach() { super.onDetach(); mPreferenceObservable.unsubscribe(getActivity()); }
@Override public void onDetach() { mPreferenceObservable.unsubscribe(getActivity()); mRefreshCallback = null; super.onDetach(); }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mActivityCreated = true; if (isNewInstance()) { eagerLoad(); } }
@Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { return mKeyDelegate.onKeyLongPress(keyCode, event) || super.onKeyLongPress(keyCode, event); }
@Override public void onBackPressed() { // TODO http://b.android.com/176265 try { super.onBackPressed(); } catch (IllegalStateException e) { supportFinishAfterTransition(); } }
@Override public void onAttach(Context context) { super.onAttach(context); if (context instanceof RefreshCallback) { mRefreshCallback = (RefreshCallback) context; } mPreferenceObservable.subscribe(context, this::onPreferenceChanged, R.string.pref_highlight_updated, R.string.pref_username, R.string.pref_auto_viewed); } @Override