Search in sources :

Example 76 with Fragment

use of android.app.Fragment in project WordPress-Android by wordpress-mobile.

the class ReaderPostListActivity method showListFragmentForBlog.

/*
     * show fragment containing list of latest posts in a specific blog
     */
private void showListFragmentForBlog(long blogId) {
    if (isFinishing()) {
        return;
    }
    Fragment fragment = ReaderPostListFragment.newInstanceForBlog(blogId);
    getFragmentManager().beginTransaction().replace(R.id.fragment_container, fragment, getString(R.string.fragment_tag_reader_post_list)).commit();
    String title = ReaderBlogTable.getBlogName(blogId);
    if (title.isEmpty()) {
        title = getString(R.string.reader_title_blog_preview);
    }
    setTitle(title);
}
Also used : Fragment(android.app.Fragment)

Example 77 with Fragment

use of android.app.Fragment in project WordPress-Android by wordpress-mobile.

the class NumberPickerDialog method onDismiss.

@Override
public void onDismiss(DialogInterface dialog) {
    Fragment target = getTargetFragment();
    if (target != null) {
        target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, getResultIntent());
    }
    super.onDismiss(dialog);
}
Also used : Fragment(android.app.Fragment) DialogFragment(android.app.DialogFragment)

Example 78 with Fragment

use of android.app.Fragment in project Rosie by Karumi.

the class MainActivity method initializeViewPager.

private void initializeViewPager() {
    adapter = new FragmentAdapter(getFragmentManager());
    viewPager.setAdapter(adapter);
    Fragment charactersFragment = new CharactersFragment();
    Fragment comicsFragment = new ComicSeriesFragment();
    adapter.addFragment(charactersFragment, getString(R.string.characters_page_title));
    adapter.addFragment(comicsFragment, getString(R.string.comic_series_page_title));
    adapter.notifyDataSetChanged();
    pagerTabView.setupWithViewPager(viewPager);
}
Also used : CharactersFragment(com.karumi.rosie.sample.characters.view.fragment.CharactersFragment) ComicSeriesFragment(com.karumi.rosie.sample.comics.view.fragment.ComicSeriesFragment) Fragment(android.app.Fragment) ComicSeriesFragment(com.karumi.rosie.sample.comics.view.fragment.ComicSeriesFragment) CharactersFragment(com.karumi.rosie.sample.characters.view.fragment.CharactersFragment) FragmentAdapter(com.karumi.rosie.sample.main.view.adapter.FragmentAdapter)

Example 79 with Fragment

use of android.app.Fragment in project android-app by spark.

the class CoreListActivity method panelOpened.

private void panelOpened() {
    Fragment tinkerFrag = Ui.findFrag(this, R.id.tinker_container);
    if (tinkerFrag == null) {
        log.v("Tinker fragment is null");
    }
    if (slidingLayout.isSlideable()) {
        Ui.findFrag(this, R.id.core_list).setHasOptionsMenu(true);
        if (tinkerFrag != null) {
            tinkerFrag.setHasOptionsMenu(false);
        }
    } else {
        Ui.findFrag(this, R.id.core_list).setHasOptionsMenu(true);
        if (tinkerFrag != null) {
            tinkerFrag.setHasOptionsMenu(true);
        }
    }
    actionBar.setHomeButtonEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(false);
    setCustomActionBarTitle(getString(R.string.app_name_lower));
}
Also used : Fragment(android.app.Fragment) TinkerFragment(io.spark.core.android.ui.tinker.TinkerFragment)

Example 80 with Fragment

use of android.app.Fragment in project android-app by spark.

the class CoreListActivity method panelClosed.

private void panelClosed() {
    Ui.findFrag(this, R.id.core_list).setHasOptionsMenu(false);
    Fragment tinkerFrag = Ui.findFrag(this, R.id.tinker_container);
    if (tinkerFrag != null) {
        tinkerFrag.setHasOptionsMenu(true);
    }
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    if (selectedItemId != null) {
        Device selectedDevice = DeviceState.getDeviceById(selectedItemId);
        if (selectedDevice != null && truthy(selectedDevice.name)) {
            setCustomActionBarTitle(selectedDevice.name);
        } else {
            setCustomActionBarTitle(getString(R.string._unnamed_core_));
        }
    } else {
        log.wtf("Selected item is null?");
    }
}
Also used : Device(io.spark.core.android.cloud.api.Device) Fragment(android.app.Fragment) TinkerFragment(io.spark.core.android.ui.tinker.TinkerFragment)

Aggregations

Fragment (android.app.Fragment)209 FragmentTransaction (android.app.FragmentTransaction)82 FragmentManager (android.app.FragmentManager)51 DialogFragment (android.app.DialogFragment)44 Bundle (android.os.Bundle)22 Intent (android.content.Intent)13 View (android.view.View)13 PreferenceFragment (android.support.v14.preference.PreferenceFragment)12 TextView (android.widget.TextView)8 BizFragment (org.aisen.weibo.sina.ui.fragment.base.BizFragment)8 Uri (android.net.Uri)6 ABaseFragment (org.aisen.android.ui.fragment.ABaseFragment)6 Activity (android.app.Activity)5 PreferenceFragment (android.preference.PreferenceFragment)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 ViewGroup (android.view.ViewGroup)3 FrameLayout (android.widget.FrameLayout)3 ContactVcardViewerFragment (com.xabber.android.ui.fragment.ContactVcardViewerFragment)3 Method (java.lang.reflect.Method)3