android.support.v4.app.DialogFragment#show ( )源码实例Demo

下面列出了android.support.v4.app.DialogFragment#show ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: aptoide-client   文件: BasePurchaseActivity.java
@Override
public void onClick(int payType, String imsi,  String price, String currency) {
    DialogFragment df = new ProgressDialogFragment();

    df.setCancelable(false);
    df.show(getSupportFragmentManager(), "pleaseWaitDialog");
    PayProductRequestUnitel requestUnitel = new PayProductRequestUnitel();
    requestUnitel.setProductId(String.valueOf(aptoideProductId));
    requestUnitel.setPayType(String.valueOf(payType));
    requestUnitel.setToken(token);
    requestUnitel.setImsi(imsi);
    requestUnitel.setPrice(price);
    requestUnitel.setCurrency(currency);
    requestUnitel.setRepo(repo);
    requestsetExtra(requestUnitel);
    requestUnitel.setRetryPolicy(noRetryPolicy);
    spiceManager.execute(requestUnitel, new PurchaseRequestListener());

}
 
源代码2 项目: rpicheck   文件: CustomCommandActivity.java
private void parseNonPromptingAndShow(String keyPassphrase, CommandBean command) {
    final DialogFragment runCommandDialog = new RunCommandDialog();
    final Bundle args = new Bundle();
    String cmdString = command.getCommand();
    Map<String, String> nonPromptingPlaceholders = parseNonPromptingPlaceholders(command.getCommand(), currentDevice);
    for (Map.Entry<String, String> entry : nonPromptingPlaceholders.entrySet()) {
        cmdString = cmdString.replace(entry.getKey(), entry.getValue());
    }
    command.setCommand(cmdString);
    args.putSerializable("pi", currentDevice);
    args.putSerializable("cmd", command);
    if (keyPassphrase != null) {
        args.putString("passphrase", keyPassphrase);
    }
    runCommandDialog.setArguments(args);
    runCommandDialog.show(getSupportFragmentManager(), "runCommand");
}
 
源代码3 项目: RememBirthday   文件: SettingsFragment.java
@Override
public void onDisplayPreferenceDialog(Preference preference) {
    DialogFragment dialogFragment = null;
    if (preference instanceof TimePreference) {
        dialogFragment = new TimePreferenceDialogFragmentCompat();
        Bundle bundle = new Bundle(1);
        bundle.putString("key", preference.getKey());
        dialogFragment.setArguments(bundle);
    }

    // Show dialog
    if (dialogFragment != null) {
        dialogFragment.setTargetFragment(this, 0);
        dialogFragment.show(getChildFragmentManager(), TAG_FRAGMENT_DIALOG);
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
 
源代码4 项目: glimmr   文件: PhotosetsFragment.java
@Override
public void onLongClickDialogSelection(Photoset photoset, int which) {
    Log.d(TAG, "onLongClickDialogSelection()");
    FragmentTransaction ft =
        mActivity.getSupportFragmentManager().beginTransaction();
    ft.setCustomAnimations(android.R.anim.fade_in,
            android.R.anim.fade_out);
    if (photoset != null) {
        Fragment prev = mActivity.getSupportFragmentManager()
            .findFragmentByTag(AddToPhotosetDialogFragment.TAG);
        if (prev != null) {
            ft.remove(prev);
        }
        ft.addToBackStack(null);

        DialogFragment newFragment =
            AddToPhotosetDialogFragment.newInstance(photoset);
        newFragment.show(ft, AddToPhotosetDialogFragment.TAG);
    } else {
        Log.e(TAG, "onLongClickDialogSelection: photoset is null");
    }
}
 
protected void performAction (WifiAuthenticator.AuthAction action) {
	if (action == WifiAuthenticator.AuthAction.DEFAULT)
		return;
	
	if (authParams.authAction != action && isAlwaysDoThat()) {
		authParams.authAction = action;
		wifiAuth.storeAuthAction(action);
	}
	switch (action) {
		case BROWSER : 
			try {
				startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url.toURI().toString())));
			} catch (URISyntaxException e) {	}
			finish();
			break;
		case IGNORE : 
			if (authParams.wifiAction.perform(this))
				finish();
			else {
				DialogFragment dialogDiableWifi = new DisableWifiDialogFragment();
				dialogDiableWifi.show (getSupportFragmentManager(),"DisableWifiDialogFragment");
			}
			break;
	default:
		break;
	}
}
 
