android.app.Dialog.hide()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(241)

本文整理了Java中android.app.Dialog.hide()方法的一些代码示例,展示了Dialog.hide()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialog.hide()方法的具体详情如下:
包路径:android.app.Dialog
类名称:Dialog
方法名:hide

Dialog.hide介绍

暂无

代码示例

代码示例来源:origin: AlphaBoom/ClassifyView

/**
 * 隐藏次级窗口
 */
public void hideSubContainer() {
  if (mSubDialog == null) return;
  mSubDialog.hide();
}

代码示例来源:origin: onionApps/Chat.onion

@Override
  public void onClick(View v) {
    dlg.hide();
    ((android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE)).setText(address);
    snack(getString(R.string.id_copied_to_clipboard) + address);
  }
});

代码示例来源:origin: grzegorznittner/chanu

public void hide() {
  mDialog.hide();
}

代码示例来源:origin: onionApps/Chat.onion

@Override
  public void onClick(View v) {
    dlg.hide();
    new AlertDialog.Builder(MainActivity.this)
        .setTitle(R.string.delete_contact_q)
        .setMessage(String.format(getString(R.string.really_delete_contact), address))
        .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
            db.removeContact(address);
            updateContactList();
          }
        })
        .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
          }
        })
        .show();
    //db.removeContact(address);
    //updateContactList();
  }
});

代码示例来源:origin: yaozs/YzsBaseActivity

@Override
public void hide() {
  if(progressBar!= null){
    progressBar.stop();
  }
  super.hide();
}

代码示例来源:origin: kingargyle/adt-leanback-support

@Override
public void onStop() {
  super.onStop();
  if (mDialog != null) {
    mDialog.hide();
  }
}

代码示例来源:origin: fg607/RelaxFinger

public void hideFuncDialog() {
  if (mFuncDialog != null) {
    mFuncDialog.getDialog().hide();
  }
}

代码示例来源:origin: com.google.android/support-v4

@Override
public void onStop() {
  super.onStop();
  if (mDialog != null) {
    mDialog.hide();
  }
}

代码示例来源:origin: yaozs/YzsBaseActivity

@Override
public void hide() {
  if (null != yzsLoading) {
    yzsLoading.clearAnimation();
  }
  super.hide();
}

代码示例来源:origin: fg607/RelaxFinger

@Override
  public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
      getDialog().hide();
      currentMenuMapTemp.clear();
      return true;
    }
    return false;
  }
});

代码示例来源:origin: HenriDellal/emerald

@Override
  protected void showDialog(Bundle b) {
    super.showDialog(b);
    if (Build.VERSION.SDK_INT >= 19) {
      // the SAF dialog is shown already
      this.getDialog().hide();
    }
  }
}

代码示例来源:origin: Microsoft/AppCenter-SDK-Android

/**
 * Check if dialog should be restored in the new activity. Hiding previous dialog version if any.
 *
 * @param dialog existing dialog if any, always returning true when null.
 * @return true if a new dialog should be displayed, false otherwise.
 */
private boolean shouldRefreshDialog(@Nullable Dialog dialog) {
  /* We could be in another activity now, refresh dialog. */
  if (dialog != null) {
    /* Nothing to if resuming same activity with dialog already displayed. */
    if (dialog.isShowing()) {
      if (mForegroundActivity == mLastActivityWithDialog.get()) {
        AppCenterLog.debug(LOG_TAG, "Previous dialog is still being shown in the same activity.");
        return false;
      }
      /* Otherwise replace dialog. */
      dialog.hide();
    }
  }
  return true;
}

代码示例来源:origin: milosmns/silly-android

@Override
public void hideAll() {
  for (Dialog iDialog : mDialogInstances.values()) {
    if (iDialog.isShowing()) {
      iDialog.hide();
    }
  }
  for (DialogFragment iDialogFragment : mDialogFragmentInstances.values()) {
    if (iDialogFragment.getDialog() != null && iDialogFragment.getDialog().isShowing()) {
      iDialogFragment.getDialog().hide();
    }
  }
}

代码示例来源:origin: fg607/RelaxFinger

getDialog().hide();

代码示例来源:origin: milosmns/silly-android

@NonNull
private Dialog createDialogMock() {
  final Dialog dialogMock = mock(Dialog.class);
  when(dialogMock.getContext()).thenReturn(mock(Context.class));
  final AtomicBoolean showing = new AtomicBoolean(false);
  // mock showing
  doAnswer(invocation -> {
    showing.set(true);
    return null;
  }).when(dialogMock).show();
  // mock hiding
  doAnswer(invocation -> {
    showing.set(false);
    return null;
  }).when(dialogMock).hide();
  // mock dismissal
  doAnswer(invocation -> {
    showing.set(false);
    return null;
  }).when(dialogMock).dismiss();
  // mock the 'isShowing' check
  when(dialogMock.isShowing()).thenAnswer(invocation -> showing.get());
  return dialogMock;
}

代码示例来源:origin: milosmns/silly-android

@Test
public void isDialogShowing() {
  // setup the callback
  final DialogManagerCallback callback = createCallbackMock();
  final Dialog dialogMock = createDialogMock();
  when(callback.onCreateDialog(eq(KNOWN_DIALOG), isNull())).thenReturn(dialogMock);
  mDialogManager.setCallback(callback);
  mDialogManager.showDialog(KNOWN_DIALOG);
  // check if dialog was shown
  assertTrue(mDialogManager.isDialogShowing(KNOWN_DIALOG));
  dialogMock.hide();
  assertFalse(mDialogManager.isDialogShowing(KNOWN_DIALOG));
}

相关文章