Android Open Source - tnc1-android-config System Ui Hider Base






From Project

Back to project page tnc1-android-config.

License

The source code is released under:

Apache License

If you think the Android project tnc1-android-config 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.mobilinkd.tncconfig.util;
/*ww w  . ja  va  2 s  . c o m*/
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.google.speech.levelmeter.BarLevelDrawable.java
com.mobilinkd.tncconfig.AboutActivity.java
com.mobilinkd.tncconfig.AudioInputFragment.java
com.mobilinkd.tncconfig.AudioOutputFragment.java
com.mobilinkd.tncconfig.Avr109.java
com.mobilinkd.tncconfig.BluetoothTncService.java
com.mobilinkd.tncconfig.DeviceListActivity.java
com.mobilinkd.tncconfig.FirmwareUpdateActivity.java
com.mobilinkd.tncconfig.Firmware.java
com.mobilinkd.tncconfig.IntelHexRecord.java
com.mobilinkd.tncconfig.KissFragment.java
com.mobilinkd.tncconfig.ModemFragment.java
com.mobilinkd.tncconfig.NumberPickerFragment.java
com.mobilinkd.tncconfig.PowerFragment.java
com.mobilinkd.tncconfig.TncConfigApplication.java
com.mobilinkd.tncconfig.TncConfigDefaults.java
com.mobilinkd.tncconfig.TncConfig.java
com.mobilinkd.tncconfig.util.SystemUiHiderBase.java
com.mobilinkd.tncconfig.util.SystemUiHiderHoneycomb.java
com.mobilinkd.tncconfig.util.SystemUiHider.java