Search in sources :

Example 81 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project remusic by aa112901.

the class NetSearchWordsActivity method onQueryTextSubmit.

@Override
public boolean onQueryTextSubmit(final String query) {
    hideInputManager();
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    SearchTabPagerFragment fragment = SearchTabPagerFragment.newInstance(0, query);
    ft.replace(R.id.search_frame, fragment).commitAllowingStateLoss();
    return true;
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) SearchTabPagerFragment(com.wm.remusic.fragmentnet.SearchTabPagerFragment)

Example 82 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project remusic by aa112901.

the class BaseActivity method showQuickControl.

/**
     * @param show 显示或关闭底部播放控制栏
     */
protected void showQuickControl(boolean show) {
    Log.d(TAG, MusicPlayer.getQueue().length + "");
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    if (show) {
        if (fragment == null) {
            fragment = QuickControlsFragment.newInstance();
            ft.add(R.id.bottom_container, fragment).commitAllowingStateLoss();
        } else {
            ft.show(fragment).commitAllowingStateLoss();
        }
    } else {
        if (fragment != null)
            ft.hide(fragment).commitAllowingStateLoss();
    }
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 83 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project remusic by aa112901.

the class TabActivity method onCreate.

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getIntent().getExtras() != null) {
        page = getIntent().getIntExtra("page_number", 0);
        artistId = getIntent().getIntExtra("artist", 0);
        albumId = getIntent().getIntExtra("album", 0);
    }
    setContentView(R.layout.activity_tab);
    if (artistId != 0) {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        ArtistDetailFragment fragment = ArtistDetailFragment.newInstance(artistId);
        transaction.hide(getSupportFragmentManager().findFragmentById(R.id.tab_container));
        transaction.add(R.id.tab_container, fragment);
        transaction.addToBackStack(null).commit();
    }
    if (albumId != 0) {
    }
    String[] title = { "单曲", "歌手", "专辑", "文件夹" };
    TabPagerFragment fragment = TabPagerFragment.newInstance(page, title);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.add(R.id.tab_container, fragment);
    transaction.commitAllowingStateLoss();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) TabPagerFragment(com.wm.remusic.fragment.TabPagerFragment) ArtistDetailFragment(com.wm.remusic.fragment.ArtistDetailFragment)

Example 84 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project actor-platform by actorapp.

the class BaseFragmentActivity method showNextFragment.

public void showNextFragment(Fragment fragment, boolean addToBackStack) {
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.content_frame, fragment);
    if (addToBackStack) {
        transaction.addToBackStack(null);
    }
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Example 85 with FragmentTransaction

use of android.support.v4.app.FragmentTransaction in project actor-platform by actorapp.

the class BaseFragmentActivity method showFragment.

public void showFragment(Fragment fragment, boolean addToBackStack) {
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.content_frame, fragment);
    if (addToBackStack) {
        transaction.addToBackStack(null);
    }
    transaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction)

Aggregations

FragmentTransaction (android.support.v4.app.FragmentTransaction)392 Fragment (android.support.v4.app.Fragment)135 FragmentManager (android.support.v4.app.FragmentManager)79 View (android.view.View)29 DialogFragment (android.support.v4.app.DialogFragment)27 FragmentActivity (android.support.v4.app.FragmentActivity)25 Bundle (android.os.Bundle)21 TextView (android.widget.TextView)19 FragmentTransaction (android.app.FragmentTransaction)18 Intent (android.content.Intent)18 Button (android.widget.Button)17 OnClickListener (android.view.View.OnClickListener)16 SherlockFragment (com.actionbarsherlock.app.SherlockFragment)12 ActionBar (android.support.v7.app.ActionBar)8 TargetApi (android.annotation.TargetApi)6 AppCompatActivity (android.support.v7.app.AppCompatActivity)6 Toolbar (android.support.v7.widget.Toolbar)6 FriendsTimeLineFragment (org.qii.weiciyuan.ui.maintimeline.FriendsTimeLineFragment)6 UserInfoFragment (org.qii.weiciyuan.ui.userinfo.UserInfoFragment)6 Transition (android.transition.Transition)5