Search in sources :

Example 21 with Fragment

use of android.support.v4.app.Fragment in project Android-PanesLibrary by cricklet.

the class ExampleActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setPaneSizer(new ExamplePaneSizer());
    // Lets setup a menu and a first pane!
    if (savedInstanceState == null) {
        Fragment menu = new ExampleFragment();
        Fragment first = new ExampleFragment();
        setMenuFragment(menu);
        addFragment(menu, first);
        // if you wanted to add more fragments after these ones, you can do:
        Fragment second = new ExampleFragment();
        Fragment third = new ExampleFragment();
        addFragment(first, second);
        addFragment(second, third);
    }
}
Also used : Fragment(android.support.v4.app.Fragment)

Example 22 with Fragment

use of android.support.v4.app.Fragment in project Android-PanesLibrary by cricklet.

the class ExampleFragment method addExampleFragment.

/**
	 * Create a new ExampleFragment and add it!
	 */
private void addExampleFragment() {
    // create a new fragment
    Fragment f = new ExampleFragment();
    //Fragment f = new ExampleListFragment();
    // get the activity and add the new fragment after this one!
    Activity a = getActivity();
    if (a != null && a instanceof FragmentLauncher)
        ((FragmentLauncher) a).addFragment(ExampleFragment.this, f);
}
Also used : FragmentLauncher(com.mapsaurus.paneslayout.FragmentLauncher) Activity(android.app.Activity) Fragment(android.support.v4.app.Fragment)

Example 23 with Fragment

use of android.support.v4.app.Fragment in project ActionBar-PullToRefresh by chrisbanes.

the class BaseSampleActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Add the Sample Fragment if there is one
    Fragment sampleFragment = getSampleFragment();
    if (sampleFragment != null) {
        getSupportFragmentManager().beginTransaction().replace(android.R.id.content, sampleFragment).commit();
    }
}
Also used : Fragment(android.support.v4.app.Fragment)

Example 24 with Fragment

use of android.support.v4.app.Fragment in project cw-android by commonsguy.

the class EU4You method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    CountriesFragment countries = (CountriesFragment) getSupportFragmentManager().findFragmentById(R.id.countries);
    countries.setCountryListener(this);
    Fragment f = getSupportFragmentManager().findFragmentById(R.id.details);
    detailsInline = (f != null && (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE));
    if (detailsInline) {
        countries.enablePersistentSelection();
    } else if (f != null) {
        f.getView().setVisibility(View.GONE);
    }
}
Also used : Fragment(android.support.v4.app.Fragment)

Example 25 with Fragment

use of android.support.v4.app.Fragment in project barcodescanner by dm77.

the class FullScannerActivity method showMessageDialog.

public void showMessageDialog(String message) {
    DialogFragment fragment = MessageDialogFragment.newInstance("Scan Results", message, this);
    fragment.show(getSupportFragmentManager(), "scan_results");
}
Also used : DialogFragment(android.support.v4.app.DialogFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)617 FragmentTransaction (android.support.v4.app.FragmentTransaction)220 Bundle (android.os.Bundle)140 View (android.view.View)129 FragmentManager (android.support.v4.app.FragmentManager)115 DialogFragment (android.support.v4.app.DialogFragment)77 TextView (android.widget.TextView)55 FragmentInstruction (de.madcyph3r.example.example.FragmentInstruction)48 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)48 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)48 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)43 Intent (android.content.Intent)39 ViewPager (android.support.v4.view.ViewPager)35 FragmentActivity (android.support.v4.app.FragmentActivity)34 BaseFragment (com.waz.zclient.pages.BaseFragment)29 ImageView (android.widget.ImageView)27 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)25 Button (android.widget.Button)24 ArrayList (java.util.ArrayList)24 FragmentStatePagerAdapter (android.support.v4.app.FragmentStatePagerAdapter)21