當前位置: 首頁>>代碼示例>>Java>>正文


Java FragmentTransaction.setTransition方法代碼示例

本文整理匯總了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();
}
 
開發者ID:Piasy,項目名稱:AppRTC-Android,代碼行數:18,代碼來源:CallActivity.java

示例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();
}
 
開發者ID:lgyjg,項目名稱:AndroidRTC,代碼行數:18,代碼來源:CallActivity.java

示例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();
    }
}
 
開發者ID:Protino,項目名稱:CodeWatch,代碼行數:19,代碼來源:GoalsFragment.java

示例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);
    }
}
 
開發者ID:IelloDevTeam,項目名稱:IelloAndroidApp,代碼行數:17,代碼來源:ParcheggiFragment.java

示例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();
	}
}
 
開發者ID:WowWeeLabs,項目名稱:CHIP-Android-SDK,代碼行數:11,代碼來源:FragmentHelper.java

示例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;
}
 
開發者ID:StringflowServer,項目名稱:Beach-Android,代碼行數:10,代碼來源:GroupDetailsActivity.java

示例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);
}
 
開發者ID:DroidThug,項目名稱:VulcanOTA,代碼行數:28,代碼來源:SlimOTAFragment.java

示例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);
}
 
開發者ID:IelloDevTeam,項目名稱:IelloAndroidApp,代碼行數:15,代碼來源:ParcheggiFragment.java


注:本文中的android.app.FragmentTransaction.setTransition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。