Android Open Source - ManipalNow-Android System Ui Hider Base






From Project

Back to project page ManipalNow-Android.

License

The source code is released under:

Apache License

If you think the Android project ManipalNow-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.example.nav.util;
/*from   w w w . ja  v a 2 s  .  com*/
import android.app.Activity;
import android.view.View;
import android.view.WindowManager;

/**
 * A base implementation of {@link SystemUiHider}. Uses APIs available in all
 * API levels to show and hide the status bar.
 */
public class SystemUiHiderBase extends SystemUiHider {
  /**
   * Whether or not the system UI is currently visible. This is a cached value
   * from calls to {@link #hide()} and {@link #show()}.
   */
  private boolean mVisible = true;

  /**
   * Constructor not intended to be called by clients. Use
   * {@link SystemUiHider#getInstance} to obtain an instance.
   */
  protected SystemUiHiderBase(Activity activity, View anchorView, int flags) {
    super(activity, anchorView, flags);
  }

  @Override
  public void setup() {
    if ((mFlags & FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES) == 0) {
      mActivity.getWindow().setFlags(
          WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
              | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
          WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
              | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    }
  }

  @Override
  public boolean isVisible() {
    return mVisible;
  }

  @Override
  public void hide() {
    if ((mFlags & FLAG_FULLSCREEN) != 0) {
      mActivity.getWindow().setFlags(
          WindowManager.LayoutParams.FLAG_FULLSCREEN,
          WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    mOnVisibilityChangeListener.onVisibilityChange(false);
    mVisible = false;
  }

  @Override
  public void show() {
    if ((mFlags & FLAG_FULLSCREEN) != 0) {
      mActivity.getWindow().setFlags(0,
          WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
    mOnVisibilityChangeListener.onVisibilityChange(true);
    mVisible = true;
  }
}




Java Source Code List

com.example.nav.BarFragment.java
com.example.nav.BarInfo.java
com.example.nav.Bars.java
com.example.nav.CafeFragment.java
com.example.nav.CafeInfo.java
com.example.nav.Cafes.java
com.example.nav.Coffee.java
com.example.nav.Food.java
com.example.nav.HelpAct.java
com.example.nav.HelpFragment1.java
com.example.nav.HelpFragment2.java
com.example.nav.HelpFragment3.java
com.example.nav.HelpFragment4.java
com.example.nav.HelpFragment5.java
com.example.nav.HelpFragment6.java
com.example.nav.HelpFragment7.java
com.example.nav.HelpFragment8.java
com.example.nav.HospitalFragment.java
com.example.nav.HospitalInfo.java
com.example.nav.Hospitals.java
com.example.nav.ImageAdapter.java
com.example.nav.LevelAdapter.java
com.example.nav.Level.java
com.example.nav.MainActivity.java
com.example.nav.RestaurantFragment.java
com.example.nav.RestaurantInfo.java
com.example.nav.Restaurants.java
com.example.nav.Settings3.java
com.example.nav.ShowCity3.java
com.example.nav.ShowCity5.java
com.example.nav.ShowCity6.java
com.example.nav.ShowCity7.java
com.example.nav.util.SystemUiHiderBase.java
com.example.nav.util.SystemUiHiderHoneycomb.java
com.example.nav.util.SystemUiHider.java