当前位置: 首页>>代码示例>>Java>>正文


Java ComponentCallbacks类代码示例

本文整理汇总了Java中android.content.ComponentCallbacks的典型用法代码示例。如果您正苦于以下问题:Java ComponentCallbacks类的具体用法?Java ComponentCallbacks怎么用?Java ComponentCallbacks使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ComponentCallbacks类属于android.content包,在下文中一共展示了ComponentCallbacks类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ColorPickerDialog

import android.content.ComponentCallbacks; //导入依赖的package包/类
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);
  }
 
开发者ID:corcoran,项目名称:Hangar,代码行数:17,代码来源:ColorPickerDialog.java

示例2: startNewSession

import android.content.ComponentCallbacks; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:37,代码来源:UmaSessionStats.java

示例3: startNewSession

import android.content.ComponentCallbacks; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:38,代码来源:UmaSessionStats.java

示例4: registerComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
void registerComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall,
        final ComponentCallbacks callback) {
    synchronized (mSuperListeners) {
        mSuperListeners.push(superCall);
        registerComponentCallbacks(callback);
    }
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:8,代码来源:ActivityPlugin.java

示例5: unregisterComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
void unregisterComponentCallbacks(final CallVoid1<ComponentCallbacks> superCall,
        final ComponentCallbacks callback) {
    synchronized (mSuperListeners) {
        mSuperListeners.push(superCall);
        unregisterComponentCallbacks(callback);
    }
}
 
开发者ID:passsy,项目名称:CompositeAndroid,代码行数:8,代码来源:ActivityPlugin.java

示例6: startNewSession

import android.content.ComponentCallbacks; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:38,代码来源:UmaSessionStats.java

示例7: registerListener

import android.content.ComponentCallbacks; //导入依赖的package包/类
private void registerListener() {
    ContextUtils.getApplicationContext().registerComponentCallbacks(
            new ComponentCallbacks() {
                @Override
                public void onConfigurationChanged(Configuration configuration) {
                    updateNativeViewConfigurationIfNecessary();
                }

                @Override
                public void onLowMemory() {
                }
            });
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:14,代码来源:ViewConfigurationHelper.java

示例8: registerListener

import android.content.ComponentCallbacks; //导入依赖的package包/类
private void registerListener() {
    mAppContext.registerComponentCallbacks(
        new ComponentCallbacks() {
            @Override
            public void onConfigurationChanged(Configuration configuration) {
                updateNativeSharedDisplayInfo();
            }

            @Override
            public void onLowMemory() {
            }
    });
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:14,代码来源:DeviceDisplayInfo.java

示例9: registerListener

import android.content.ComponentCallbacks; //导入依赖的package包/类
private void registerListener() {
    mAppContext.registerComponentCallbacks(
            new ComponentCallbacks() {
                @Override
                public void onConfigurationChanged(Configuration configuration) {
                    updateNativeSharedDisplayInfo();
                }

                @Override
                public void onLowMemory() {
                }
            });
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:14,代码来源:DeviceDisplayInfo.java

示例10: registerComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override public void registerComponentCallbacks(final ComponentCallbacks callback) {
	if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.registerComponentCallbacks(callback);
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:4,代码来源:CondomContext.java

示例11: unregisterComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override public void unregisterComponentCallbacks(final ComponentCallbacks callback) {
	if (SDK_INT >= ICE_CREAM_SANDWICH) mApplication.unregisterComponentCallbacks(callback);
}
 
开发者ID:Trumeet,项目名称:MiPushFramework,代码行数:4,代码来源:CondomContext.java

示例12: registerComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override
public void registerComponentCallbacks(ComponentCallbacks callback) {
    super.registerComponentCallbacks(callback);
}
 
开发者ID:coder173025,项目名称:MagicCube,代码行数:5,代码来源:MagicCubeApplication.java

示例13: unregisterComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
@Override
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
    super.unregisterComponentCallbacks(callback);
}
 
开发者ID:coder173025,项目名称:MagicCube,代码行数:5,代码来源:MagicCubeApplication.java

示例14: registerComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
public void registerComponentCallbacks(ComponentCallbacks callback) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        this.realApplication.registerComponentCallbacks(callback);
    }
}
 
开发者ID:typ0520,项目名称:fastdex,代码行数:6,代码来源:FastdexApplication.java

示例15: unregisterComponentCallbacks

import android.content.ComponentCallbacks; //导入依赖的package包/类
public void unregisterComponentCallbacks(ComponentCallbacks callback) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        this.realApplication.unregisterComponentCallbacks(callback);
    }
}
 
开发者ID:typ0520,项目名称:fastdex,代码行数:6,代码来源:FastdexApplication.java


注:本文中的android.content.ComponentCallbacks类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。