當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。