Android Open Source - AndroidBasicNavigation Abstract Fragment






From Project

Back to project page AndroidBasicNavigation.

License

The source code is released under:

GNU General Public License

If you think the Android project AndroidBasicNavigation 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.twdwarfs.navigation;
//from   w  w w. j  ava2s.  co  m
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * @author 2dwarfs.com <info@2dwarfs.com>
 */

public abstract class AbstractFragment extends Fragment {
  
  private ActionBar mActionBar;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    mActionBar = ((ActionBarActivity)getActivity()).getSupportActionBar();
    prepare();
  }
  
  public void prepare() {
    if(mActionBar != null) {
      mActionBar.setDisplayHomeAsUpEnabled(true);
      mActionBar.setHomeButtonEnabled(true);
    }
  }
  
  public void setTitle(String title) {
    if(mActionBar != null) {
      mActionBar.setTitle(title);
    }
  }
  
  public void show() {
    
  }
}




Java Source Code List

com.twdwarfs.navigation.AbstractFragment.java
com.twdwarfs.navigation.DragonFragment.java
com.twdwarfs.navigation.DwarfFragment.java
com.twdwarfs.navigation.GnomeFragment.java
com.twdwarfs.navigation.MainActivity.java
com.twdwarfs.navigation.NavDrawerListAdapter.java