示例#1
0
 @Override
 protected boolean fitSystemWindows(Rect insets) {
   final SparseIntArray windowFeatures = createConfig(null).windowFeatures;
   if (windowFeatures != null && windowFeatures.get(Window.FEATURE_ACTION_BAR_OVERLAY, 0) != 0) {
     return false;
   }
   return super.fitSystemWindows(insets);
 }
示例#2
0
 /**
  * Do not override this method. Use {@link #onPreInit(Holo, Bundle)} and {@link #onPostInit(Holo,
  * Bundle)}
  */
 protected void onInit(Holo config, Bundle savedInstanceState) {
   if (mInited) {
     throw new IllegalStateException("This instance was already inited");
   }
   mInited = true;
   if (config == null) {
     config = createConfig(savedInstanceState);
   }
   if (config == null) {
     config = Holo.defaultConfig();
   }
   onPreInit(config, savedInstanceState);
   if (!config.ignoreApplicationInstanceCheck && !(getApplication() instanceof Application)) {
     String text = "Application instance isn't HoloEverywhere.\n";
     if (getApplication().getClass() == android.app.Application.class) {
       text +=
           "Put attr 'android:name=\"org.holoeverywhere.app.Application\"'"
               + " in <application> tag of AndroidManifest.xml";
     } else {
       text +=
           "Please sure that you extend "
               + getApplication().getClass()
               + " from a org.holoeverywhere.app.Application";
     }
     throw new IllegalStateException(text);
   }
   getLayoutInflater().setFragmentActivity(this);
   if (this instanceof Activity) {
     Activity activity = (Activity) this;
     if (config.requireRoboguice) {
       activity.addon(Activity.ADDON_ROBOGUICE);
     }
     if (config.requireSlider) {
       activity.addon(Activity.ADDON_SLIDER);
     }
     if (config.requireSherlock) {
       activity.addonSherlock();
     }
     final SparseIntArray windowFeatures = config.windowFeatures;
     if (windowFeatures != null) {
       for (int i = 0; i < windowFeatures.size(); i++) {
         if (windowFeatures.valueAt(i) > 0) {
           requestWindowFeature((long) windowFeatures.keyAt(i));
         }
       }
     }
     ThemeManager.applyTheme(activity, mLastThemeResourceId == 0);
     if (!config.ignoreThemeCheck && ThemeManager.getThemeType(this) == ThemeManager.INVALID) {
       throw new HoloThemeException(activity);
     }
     TypedArray a =
         obtainStyledAttributes(
             new int[] {android.R.attr.windowActionBarOverlay, R.attr.windowActionBarOverlay});
     if (a.getBoolean(0, false) || a.getBoolean(1, false)) {
       requestWindowFeature((long) Window.FEATURE_ACTION_BAR_OVERLAY);
     }
     a.recycle();
   }
   onPostInit(config, savedInstanceState);
   lockAttaching();
 }
示例#3
0
 public void requestWindowFeature(int feature) {
   if (windowFeatures == null) {
     windowFeatures = new SparseIntArray();
   }
   windowFeatures.put(feature, feature);
 }