Java 类android.content.ComponentCallbacks 实例源码
项目:Hangar
文件:ColorPickerDialog.java
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);
}
项目:chromium-for-android-56-debug-video
文件:UmaSessionStats.java
/**
* 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();
}
项目:AndroidChromium
文件:UmaSessionStats.java
/**
* 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();
}
项目:Vafrinn
文件:UmaSessionStats.java
/**
* 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();
}
项目:CompositeAndroid
文件:ActivityPlugin.java
void registerComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall,
final ComponentCallbacks callback) {
synchronized (mSuperListeners) {
mSuperListeners.push(superCall);
registerComponentCallbacks(callback);
}
}
项目:CompositeAndroid
文件:ActivityPlugin.java
void unregisterComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall,
final ComponentCallbacks callback) {
synchronized (mSuperListeners) {
mSuperListeners.push(superCall);
unregisterComponentCallbacks(callback);
}
}
项目:365browser
文件:UmaSessionStats.java
/**
* 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();
}
项目:365browser
文件:ViewConfigurationHelper.java
private void registerListener() {
ContextUtils.getApplicationContext().registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeViewConfigurationIfNecessary();
}
@Override
public void onLowMemory() {
}
});
}
项目:android-chromium
文件:DeviceDisplayInfo.java
private void registerListener() {
mAppContext.registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeSharedDisplayInfo();
}
@Override
public void onLowMemory() {
}
});
}
项目:chromium_webview
文件:DeviceDisplayInfo.java
private void registerListener() {
mAppContext.registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeSharedDisplayInfo();
}
@Override
public void onLowMemory() {
}
});
}
项目:cordova-android-chromium
文件:DeviceDisplayInfo.java
private void registerListener() {
mAppContext.registerComponentCallbacks(
new ComponentCallbacks() {
@Override
public void onConfigurationChanged(Configuration configuration) {
updateNativeSharedDisplayInfo();
}
@Override
public void onLowMemory() {
}
});
}
项目:MiPushFramework
文件:CondomContext.java
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) {
if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.registerComponentCallbacks(callback);
}
项目:MiPushFramework
文件:CondomContext.java
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.unregisterComponentCallbacks(callback);
}
项目:condom
文件:CondomApplication.java
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) {
if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.registerComponentCallbacks(callback);
}
项目:condom
文件:CondomApplication.java
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.unregisterComponentCallbacks(callback);
}
项目:MagicCube
文件:MagicCubeApplication.java
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
super.registerComponentCallbacks(callback);
}
项目:MagicCube
文件:MagicCubeApplication.java
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
super.unregisterComponentCallbacks(callback);
}
项目:fastdex
文件:FastdexApplication.java
public void registerComponentCallbacks(ComponentCallbacks callback) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
this.realApplication.registerComponentCallbacks(callback);
}
}
项目:fastdex
文件:FastdexApplication.java
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
this.realApplication.unregisterComponentCallbacks(callback);
}
}
项目:RxAppState
文件:FakeApplication.java
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
if (callback instanceof ComponentCallbacks2) {
componentCallbacks.add((ComponentCallbacks2) callback);
}
}
项目:RxAppState
文件:FakeApplication.java
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
if (callback instanceof ComponentCallbacks2) {
componentCallbacks.remove(callback);
}
}
项目:CompositeAndroid
文件:BlueprintActivity.java
@Override
public void registerComponentCallbacks(final ComponentCallbacks callback) {
super.registerComponentCallbacks(callback);
}
项目:CompositeAndroid
文件:BlueprintActivity.java
@Override
public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
super.unregisterComponentCallbacks(callback);
}
项目:CompositeAndroid
文件:CompositeActivity.java
@Override
public void registerComponentCallbacks(final ComponentCallbacks callback) {
delegate.registerComponentCallbacks(callback);
}
项目:CompositeAndroid
文件:CompositeActivity.java
@Override
public void super_registerComponentCallbacks(final ComponentCallbacks callback) {
super.registerComponentCallbacks(callback);
}
项目:CompositeAndroid
文件:CompositeActivity.java
@Override
public void super_unregisterComponentCallbacks(final ComponentCallbacks callback) {
super.unregisterComponentCallbacks(callback);
}
项目:CompositeAndroid
文件:CompositeActivity.java
@Override
public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
delegate.unregisterComponentCallbacks(callback);
}
项目:CompositeAndroid
文件:ActivityPlugin.java
public void registerComponentCallbacks(final ComponentCallbacks callback) {
verifyMethodCalledFromDelegate("registerComponentCallbacks(ComponentCallbacks)");
((CallVoid1<ComponentCallbacks>) mSuperListeners.pop()).call(callback);
}
项目:CompositeAndroid
文件:ActivityPlugin.java
public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
verifyMethodCalledFromDelegate("unregisterComponentCallbacks(ComponentCallbacks)");
((CallVoid1<ComponentCallbacks>) mSuperListeners.pop()).call(callback);
}
项目:Android-App-Template
文件:ContextUtil.java
@TargetApi(14)
public static void registerComponentCallbacks(ComponentCallbacks callback) {
ContextUtil.getContext().registerComponentCallbacks(callback);
}
项目:Android-App-Template
文件:ContextUtil.java
@TargetApi(14)
public static void unregisterComponentCallbacks(ComponentCallbacks callback) {
ContextUtil.getContext().unregisterComponentCallbacks(callback);
}
项目:cordova-jsbackgroundservice
文件:ServiceAsActivity.java
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
service.registerComponentCallbacks(callback);
}
项目:cordova-jsbackgroundservice
文件:ServiceAsActivity.java
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
service.unregisterComponentCallbacks(callback);
}
项目:AndroidSkinChange
文件:SkinContextWrapper.java
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
getBaseContext().registerComponentCallbacks(callback);
}
项目:AndroidSkinChange
文件:SkinContextWrapper.java
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
getBaseContext().unregisterComponentCallbacks(callback);
}
项目:SharedPreferencesGenerator
文件:ContextAdapter.java
public void registerComponentCallbacks(ComponentCallbacks callback) {
delegate.registerComponentCallbacks(callback);
}
项目:SharedPreferencesGenerator
文件:ContextAdapter.java
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
delegate.unregisterComponentCallbacks(callback);
}
项目:mparticle-android-sdk
文件:ApplicationContextWrapper.java
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
mBaseApplication.registerComponentCallbacks(callback);
}
项目:mparticle-android-sdk
文件:ApplicationContextWrapper.java
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
mBaseApplication.unregisterComponentCallbacks(callback);
}
项目:deagle
文件:LocalAidlServices.java
@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);
}