public ColorPickerDialog(Context context, int initialColor) { super(context); context.registerComponentCallbacks(new ComponentCallbacks() { @Override public void onConfigurationChanged(Configuration newConfig) { setUp(mOldColor.getColor(), mNewColor.getColor()); setAlphaSliderVisible(mAlphaSliderEnabled); setHexValueEnabled(mHexValueEnabled); } @Override public void onLowMemory() { } }); init(initialColor); }
/** * Starts a new session for logging. * @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads. * If null, UmaSessionStats does not record page loads and tab counts. */ public void startNewSession(TabModelSelector tabModelSelector) { ensureNativeInitialized(); mTabModelSelector = tabModelSelector; if (mTabModelSelector != null) { mComponentCallbacks = new ComponentCallbacks() { @Override public void onLowMemory() { // Not required } @Override public void onConfigurationChanged(Configuration newConfig) { mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS; } }; mContext.registerComponentCallbacks(mComponentCallbacks); mKeyboardConnected = mContext.getResources().getConfiguration() .keyboard != Configuration.KEYBOARD_NOKEYS; mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) { @Override public void onPageLoadFinished(Tab tab) { recordPageLoadStats(tab); } }; } nativeUmaResumeSession(sNativeUmaSessionStats); updatePreferences(); updateMetricsServiceState(); }
/** * Starts a new session for logging. * @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads. * If null, UmaSessionStats does not record page loads and tab counts. */ public void startNewSession(TabModelSelector tabModelSelector) { ensureNativeInitialized(); mTabModelSelector = tabModelSelector; if (mTabModelSelector != null) { mComponentCallbacks = new ComponentCallbacks() { @Override public void onLowMemory() { // Not required } @Override public void onConfigurationChanged(Configuration newConfig) { mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS; } }; mContext.registerComponentCallbacks(mComponentCallbacks); mKeyboardConnected = mContext.getResources().getConfiguration() .keyboard != Configuration.KEYBOARD_NOKEYS; mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) { @Override public void onPageLoadFinished(Tab tab) { recordPageLoadStats(tab); } }; } nativeUmaResumeSession(sNativeUmaSessionStats); NetworkChangeNotifier.addConnectionTypeObserver(this); updatePreferences(); updateMetricsServiceState(); }
void registerComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall, final ComponentCallbacks callback) { synchronized (mSuperListeners) { mSuperListeners.push(superCall); registerComponentCallbacks(callback); } }
void unregisterComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall, final ComponentCallbacks callback) { synchronized (mSuperListeners) { mSuperListeners.push(superCall); unregisterComponentCallbacks(callback); } }
/** * Starts a new session for logging. * @param tabModelSelector A TabModelSelector instance for recording tab counts on page loads. * If null, UmaSessionStats does not record page loads and tab counts. */ public void startNewSession(TabModelSelector tabModelSelector) { ensureNativeInitialized(); mTabModelSelector = tabModelSelector; if (mTabModelSelector != null) { mComponentCallbacks = new ComponentCallbacks() { @Override public void onLowMemory() { // Not required } @Override public void onConfigurationChanged(Configuration newConfig) { mKeyboardConnected = newConfig.keyboard != Configuration.KEYBOARD_NOKEYS; } }; mContext.registerComponentCallbacks(mComponentCallbacks); mKeyboardConnected = mContext.getResources().getConfiguration() .keyboard != Configuration.KEYBOARD_NOKEYS; mTabModelSelectorTabObserver = new TabModelSelectorTabObserver(mTabModelSelector) { @Override public void onPageLoadFinished(Tab tab) { recordPageLoadStats(tab); } }; } nativeUmaResumeSession(sNativeUmaSessionStats); updatePreferences(); updateMetricsServiceState(); DefaultBrowserInfo.logDefaultBrowserStats(); }
private void registerListener() { ContextUtils.getApplicationContext().registerComponentCallbacks( new ComponentCallbacks() { @Override public void onConfigurationChanged(Configuration configuration) { updateNativeViewConfigurationIfNecessary(); } @Override public void onLowMemory() { } }); }
private void registerListener() { mAppContext.registerComponentCallbacks( new ComponentCallbacks() { @Override public void onConfigurationChanged(Configuration configuration) { updateNativeSharedDisplayInfo(); } @Override public void onLowMemory() { } }); }
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) { if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.registerComponentCallbacks(callback); }
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) { if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.unregisterComponentCallbacks(callback); }
@Override public void registerComponentCallbacks(ComponentCallbacks callback) { super.registerComponentCallbacks(callback); }
@Override public void unregisterComponentCallbacks(ComponentCallbacks callback) { super.unregisterComponentCallbacks(callback); }
public void registerComponentCallbacks(ComponentCallbacks callback) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { this.realApplication.registerComponentCallbacks(callback); } }
public void unregisterComponentCallbacks(ComponentCallbacks callback) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { this.realApplication.unregisterComponentCallbacks(callback); } }
@Override public void registerComponentCallbacks(ComponentCallbacks callback) { if (callback instanceof ComponentCallbacks2) { componentCallbacks.add((ComponentCallbacks2) callback); } }
@Override public void unregisterComponentCallbacks(ComponentCallbacks callback) { if (callback instanceof ComponentCallbacks2) { componentCallbacks.remove(callback); } }
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) { super.registerComponentCallbacks(callback); }
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) { super.unregisterComponentCallbacks(callback); }
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) { delegate.registerComponentCallbacks(callback); }
@Override public void super_registerComponentCallbacks(final ComponentCallbacks callback) { super.registerComponentCallbacks(callback); }
@Override public void super_unregisterComponentCallbacks(final ComponentCallbacks callback) { super.unregisterComponentCallbacks(callback); }
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) { delegate.unregisterComponentCallbacks(callback); }
public void registerComponentCallbacks(final ComponentCallbacks callback) { verifyMethodCalledFromDelegate("registerComponentCallbacks(ComponentCallbacks)"); ((CallVoid1<ComponentCallbacks>) mSuperListeners.pop()).call(callback); }
public void unregisterComponentCallbacks(final ComponentCallbacks callback) { verifyMethodCalledFromDelegate("unregisterComponentCallbacks(ComponentCallbacks)"); ((CallVoid1<ComponentCallbacks>) mSuperListeners.pop()).call(callback); }
@TargetApi(14) public static void registerComponentCallbacks(ComponentCallbacks callback) { ContextUtil.getContext().registerComponentCallbacks(callback); }
@TargetApi(14) public static void unregisterComponentCallbacks(ComponentCallbacks callback) { ContextUtil.getContext().unregisterComponentCallbacks(callback); }
@Override public void registerComponentCallbacks(ComponentCallbacks callback) { service.registerComponentCallbacks(callback); }
@Override public void unregisterComponentCallbacks(ComponentCallbacks callback) { service.unregisterComponentCallbacks(callback); }
@Override public void registerComponentCallbacks(ComponentCallbacks callback) { getBaseContext().registerComponentCallbacks(callback); }
@Override public void unregisterComponentCallbacks(ComponentCallbacks callback) { getBaseContext().unregisterComponentCallbacks(callback); }
public void registerComponentCallbacks(ComponentCallbacks callback) { delegate.registerComponentCallbacks(callback); }
public void unregisterComponentCallbacks(ComponentCallbacks callback) { delegate.unregisterComponentCallbacks(callback); }
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public void registerComponentCallbacks(ComponentCallbacks callback) { mBaseApplication.registerComponentCallbacks(callback); }
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @Override public void unregisterComponentCallbacks(ComponentCallbacks callback) { mBaseApplication.unregisterComponentCallbacks(callback); }
@TargetApi(VERSION_CODES.ICE_CREAM_SANDWICH) private static void registerComponentCallbacks(final Application app, final ComponentCallbacks callbacks) { if (VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH) return; app.registerComponentCallbacks(callbacks); }