Example usage for android.app ActionBar hide

List of usage examples for android.app ActionBar hide

Introduction

In this page you can find the example usage for android.app ActionBar hide.

Prototype

public abstract void hide();

Source Link

Document

Hide the ActionBar if it is currently showing.

Usage

From source file:Main.java

public static void hide(Activity act) {

    ActionBar actionBar = act.getActionBar();
    if (actionBar != null)
        actionBar.hide();
}

From source file:Windows.UI.Xaml.Controls.CommandBar.java

public static void remove(android.app.Activity activity, android.view.Menu menu) {
    //if (!(activity instanceof ActionBarActivity)) {
    android.app.ActionBar mainActionBar = activity.getActionBar();
    if (mainActionBar != null) {
        mainActionBar.hide();
        mainActionBar.setTitle(null);//  w w  w.ja v a  2  s  .  c om
        menu.clear();
        return;
    }
    //}
    //else {
    //    ActionBar actionBar = ((ActionBarActivity)activity).getSupportActionBar();
    //    if (actionBar != null) {
    //        actionBar.hide();
    //        actionBar.setTitle(null);
    //        menu.clear();
    //        return;
    //    }
    //}
}

From source file:com.example.ryant.swipeviewtest.ScreenSlideActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_screen_slide);

    // Set up a tabbed action bar
    final ActionBar actionBar = getActionBar();
    actionBar.hide();

    // Instantiate a ViewPager and a PagerAdapter.
    mPager = (ViewPager) findViewById(R.id.pager);
    mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
    mPager.setAdapter(mPagerAdapter);/*  w w  w .j a va  2  s.com*/
}

From source file:net.cherryzhang.sekuhara.LoginAndRegistration.LoginAndRegistrationActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_swipe_view_login_and_registration);

    mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager());

    Parse.initialize(this, "TsVbzF7jXzY1C0o86V2xxAxgSxvy4jmbyykOabPl",
            "VzamwWm4WswbDFxrxos2oSerQ2Av4RM6J5mNnNgr");

    final ActionBar actionBar = getActionBar();
    actionBar.hide();
    actionBar.setHomeButtonEnabled(false);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mAppSectionsPagerAdapter);

    ViewPager.SimpleOnPageChangeListener mPageChangeListener = new ViewPager.SimpleOnPageChangeListener() {
        @Override/*from  ww  w . j  av a  2  s  .  c o m*/
        public void onPageSelected(int position) {
            actionBar.setSelectedNavigationItem(position);
        }
    };

    pageIndicator = (CirclePageIndicator) findViewById(R.id.CPI_pageIndicator);
    pageIndicator.setViewPager(mViewPager);
    pageIndicator.setOnPageChangeListener(mPageChangeListener);
    pageIndicator.setCurrentItem(0);

    //TODO: make circle page indicator look better
    final float density = getResources().getDisplayMetrics().density;
    pageIndicator.setRadius(6 * density);
    pageIndicator.setPageColor(0xFFFFCCFF);
    pageIndicator.setFillColor(0xFFFF6699);
    pageIndicator.setStrokeColor(0xFF000000);
    pageIndicator.setStrokeWidth(1);

    // For each of the sections in the app, add a tab to the action bar.
    for (int i = 0; i < mAppSectionsPagerAdapter.getCount(); i++) {
        // Create a tab with text corresponding to the page title defined by the adapter.
        // Also specify this Activity object, which implements the TabListener interface, as the
        // listener for when this tab is selected.
        actionBar.addTab(
                actionBar.newTab().setText(mAppSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));
    }
}

From source file:actionfitness.com.actionfitness.MainActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager());

    final ActionBar actionBar = getActionBar();
    actionBar.hide();

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mAppSectionsPagerAdapter);
    /*mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
    }); *///from w  w  w .ja  va2s  .co m
}

From source file:com.example.propertylist.view.PropertyListActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_property_list);
    ActionBar actionBar = getActionBar();
    actionBar.hide();
}

