当前位置: 首页>>代码示例>>Java>>正文


Java DialogFragment.setArguments方法代码示例

本文整理汇总了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;
}
 
开发者ID:Austin-Ray,项目名称:Hexis,代码行数:25,代码来源:EditItemDialogFragment.java

示例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));
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:24,代码来源:DownloadProgressActivity.java

示例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");
}
 
开发者ID:SalmanTKhan,项目名称:MyAnimeViewer,代码行数:21,代码来源:AnimeMaterialListFragment.java

示例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");
}
 
开发者ID:brianjaustin,项目名称:permitlog-android,代码行数:14,代码来源:CustomDriveDialog.java

示例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");
}
 
开发者ID:brianjaustin,项目名称:permitlog-android,代码行数:12,代码来源:CustomDriveDialog.java

示例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");

}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:13,代码来源:BrowsingActivity.java

示例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;
}
 
开发者ID:fekracomputers,项目名称:IslamicLibraryAndroid,代码行数:39,代码来源:BrowsingActivity.java

示例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;
}
 
开发者ID:runtimeco,项目名称:Android-DFU-App,代码行数:11,代码来源:UARTNewConfigurationDialogFragment.java

示例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");
}
 
开发者ID:mvescovo,项目名称:item-reaper,代码行数:11,代码来源:ItemsActivity.java

示例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();
}
 
开发者ID:ehanoc,项目名称:xwallet,代码行数:38,代码来源:MainBoomListener.java

示例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");
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:12,代码来源:SideBarActivity.java

示例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");
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:10,代码来源:SideBarActivity.java

示例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");
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:12,代码来源:SideBarActivity.java


注:本文中的android.support.v4.app.DialogFragment.setArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。