本文整理汇总了Java中android.app.FragmentTransaction.setTransition方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentTransaction.setTransition方法的具体用法?Java FragmentTransaction.setTransition怎么用?Java FragmentTransaction.setTransition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.FragmentTransaction
的用法示例。
在下文中一共展示了FragmentTransaction.setTransition方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toggleCallControlFragmentVisibility
import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void toggleCallControlFragmentVisibility() {
if (!iceConnected || !callFragment.isAdded()) {
return;
}
// Show/hide call control fragment
callControlFragmentVisible = !callControlFragmentVisible;
FragmentTransaction ft = getFragmentManager().beginTransaction();
if (callControlFragmentVisible) {
ft.show(callFragment);
ft.show(hudFragment);
} else {
ft.hide(callFragment);
ft.hide(hudFragment);
}
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
}
示例2: toggleCallControlFragmentVisibility
import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void toggleCallControlFragmentVisibility() {
if (!iceConnected || !callFragment.isAdded()) {
return;
}
// Show/hide call control fragment
callControlFragmentVisible = !callControlFragmentVisible;
FragmentTransaction ft = getFragmentManager().beginTransaction();
if (callControlFragmentVisible) {
ft.show(callFragment);
ft.show(hudFragment);
} else {
ft.hide(callFragment);
ft.hide(hudFragment);
}
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
}
示例3: onGoalDetailsDownloaded
import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void onGoalDetailsDownloaded(String dataString, GoalItem goalItem) {
goalDetailProgressDialog.dismiss();
Bundle bundle = new Bundle();
bundle.putString(GOAL_ITEM_KEY, new Gson().toJson(goalItem, GoalItem.class));
bundle.putString(GOAL_DATA_KEY, dataString);
GoalsDetailFragment fragment = new GoalsDetailFragment();
fragment.setOnDeleteListener(this);
fragment.setArguments(bundle);
if (isLargeDevice) {
fragment.show(getActivity().getFragmentManager(), GD_TAG);
} else {
FragmentTransaction fragmentTransaction = getActivity().getFragmentManager().beginTransaction();
fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
fragmentTransaction.add(android.R.id.content, fragment).addToBackStack(null).commit();
}
}
示例4: clearFragment
import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
* Metodo statico per eliminare il fragment, quando non sono disponibili parcheggi
*/
public static void clearFragment(MainActivity activity) {
if(activity.getFragmentAttivo() != null) {
// inizializza la fragmentTransaction per l'eliminazione
ParcheggiFragment fragAttivo = activity.getFragmentAttivo();
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
ft.remove(fragAttivo);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
// elimina il riferimento al fragment in MainActivity
activity.setFragmentAttivo(null);
}
}
示例5: reloadFragment
import android.app.FragmentTransaction; //导入方法依赖的package包/类
public static void reloadFragment(FragmentManager fragmentManager, Fragment fragment, int containViewId) {
if (fragment != null){
FragmentTransaction ft = fragmentManager.beginTransaction();
ft.setTransition(-1);
// ft.replace(containViewId, fragment);
ft.detach(fragment);
ft.attach(fragment);
ft.commitAllowingStateLoss();
}
}
示例6: closeFragment
import android.app.FragmentTransaction; //导入方法依赖的package包/类
private void closeFragment() {
FragmentManager fm = getFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.remove(fragment);
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE);
ft.commit();
addParticipantContainer.setVisibility(View.GONE);
isFragmentOpen = false;
}
示例7: onPreferenceTreeClick
import android.app.FragmentTransaction; //导入方法依赖的package包/类
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
final String key = preference.getKey();
switch (key) {
case KEY_CHECK_UPDATE:
mTask = CheckUpdateTask.getInstance(false);
if (!mTask.getStatus().equals(AsyncTask.Status.RUNNING)) {
mTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, getActivity());
}
return true;
case KEY_CHANGELOG:
ChangelogFragment changelogFrag = new ChangelogFragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
transaction.replace(this.getId(), changelogFrag);
transaction.addToBackStack(this.getClass().getName());
transaction.commit();
return true;
default:
OTALink link = LinkConfig.getInstance().findLink(key, getActivity());
if (link != null) {
OTAUtils.launchUrl(link.getUrl(), getActivity());
}
break;
}
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
示例8: newInstance
import android.app.FragmentTransaction; //导入方法依赖的package包/类
/**
* Metodo statico per instanziare più facilmente il fragment quando necessario
*/
public static void newInstance(MainActivity activity) {
// inizializza la FragmentTransaction
ParcheggiFragment newFragment = new ParcheggiFragment();
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
ft.replace(R.id.fragment_parcheggi_container, newFragment, "indirizzoParcheggio");
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
ft.commit();
// imposta un riferimento al fragment in MainActivity
activity.setFragmentAttivo(newFragment);
}