From source file:com.example.cherry_zhang.androidbeaconexample.LoginAndRegistration.LoginAndRegistrationActivity.java

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    profile = LayoutInflater.from(this).inflate(R.layout.fragment_profile, null);
    login = LayoutInflater.from(this).inflate(R.layout.fragment_section_login_and_registration, null);

    setContentView(R.layout.activity_swipe_view_login_and_registration);

    //parse initialization
    Parse.initialize(this, "TsVbzF7jXzY1C0o86V2xxAxgSxvy4jmbyykOabPl",
            "VzamwWm4WswbDFxrxos2oSerQ2Av4RM6J5mNnNgr");

    // Create the adapter that will return a fragment for each of the three primary sections
    // of the app.
    mAppSectionsPagerAdapter = new AppSectionsPagerAdapter(getSupportFragmentManager());

    // Set up the action bar.
    final ActionBar actionBar = getActionBar();

    actionBar.hide();

    // Specify that the Home/Up button should not be enabled, since there is no hierarchical
    // parent.// w  ww  .  j  av  a 2 s .c om
    actionBar.setHomeButtonEnabled(false);

    // Specify that we will be displaying tabs in the action bar.
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);

    // Set up the ViewPager, attaching the adapter and setting up a listener for when the
    // user swipes between sections.
    mViewPager = (ViewPager) findViewById(R.id.pager);
    mViewPager.setAdapter(mAppSectionsPagerAdapter);
    mViewPager.setOffscreenPageLimit(4);

    ViewPager.SimpleOnPageChangeListener mPageChangeListener = new ViewPager.SimpleOnPageChangeListener() {
        @Override
        public void onPageSelected(int position) {
            // When swiping between different app sections, select the corresponding tab.
            // We can also use ActionBar.Tab#select() to do this if we have a reference to the
            // Tab.
            actionBar.setSelectedNavigationItem(position);
        }
    };

    //mViewPager.setOnPageChangeListener(

    pageIndicator = (CirclePageIndicator) findViewById(R.id.CPI_pageIndicator);
    pageIndicator.setViewPager(mViewPager);
    pageIndicator.setOnPageChangeListener(mPageChangeListener);
    pageIndicator.setCurrentItem(0);

    //TODO: make circle page indicator look better
    final float density = getResources().getDisplayMetrics().density;
    pageIndicator.setRadius(5 * density);
    pageIndicator.setPageColor(0xFF686868);
    pageIndicator.setFillColor(0xFFFFFFFF);
    pageIndicator.setStrokeColor(0xFF000000);
    pageIndicator.setStrokeWidth(1);

    // For each of the sections in the app, add a tab to the action bar.
    for (int i = 0; i < mAppSectionsPagerAdapter.getCount(); i++) {
        // Create a tab with text corresponding to the page title defined by the adapter.
        // Also specify this Activity object, which implements the TabListener interface, as the
        // listener for when this tab is selected.
        actionBar.addTab(
                actionBar.newTab().setText(mAppSectionsPagerAdapter.getPageTitle(i)).setTabListener(this));

    }
}

From source file:com.pickr.fragments.PhotoFragment.java

@Override
public void onClick(View view) {
    if (view.getId() == R.id.photoImageView) {
        ActionBar actionBar = getActivity().getActionBar();

        if (actionBar.isShowing()) {
            actionBar.hide();
        } else {/*from w w w .  j  av a 2 s  .c o m*/
            actionBar.show();
        }
    }
}

From source file:random.taiga.chat.truelecter.randomchat.LoginActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    instance = this;
    //Enable synchronous running
    //StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    //StrictMode.setThreadPolicy(policy);
    setContentView(R.layout.activity_name);

    Button btnJoin = (Button) findViewById(R.id.btnJoin);
    txtName = (EditText) findViewById(R.id.name);
    txtPass = (EditText) findViewById(R.id.pass);

    // Hiding the action bar
    ActionBar a = getActionBar();
    if (a != null) {
        a.hide();
    }//from w  w  w  .j ava  2s  .  co m

    try {
        User u = getUserFromFile();
        if (u != null) {
            Intent intent = new Intent(LoginActivity.this, ChatActivity.class);
            intent.putExtra("user", u);
            startActivity(intent);
        }
    } catch (JSONException | IOException e) {
        e.printStackTrace();
    }

    btnJoin.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            switch (getFieldError(txtName, txtPass)) {
            case 1:
                showToast(" ");
                return;
            case 2:
                showToast(" ");
                return;
            case 3:
                showToast("   ");
                return;
            }

            String name = txtName.getText().toString().trim();
            String pass = txtPass.getText().toString().trim();
            login(name, pass);
        }
    });
}

From source file:net.lp.actionbarpoirot.helpers.ActivityHelperHoneycomb.java

/** {@inheritDoc} */
@Override//  w  w  w.  ja  va  2 s . c o  m
public void setupActionBar(CharSequence title, int color) {
    if (UiUtilities.isGoogleTV(mActivity)) {
        // Left Nav Bar
        actionBar = leftNavBar = (LeftNavBarService.instance()).getLeftNavBar(mActivity);
        leftNavBar.setDisplayOptions(LeftNavBar.DISPLAY_USE_LOGO_WHEN_EXPANDED);
        leftNavBar.setDisplayOptions(LeftNavBar.DISPLAY_AUTO_EXPAND);

        actionBar.setBackgroundDrawable(new ColorDrawable(Color.DKGRAY));
        // TODO: set proper background for left nav bar.

        // Hide the title bar (like empty action bar at top for GoogleTV).
        actionBar.setDisplayShowTitleEnabled(false);

        // Hide the native >Honeycomb action bar in favor of the left nav
        // bar.
        final ActionBar nativeActionBar = mActivity.getActionBar();
        nativeActionBar.hide();
    } else {
        actionBar = mActivity.getActionBar();
    }
    actionBar.setTitle(title);
    actionBar.setDisplayHomeAsUpEnabled(true);

    enableActionBarTitleMarquee();
}