Example usage for android.app ActionBar show

List of usage examples for android.app ActionBar show

Introduction

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

Prototype

public abstract void show();

Source Link

Document

Show the ActionBar if it is not currently showing.

Usage

From source file:Main.java

public static void setIconeDefault(ActionBar actionBar, int resId) {
    if (actionBar == null) {
        return;/*w  w w  .  j a  v  a  2  s  .co m*/
    }
    actionBar.setIcon(resId);
    actionBar.show();
}

From source file:Main.java

public static void setTitleDefault(ActionBar actionBar, CharSequence title) {
    if (actionBar == null) {
        return;//from w w w .  j  ava 2  s.c o m
    }
    actionBar.setTitle(title);
    actionBar.setSubtitle(null);
    actionBar.show();
}

From source file:com.thelastcrusade.soundstream.SearchActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content_frame);

    ActionBar bar = getActionBar();
    bar.show();

    // Get the intent, verify the action and get the query
    Intent intent = getIntent();//w ww  .j  a  v  a 2  s  .  com
    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
        query = intent.getStringExtra(SearchManager.QUERY);
    }

    if (savedInstanceState == null) {
        MusicLibraryFragment fragment = getMusicLibraryFragment(query);
        getSupportFragmentManager().beginTransaction().add(R.id.content, fragment).commit();
    }

}

From source file:org.ambient.control.navigation.NavigationActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    ActionBar actionBar = getActionBar();
    // actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.show();

    setContentView(R.layout.activity_process_card);

    createNavigationDrawer();//  ww w .j a v  a2 s  . c  o  m

}

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

public void show(android.app.Activity activity, android.view.Menu menu) {
    //if (!(activity instanceof ActionBarActivity)) {
    android.app.ActionBar mainActionBar = activity.getActionBar();
    if (mainActionBar != null) {
        mainActionBar.show();
        if (_primaryCommands != null) {
            for (int i = 0; i < _primaryCommands.size(); i++) {
                menu.add(0, i, 0, ((AppBarButton) _primaryCommands.get(i)).label);
                menu.getItem(i).setShowAsAction(android.view.MenuItem.SHOW_AS_ACTION_ALWAYS);
            }//from   w  ww. ja v  a 2 s.c o m
        }
        return;
    }
    throw new RuntimeException(
            "Cannot use TabBar on the main page in Android unless you set <preference name=\"ShowTitle\" value=\"true\"/> in config.xml.");
    //}
    //else {
    //    ActionBar actionBar = ((ActionBarActivity)activity).getSupportActionBar();
    //    if (actionBar != null) {
    //        actionBar.show();
    //        for (int i = 0; i < _primaryCommands.size(); i++) {
    //            menu.add(0, i, 0, ((AppBarButton)_primaryCommands.get(i)).label);
    //            menu.getItem(i).setShowAsAction(android.view.MenuItem.SHOW_AS_ACTION_ALWAYS);
    //        }
    //        return;
    //    }
    //    throw new RuntimeException(
    //        "Unable to get the action bar from the current activity.");
    //}
}

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();//from  w w  w.  j  ava 2s.com
        } else {
            actionBar.show();
        }
    }
}

From source file:com.manning.androidhacks.hack044.MainActivity3X.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);//from  w  w w . j ava2s  .c o  m

    final View contentView = findViewById(R.id.content);

    contentView.setOnSystemUiVisibilityChangeListener(new OnSystemUiVisibilityChangeListener() {
        @Override
        public void onSystemUiVisibilityChange(int visibility) {
            final ActionBar actionBar = getActionBar();
            if (actionBar != null) {
                contentView.setSystemUiVisibility(visibility);

                if (visibility == View.STATUS_BAR_VISIBLE) {
                    actionBar.show();
                } else {
                    actionBar.hide();
                }
            }
        }
    });

    contentView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (contentView.getSystemUiVisibility() == View.STATUS_BAR_VISIBLE) {
                contentView.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
            } else {
                contentView.setSystemUiVisibility(View.STATUS_BAR_VISIBLE);
            }
        }
    });
}

From source file:com.hkm.oc.wv.supportwebview.webviewSupports.java

protected void toolbartoggle() {
    ActionBar ab = getActionBar();
    if (ab.isShowing())
        ab.hide();/* w  w w  .  j  av  a2s  .  c om*/
    else
        ab.show();
}

From source file:run.ace.TabBar.java

public void show(android.app.Activity activity) {
    //if (!(activity instanceof ActionBarActivity)) {
    android.app.ActionBar mainActionBar = activity.getActionBar();
    if (mainActionBar != null) {
        mainActionBar.show();
        mainActionBar.setNavigationMode(android.app.ActionBar.NAVIGATION_MODE_TABS);
        if (_primaryCommands != null) {
            for (int i = 0; i < _primaryCommands.size(); i++) {
                android.app.ActionBar.Tab tab = mainActionBar.newTab();
                AppBarButton abb = (AppBarButton) _primaryCommands.get(i);
                if (abb.icon != null) {
                    tab.setCustomView(getCustomTabView(abb, mainActionBar.getThemedContext()));
                } else {
                    tab.setText(abb.label);
                }/*ww w .j a v  a 2 s. co  m*/
                tab.setTabListener(this);
                mainActionBar.addTab(tab, i == 0);
            }
        }
        return;
    }
    throw new RuntimeException(
            "Cannot use TabBar on the main page in Android unless you set <preference name=\"ShowTitle\" value=\"true\"/> in config.xml.");
    //}
    //else {
    //    ActionBar actionBar = ((ActionBarActivity)activity).getSupportActionBar();
    //    if (actionBar != null) {
    //        actionBar.show();
    //        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    //        for (int i = 0; i < _primaryCommands.size(); i++) {
    //            ActionBar.Tab tab = actionBar.newTab();
    //            AppBarButton abb = (AppBarButton)_primaryCommands.get(i);
    //            if (abb.icon != null) {
    //                tab.setCustomView(getCustomTabView(abb, actionBar.getThemedContext()));
    //            }
    //            else {
    //                tab.setText(abb.label);
    //            }
    //            tab.setTabListener(this);
    //            actionBar.addTab(tab);
    //        }
    //        return;
    //    }
    //    throw new RuntimeException(
    //        "Unable to get TabBar from the current activity.");
    //}
}

From source file:com.example.venkatagovardhan.docorganizer.FolderActivity.java

public void setActionbarVisible(boolean visible) {
    ActionBar actionBar = getActionBar();
    if (actionBar == null)
        return;//from  ww w  .j a va 2 s .  c  om
    if (visible) {
        actionBar.show();
        setSystemBarTranslucency(false);
    } else {
        actionBar.hide();
        setSystemBarTranslucency(true);
    }
}