源代码6 项目: candybar-library   文件: OtherAppsFragment.java
public static void showOtherAppsDialog(@NonNull FragmentManager fm) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);
    }

    try {
        DialogFragment dialog = OtherAppsFragment.newInstance();
        dialog.show(ft, TAG);
    } catch (IllegalStateException | IllegalArgumentException ignored) {}
}
 
源代码7 项目: gsn   文件: SensorListAdapter.java
private void showDialogDetail(String name) {
	SqliteStorageManager storage = new SqliteStorageManager();
	StringBuilder sb = new StringBuilder("This sensor is used by the following Virtual Sensors:\n");
	for (String s : storage.getVSfromSource(name)) {
		sb.append(" - ").append(s).append("\n");
	}
	DialogFragment newFragment = DetailedDataFragment.newInstance(sb.toString());
	newFragment.show(((FragmentActivity) context).getSupportFragmentManager(), "dialog");
}
 
public static void show(@NonNull final Context context,
        @NonNull final Class<? extends DeleteItemDialogFragment> tClass,
        @NonNull final FragmentManager fragmentManager,
        @NonNull final String tag,
        final long targetId,
        @Nullable final String targetName) {
    final DialogFragment f = (DialogFragment) Fragment.instantiate(context,
            tClass.getCanonicalName(), createArguments(targetId, targetName));
    f.show(fragmentManager, tag);
}
 
源代码9 项目: open_flood   文件: GameActivity.java
private void showEndGameDialog() {
    DialogFragment endGameDialog = new EndGameDialogFragment();
    Bundle args = new Bundle();
    args.putInt("steps", game.getSteps());
    args.putBoolean("game_won", game.checkWin());
    args.putString("seed", game.getSeed());
    endGameDialog.setArguments(args);
    endGameDialog.show(getSupportFragmentManager(), "EndGameDialog");
    return;
}
 
源代码10 项目: AndroidLicensesPage   文件: LicensesFragment.java
/**
 * Builds and displays a licenses fragment with no Close button. Requires
 * "/res/raw/licenses.html" and "/res/layout/licenses_fragment.xml" to be
 * present.
 *
 * @param fm A fragment manager instance used to display this LicensesFragment.
 */
public static void displayLicensesFragment(FragmentManager fm) {
    FragmentTransaction ft = fm.beginTransaction();
    Fragment prev = fm.findFragmentByTag(FRAGMENT_TAG);
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);

    // Create and show the dialog.
    DialogFragment newFragment = LicensesFragment.newInstance();
    newFragment.show(ft, FRAGMENT_TAG);
}
 
源代码11 项目: ShaderEditor   文件: PreferencesFragment.java
@Override
public void onDisplayPreferenceDialog(Preference preference) {
	if (preference instanceof ShaderListPreference) {
		DialogFragment f = ShaderListPreferenceDialogFragment
				.newInstance(preference.getKey());

		f.setTargetFragment(this, 0);
		f.show(getFragmentManager(),
				"ShaderListPreferenceDialogFragment");

		return;
	}

	super.onDisplayPreferenceDialog(preference);
}
 
源代码12 项目: bitcoinpos   文件: MainActivity.java
@Override
// from ItemFragment
public void onListItemClickFragmentInteraction(Item item) {
    DialogFragment myDialog = ItemActionListFragment.newInstance(item.getItemId().toString());
    // for API >= 23 the title is disable by default -- we set a style that enables it
    myDialog.setStyle(DialogFragment.STYLE_NORMAL, R.style.ItemActionListDialogFragment);
    myDialog.show(getSupportFragmentManager(), getString(R.string.item_action_list_dialog_fragment_tag));
}
 
