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;
}
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();
}
}
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();
}
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();
}
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();
}
Aggregations