use of android.support.v4.app.FragmentActivity in project YourAppIdea by Michenux.
the class ChangeLogHelper method showChangeLogFromVersion.
public void showChangeLogFromVersion(int resTitle, int resCloseLabel, int resChangeLog, int fromVersion, FragmentActivity fragmentActivity) {
String changeLog = getHTMLChangelog(resChangeLog, fragmentActivity.getResources(), fromVersion, fragmentActivity);
if (!TextUtils.isEmpty(changeLog)) {
FragmentManager fm = fragmentActivity.getSupportFragmentManager();
ChangeLogDialogFragment dialogFragment = ChangeLogDialogFragment.newInstance(resTitle, resCloseLabel, changeLog);
dialogFragment.show(fm, null);
}
}
use of android.support.v4.app.FragmentActivity in project JustAndroid by chinaltz.
the class AbDialogUtil method removeDialog.
/**
* 移除Fragment.
*
* @param context the context
*/
public static void removeDialog(final Context context) {
try {
FragmentActivity activity = (FragmentActivity) context;
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
// 指定一个系统转场动画
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_CLOSE);
Fragment prev = activity.getFragmentManager().findFragmentByTag(dialogTag);
if (prev != null) {
ft.remove(prev);
}
//不能加入到back栈
//ft.addToBackStack(null);
ft.commit();
} catch (Exception e) {
//可能有Activity已经被销毁的异常
e.printStackTrace();
}
}
use of android.support.v4.app.FragmentActivity in project JustAndroid by chinaltz.
the class AbDialogUtil method showFullScreenDialog.
/**
* 显示一个全屏对话框.
*
* @param view
* @return
*/
public static AbSampleDialogFragment showFullScreenDialog(View view) {
FragmentActivity activity = (FragmentActivity) view.getContext();
// Create and show the dialog.
AbSampleDialogFragment newFragment = AbSampleDialogFragment.newInstance(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Black_NoTitleBar_Fullscreen, Gravity.CENTER);
newFragment.setContentView(view);
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
// 指定一个系统转场动画
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
newFragment.show(ft, dialogTag);
return newFragment;
}
use of android.support.v4.app.FragmentActivity in project JustAndroid by chinaltz.
the class AbDialogUtil method showAlertDialog.
/**
* 显示一个普通对话框.
*
* @param view 对话框View
*/
public static AbAlertDialogFragment showAlertDialog(View view) {
FragmentActivity activity = (FragmentActivity) view.getContext();
AbAlertDialogFragment alertDialogFragment = new AbAlertDialogFragment();
alertDialogFragment.setContentView(view);
FragmentTransaction ft = activity.getFragmentManager().beginTransaction();
// 指定一个系统转场动画
ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
alertDialogFragment.show(ft, dialogTag);
return alertDialogFragment;
}
use of android.support.v4.app.FragmentActivity in project simplefacebook by androidquery.
the class PQuery method forward.
public void forward(FragmentActivity act, int requestCode, int resultCode, Intent data) {
if (data == null)
return;
String method = data.getStringExtra(FW_CB);
AQUtility.debug("being forwarded!", method);
if (method == null)
return;
int id = data.getIntExtra(FW_ID, -1);
if (id != -1) {
Fragment f = act.getSupportFragmentManager().findFragmentById(id);
AQUtility.debug("fr", f);
if (f != null) {
AQUtility.invokeHandler(f, method, false, true, FW_SIG, requestCode, resultCode, data);
}
}
}
Aggregations