Example usage for android.content Context STATUS_BAR_SERVICE

List of usage examples for android.content Context STATUS_BAR_SERVICE

Introduction

In this page you can find the example usage for android.content Context STATUS_BAR_SERVICE.

Prototype

String STATUS_BAR_SERVICE

To view the source code for android.content Context STATUS_BAR_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.app.StatusBarManager for interacting with the status bar.

Usage

From source file:com.mokee.setupwizard.SetupWizardActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    checkInit();/*  ww w.  j a  v  a2  s .c o  m*/
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mStatusBarManager = (StatusBarManager) getSystemService(Context.STATUS_BAR_SERVICE);
    disableStatusBar();

    sInterpolator = new LinearInterpolator();
    mViewPager = (ViewPager) findViewById(R.id.pager);
    getPages();

    mViewPager.setAdapter(new MkFragmentAdapter(getFragmentManager()));
    mViewPager.setPageTransformer(true, new DepthPageTransformer());
    mViewPager.setCurrentItem(0);
    mViewPager.setOnPageChangeListener(mPagerListener);

    try {
        Field mScroller;
        mScroller = ViewPager.class.getDeclaredField("mScroller");
        mScroller.setAccessible(true);
        FixedSpeedScroller scroller = new FixedSpeedScroller(mViewPager.getContext(), sInterpolator);
        scroller.setFixedDuration(200);
        mScroller.set(mViewPager, scroller);
    } catch (NoSuchFieldException e) {
    } catch (IllegalArgumentException e) {
    } catch (IllegalAccessException e) {
    }
}

From source file:com.android.systemui.statusbar.phone.NavigationBarView.java

public NavigationBarView(Context context, AttributeSet attrs) {
    super(context, attrs);
    mContext = context;//from w ww . j ava  2  s .  com

    mHidden = false;

    mDisplay = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
    mBarService = IStatusBarService.Stub.asInterface(ServiceManager.getService(Context.STATUS_BAR_SERVICE));

    final Resources res = mContext.getResources();
    mBarSize = res.getDimensionPixelSize(R.dimen.navigation_bar_size);
    mVertical = false;
    mShowMenu = false;
    mDelegateHelper = new DelegateViewHelper(this);

    mBackIcon = res.getDrawable(R.drawable.ic_sysbar_back);
    mBackLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_land);
    mBackAltIcon = res.getDrawable(R.drawable.ic_sysbar_back_ime);
    mBackAltLandIcon = res.getDrawable(R.drawable.ic_sysbar_back_ime);

    mContext.getContentResolver().registerContentObserver(
            Settings.System.getUriFor(Settings.System.NAV_BAR_COLOR), false,
            new ContentObserver(new Handler()) {
                @Override
                public void onChange(boolean selfChange) {
                    updateColor(false);
                }
            });
}