本文整理汇总了Java中android.support.v4.app.DialogFragment.setArguments方法的典型用法代码示例。如果您正苦于以下问题:Java DialogFragment.setArguments方法的具体用法?Java DialogFragment.setArguments怎么用?Java DialogFragment.setArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.DialogFragment
的用法示例。
在下文中一共展示了DialogFragment.setArguments方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newInstance
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
/**
* Factory method for creating the DialogFragment with a listener.
* @param item QuadrantItem being manipulated
* @param listener Listener for passing back the information to update item in QuadrantItem
* @return New EditItemDialogFragment instance
*/
public static DialogFragment newInstance(QuadrantItem item, ModifyItemListener listener,
String title) {
// Initialize new EditItemDialogFragment fragment
DialogFragment dialog = new EditItemDialogFragment();
// Pass itemUid to onCreateDialog
Bundle args = new Bundle();
args.putParcelable("quadrantItem", item);
dialog.setArguments(args);
// Set the listener
((EditItemDialogFragment) dialog).setListener(listener);
((ModifyItemDialogFragment) dialog).setTitle(title);
// Return the dialog
return dialog;
}
示例2: onOptionsItemSelected
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return (true);
case R.id.cancel_all_downloads:
Bundle CancelDownloadDialogFragmentBundle = new Bundle();
if (downlandProgressRecyclerViewAdapter != null) {
CancelDownloadDialogFragmentBundle.putInt(KEY_NUMBER_OF_BOOKS_TO_DONLOAD,
downlandProgressRecyclerViewAdapter.getItemCount());
DialogFragment CancelDownloadDialogFragment = new CancelDownloadDialogFragment();
CancelDownloadDialogFragment.setArguments(CancelDownloadDialogFragmentBundle);
CancelDownloadDialogFragment.show(getSupportFragmentManager(), "CancelDownloadDialogFragment");
} else {
Timber.d("downlandProgressRecyclerViewAdapter null");
}
return true;
}
return (super.onOptionsItemSelected(item));
}
示例3: showMarkEpisodeDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private synchronized void showMarkEpisodeDialog(int type) {
if (mAnime == null)
return;
final FragmentManager fm = getFragmentManager();
if (fm == null)
return;
// Create the fragment and show it as a dialog.
dismissDialog();
DialogFragment newFragment = new MarkEpisodeDialog();
newFragment.setTargetFragment(this, 0);
Bundle bundle = new Bundle();
bundle.putInt("type", type);
bundle.putInt("itype", InputType.TYPE_CLASS_NUMBER);
bundle.putInt("itype2", InputType.TYPE_CLASS_NUMBER);
bundle.putInt("min", 0);
bundle.putInt("max", mAnime.getEpisodes().size());
newFragment.setArguments(bundle);
newFragment.show(fm,
"mcdfragment");
}
示例4: pickDate
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void pickDate(View view) {
/* This function is called when the user presses the "pick the date" button. */
//Create the arguments for the fragment:
Bundle defaultDate = new Bundle();
defaultDate.putInt("year", startingTime.get(Calendar.YEAR));
defaultDate.putInt("month", startingTime.get(Calendar.MONTH));
defaultDate.putInt("day", startingTime.get(Calendar.DAY_OF_MONTH));
//This fragment will allow the user to pick the date, with the default being the date that was picked before:
DialogFragment dateFragment = new DriveDateFragment();
dateFragment.setArguments(defaultDate);
//Start the date fragment:
dateFragment.show(getSupportFragmentManager(), "DriveDateFragment");
}
示例5: pickTime
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public void pickTime(Calendar driveTime) {
//Create the arguments for the fragment:
Bundle defaultTime = new Bundle();
defaultTime.putInt("hour", driveTime.get(Calendar.HOUR_OF_DAY));
defaultTime.putInt("minute", driveTime.get(Calendar.MINUTE));
//This fragment will allow the user to pick the date:
DialogFragment timeFragment = new DriveTimeFragment();
timeFragment.setArguments(defaultTime);
//Start the date fragment:
timeFragment.show(getSupportFragmentManager(), "DriveTimeFragment");
}
示例6: showRenameDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void showRenameDialog(BooksCollection booksCollection) {
Bundle confirmBatchDownloadDialogFragmentBundle = new Bundle();
confirmBatchDownloadDialogFragmentBundle.putString(KEY_OLD_NAME, booksCollection.getName());
Gson gson = new Gson();
String json = gson.toJson(booksCollection);
confirmBatchDownloadDialogFragmentBundle.putString(KEY_COLLECTION_GSON, json);
DialogFragment renameCollectionDialogFragment = new RenameCollectionDialogFragment();
renameCollectionDialogFragment.setArguments(confirmBatchDownloadDialogFragmentBundle);
renameCollectionDialogFragment.show(getSupportFragmentManager(), "renameCollectionDialogFragment");
}
示例7: onActionItemClicked
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
boolean onActionItemClicked(MenuItem item) {
if (item.getItemId() == R.id.batch_download) {
mBooksToDownload.clear();
mBooksToDownload.addAll(selectedBooksIds);
HashSet<Integer> downloadedHashSet = mBooksInformationDbHelper.getBooksIdsFilteredOnDownloadStatus(
BooksInformationDBContract.StoredBooks.COLUMN_NAME_STATUS + ">?",
new String[]{String.valueOf(DownloadsConstants.STATUS_DOWNLOAD_STARTED)}
);
boolean isSelectionModified = mBooksToDownload.removeAll(downloadedHashSet);
if (mBooksToDownload.size() != 0) {
if (mBooksToDownload.size() == 1) {
startBatchDownload();
onDestroyActionMode();
} else {
if (isSelectionModified) {
Toast.makeText(BrowsingActivity.this, R.string.removed_selection_of_downloaded_books, Toast.LENGTH_LONG).show();
}
Bundle confirmBatchDownloadDialogFragmentBundle = new Bundle();
confirmBatchDownloadDialogFragmentBundle.putInt(KEY_NUMBER_OF_BOOKS_TO_DONLOAD, mBooksToDownload.size());
DialogFragment confirmBatchDownloadDialogFragment = new ConfirmBatchDownloadDialogFragment();
confirmBatchDownloadDialogFragment.setArguments(confirmBatchDownloadDialogFragmentBundle);
confirmBatchDownloadDialogFragment.show(getSupportFragmentManager(), "ConfirmBatchDownloadDialogFragment");
onDestroyActionMode();
}
} else {
Toast.makeText(BrowsingActivity.this, R.string.toast_all_selected_books_already_downlaoded, Toast.LENGTH_LONG).show();
}
} else if (item.getItemId() == R.id.select_all) {
addAllBooksToSelection(shouldDisplayDownloadedOnly());
} else if (item.getItemId() == R.id.clear_selection) {
removeAllSelectedBooks();
}
return false;
}
示例8: getInstance
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
public static DialogFragment getInstance(final String name, final boolean duplicate) {
final DialogFragment dialog = new UARTNewConfigurationDialogFragment();
final Bundle args = new Bundle();
args.putString(NAME, name);
args.putBoolean(DUPLICATE, duplicate);
dialog.setArguments(args);
return dialog;
}
示例9: onSortSelected
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onSortSelected(SharedPreferencesHelper preferences) {
mSharedPreferencesHelper = preferences;
mCurrentSort = preferences.getSortBy();
DialogFragment dialog = new SortItemsDialogFragment();
Bundle bundle = new Bundle();
bundle.putInt(EXTRA_SORT_BY, mCurrentSort);
dialog.setArguments(bundle);
dialog.show(getSupportFragmentManager(), "SortItemsDialogFragment");
}
示例10: onClicked
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
/**
*
* @param index
* @param boomButton
*/
@Override
public void onClicked(int index, BoomButton boomButton) {
DialogFragment newContent = null;
switch (index) {
case MainActivity.SEND_BOOM_INDEX:
newContent = new SendFragment();
break;
case MainActivity.RECEIVE_BOOM_INDEX:
if (_mainAct.getLastSyncedMessage() == null) return;
List<String> addrs = _mainAct.getLastSyncedMessage().getAddresses();
if (addrs.size() > 0) {
String lastAddr = addrs.get(addrs.size() - 1);
newContent = new ReceiveFragment();
Bundle receiveData = new Bundle();
receiveData.putString(ReceiveFragment.DATA_KEY_ADDR, lastAddr);
newContent.setArguments(receiveData);
}
break;
default:
break;
}
FragmentTransaction ft = _mainAct.getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.fade_in, R.anim.fade_out);
ft.replace(R.id.xwallet_content_layout, newContent);
ft.commit();
}
示例11: showRequestChallengeDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private void showRequestChallengeDialog() {
DialogFragment dialog = new ReceiveChallengeDialogFragment();
Bundle args = new Bundle();
args.putSerializable("type", requestMessage.getChallengeType());
args.putInt("firstValue", requestMessage.getFirstValue());
args.putInt("secondValue", requestMessage.getSecondValue());
args.putString("sender", requestMessage.getSender());
dialog.setArguments(args);
dialog.show(getSupportFragmentManager(), "ReceiveChallengeDialogFragment");
}
示例12: showAcceptScheduleDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private void showAcceptScheduleDialog() {
DialogFragment dialog = new ReceiveScheduleDialogFragment();
Bundle args = new Bundle();
args.putSerializable("type", requestMessage.getChallengeType());
args.putString("sender", requestMessage.getSender());
args.putSerializable("date", requestMessage.getTime());
dialog.setArguments(args);
dialog.show(getSupportFragmentManager(), "ReceiveScheduleDialogFragment");
}
示例13: showMemoDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
private void showMemoDialog(){
DialogFragment dialog = new MemoDialogFragment();
Bundle args = new Bundle();
args.putSerializable("type", requestMessage.getChallengeType());
args.putString("opponent", requestMessage.getFrom());
args.putString("sender", requestMessage.getSender());
args.putSerializable("date", requestMessage.getTime());
args.putString("opponentEmail", requestMessage.getFrom());
dialog.setArguments(args);
dialog.show(getSupportFragmentManager(), "MemoDialogFragment");
}