Example usage for android.app ActionBar NAVIGATION_MODE_STANDARD

List of usage examples for android.app ActionBar NAVIGATION_MODE_STANDARD

Introduction

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

Prototype

int NAVIGATION_MODE_STANDARD

To view the source code for android.app ActionBar NAVIGATION_MODE_STANDARD.

Click Source Link

Document

Standard navigation mode.

Usage

From source file:name.gumartinm.weather.information.activity.SpecificActivity.java

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

    final ActionBar actionBar = this.getActionBar();

    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_SHOW_TITLE);
    actionBar.setDisplayHomeAsUpEnabled(true);

}

From source file:com.balch.android.app.framework.TemplateActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    application = (BaseApplication) this.getApplicationContext();

    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);

    setContentView(R.layout.template_view);
    this.navBar = (NavBar) findViewById(R.id.nav_bar_main);
    this.rootLayout = (LinearLayout) findViewById(R.id.template_layout);
    this.frameLayout = (FrameLayout) findViewById(R.id.template_place_holder);

    application.configureActivity(this, this.navBar, savedInstanceState);

    if (savedInstanceState == null) {
    }/*from  ww  w  . j  ava  2 s  .c  o  m*/

    getSupportFragmentManager().addOnBackStackChangedListener(new FragmentManager.OnBackStackChangedListener() {
        @Override
        public void onBackStackChanged() {
            int backStackCount = getSupportFragmentManager().getBackStackEntryCount();
            if (backStackCount > 0) {
                int selectedIndex = Integer.parseInt(
                        getSupportFragmentManager().getBackStackEntryAt(backStackCount - 1).getName());
                if (selectedIndex != TemplateActivity.this.navBar.getSelectedIndex()) {
                    TemplateActivity.this.navBar.setSelectedIndex(selectedIndex);
                }
            } else {
                // required b/c the first stack frame has an empty fragment
                finish();
            }
        }
    });

    this.navBar.completeConfiguration();
}

From source file:com.vose.fragment.action.RulesFragment.java

private void setActionBar() {

    setHasOptionsMenu(true);//  w ww. j  a va 2s.c om

    getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
    getActivity().getActionBar().setTitle(getString(R.string.rules_title));

}

From source file:org.yuzhiqiang.itsmine.MainActivity.java

public void restoreActionBar() {
    final ActionBar actionBar = getActionBar();
    if (actionBar != null) {
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        actionBar.setDisplayShowTitleEnabled(true);
        actionBar.setTitle(getTitle());/*  ww  w  .  j  a  v  a  2s .co m*/
    }
}

From source file:com.example.office.ui.calendar.EventFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mInflater = inflater;//from   w  w w.  jav a 2 s  .  c o m
    View rootView = inflater.inflate(getFragmentLayoutId(), container, false);

    try {
        Activity activity = getActivity();
        activity.getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

        Intent intent = getActivity().getIntent();
        event = (Event) intent.getExtras().get(getActivity().getString(R.string.intent_event_key));
        displayEvent(rootView);
        getActivity().setProgressBarIndeterminateVisibility(false);

        // Code below will be invoked when we receive system intent holding the path to shared image and this image is transformed into bytes[].
        mImagePicker = new ImagePicker(getActivity(), getActivity().getString(R.string.intent_event_key)) {
            @Override
            public void processImage(final byte[] imageBytes, final String fileName, final Object intentArg) {
                try {
                    String itemId = "";
                    if (intentArg instanceof Event) {
                        itemId = ((Event) intentArg).getId();
                    }

                    if (!TextUtils.isEmpty(itemId)) {
                        // Getting event by id
                        Futures.addCallback(Me.getEvents().getAsync(itemId), new FutureCallback<IEvent>() {
                            @Override
                            public void onFailure(Throwable t) {
                                if (!onError(t)) {
                                    mImagePicker.showStatusToast(Status.UPLOAD_FAILED);
                                }
                            }

                            @Override
                            public void onSuccess(IEvent event) {
                                try {
                                    IFileAttachment attachment = event.getAttachments().newFileAttachment();
                                    attachment.setContentBytes(imageBytes).setName(fileName);
                                    // Propagating changes to server
                                    Me.flush();

                                    mImagePicker.showStatusToast(Status.UPLOAD_SUCCESS);
                                } catch (Exception e) {
                                    onFailure(e);
                                }
                            }
                        });
                    }
                } catch (Exception e) {
                    if (!onError(e)) {
                        mImagePicker.showStatusToast(Status.UPLOAD_FAILED);
                    }
                }
            }
        };
    } catch (Exception e) {
        Logger.logApplicationException(e, getClass().getSimpleName() + ".onCreateView(): Error.");
    }

    return rootView;
}

From source file:com.imobilize.blogposts.fragments.SubscribeFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    ActionBar actionBar = getActivity().getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

    rootView = inflater.inflate(R.layout.login, container, false);
    context = getActivity().getApplicationContext();

    declareCheckBoxes();/*from w w w.  j  a v  a2  s .c o  m*/
    declareRegisterButton();

    enableDisableButton();
    enableDisableCheckBoxes();

    return rootView;
}

From source file:com.example.office.ui.mail.MailItemFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mInflater = inflater;/*from www . ja va2 s. co m*/
    View rootView = inflater.inflate(getFragmentLayoutId(), container, false);
    setHasOptionsMenu(true);

    try {
        Activity activity = getActivity();
        activity.getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

        Intent intent = getActivity().getIntent();
        mail = (MailItem) intent.getExtras().get(getActivity().getString(R.string.intent_mail_key));
        displayMail(rootView);
        getActivity().setProgressBarIndeterminateVisibility(false);
    } catch (Exception e) {
        Logger.logApplicationException(e, getClass().getSimpleName() + ".onCreateView(): Error.");
    }

    return rootView;
}

From source file:org.jorge.lolin1.ui.activities.DrawerLayoutFragmentActivity.java

protected void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(Boolean.TRUE);
    actionBar.setTitle(mTitle);/* w  w  w  .  ja  va2  s.  co m*/
}

From source file:com.cachirulop.moneybox.activity.MovementDetailActivity.java

/**
 * Initialize the activity action bar//from  w w  w  . j  a  va 2s  . co m
 */
private void createActionBar() {
    final ActionBar actionBar = getActionBar();

    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);
}

From source file:com.emotion.emotioncontrol.MainActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(mTitle);/*from ww  w .  j  ava  2  s.c o  m*/
}