源代码13 项目: 4pdaClient-plus   文件: BricksListDialogFragment.java
public static void showDialog(IBricksListDialogCaller bricksListDialogCaller, String dialogId,
                              String[] brickNames, Bundle args) {
    FragmentTransaction ft = bricksListDialogCaller.getSupportFragmentManager().beginTransaction();
    Fragment prev = bricksListDialogCaller.getSupportFragmentManager().findFragmentByTag(TAG);
    if (prev != null) {
        ft.remove(prev);
    }
    ft.addToBackStack(null);

    // Create and show the dialog.
    DialogFragment newFragment = BricksListDialogFragment.newInstance(dialogId, brickNames, args);
    newFragment.show(ft, TAG);
}
 
源代码14 项目: iBeebo   文件: Utility.java
public static void forceShowDialog(FragmentActivity activity, DialogFragment dialogFragment) {
    try {
        dialogFragment.show(activity.getSupportFragmentManager(), "");
        activity.getSupportFragmentManager().executePendingTransactions();
    } catch (Exception ignored) {

    }
}
 
源代码15 项目: biermacht   文件: EditRecipeActivity.java
@Override
public void onMissedClick(View v) {
  super.onMissedClick(v);

  AlertDialog alert;
  if (v.equals(measuredFGView)) {
    alert = alertBuilder.editTextFloatAlert(measuredFGViewText, measuredFGViewTitle).create();
  }
  else if (v.equals(measuredOGView)) {
    alert = alertBuilder.editTextFloatAlert(measuredOGViewText, measuredOGViewTitle).create();
  }
  else if (v.equals(measuredBatchSizeView)) {
    alert = alertBuilder.editTextFloatAlert(measuredBatchSizeViewText,
                                            measuredBatchSizeViewTitle).create();
  }
  else if (v.equals(brewDateView)) {
    // Show the brew date picker and return.
    DialogFragment newFragment = new DatePickerFragment();
    Bundle args = new Bundle();
    newFragment.setArguments(args);
    newFragment.show(this.getSupportFragmentManager(), "datePicker");
    return;
  }
  else {
    Log.d("EditRecipeActivity", "onMissedClick did not handle the clicked view");
    return; // In case its none of those views...
  }

  // Force keyboard open and show popup
  alert.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
  alert.show();
}
 
源代码16 项目: Walrus   文件: ChameleonMiniRevERebootedActivity.java
@Override
public void onDisplayPreferenceDialog(Preference preference) {
    if (preference instanceof ChameleonMiniSlotPickerPreference) {
        DialogFragment dialogFragment =
                new ChameleonMiniSlotPickerPreference.NumberPickerFragment();
        final Bundle b = new Bundle();
        b.putString("key", preference.getKey());
        dialogFragment.setArguments(b);
        dialogFragment.show(this.getChildFragmentManager(),
                "settings_dialog");
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
 
源代码17 项目: MongoExplorer   文件: BaseActivity.java
private void showAddConnection() {
	DialogFragment fragment = ConnectionEditDialogFragment.newInstance(0);
	fragment.show(getSupportFragmentManager(), null);
}
 
源代码18 项目: three-things-today   文件: MainActivity.java
public void showDatePickerDialog(View v) {
    DialogFragment fragment = DatePickerFragment.newInstance(this, mSelectedYear,
            mSelectedMonth, mSelectedDayOfMonth);
    fragment.show(getSupportFragmentManager(), "DatePicker");
}
 
源代码19 项目: MongoExplorer   文件: DocumentListFragment.java
private void editCollection() {
       DialogFragment fragment = CollectionEditDialogFragment.newInstance(mCollectionIndex);
       fragment.show(getFragmentManager(), null);
}
 
源代码20 项目: zulip-android   文件: ZulipActivity.java
public void showListDialog() {
    // Create an instance of the dialog fragment and show it
    DialogFragment dialog = new ListDialog();
    dialog.show(getSupportFragmentManager(), "ListDialogFragment");
}