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

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

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

Dialog.addContentView介绍

暂无

代码示例

代码示例来源:origin: GeoffLedak/ExoplayerFullscreen

  1. private void openFullscreenDialog() {
  2. ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView);
  3. mFullScreenDialog.addContentView(mExoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
  4. mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fullscreen_skrink));
  5. mExoPlayerFullscreen = true;
  6. mFullScreenDialog.show();
  7. }

代码示例来源:origin: derry/delion

  1. private void showDialogForView(View view) {
  2. Dialog dialog = new Dialog(mContext);
  3. dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  4. dialog.addContentView(view,
  5. new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
  6. LinearLayout.LayoutParams.MATCH_PARENT));
  7. dialog.show();
  8. }

代码示例来源:origin: GitEliteNovice/CustomCamera

  1. private void openFullscreenDialog() {
  2. ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView);
  3. mFullScreenDialog.addContentView(mExoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
  4. mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(DetailedImageVideo.this, R.drawable.ic_fullscreen_exit_white_24dp));
  5. mExoPlayerFullscreen = true;
  6. mFullScreenDialog.show();
  7. }

代码示例来源:origin: derry/delion

  1. /** Displays the ConnectionInfoPopup. */
  2. @CalledByNative
  3. private void showDialog() {
  4. ScrollView scrollView = new ScrollView(mContext);
  5. scrollView.addView(mContainer);
  6. mDialog.addContentView(scrollView,
  7. new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
  8. LinearLayout.LayoutParams.MATCH_PARENT));
  9. mDialog.getWindow().setLayout(
  10. ViewGroup.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
  11. mDialog.show();
  12. }

代码示例来源:origin: derry/delion

  1. private void showDialogForView(View view) {
  2. mDialog = new Dialog(mActivity);
  3. mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  4. mDialog.addContentView(view,
  5. new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
  6. LinearLayout.LayoutParams.MATCH_PARENT));
  7. mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
  8. @Override
  9. public void onDismiss(DialogInterface dialog) {
  10. mItemSelectedCallback.onItemSelected("");
  11. }
  12. });
  13. Window window = mDialog.getWindow();
  14. if (!DeviceFormFactor.isTablet(mActivity)) {
  15. // On smaller screens, make the dialog fill the width of the screen,
  16. // and appear at the top.
  17. window.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
  18. window.setGravity(Gravity.TOP);
  19. window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
  20. ViewGroup.LayoutParams.WRAP_CONTENT);
  21. }
  22. mDialog.show();
  23. }

代码示例来源:origin: GeoffLedak/ExoplayerFullscreen

  1. @Override
  2. protected void onResume() {
  3. super.onResume();
  4. if (mExoPlayerView == null) {
  5. mExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.exoplayer);
  6. initFullscreenDialog();
  7. initFullscreenButton();
  8. String streamUrl = "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8";
  9. String userAgent = Util.getUserAgent(MainActivity.this, getApplicationContext().getApplicationInfo().packageName);
  10. DefaultHttpDataSourceFactory httpDataSourceFactory = new DefaultHttpDataSourceFactory(userAgent, null, DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS, DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS, true);
  11. DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(MainActivity.this, null, httpDataSourceFactory);
  12. Uri daUri = Uri.parse(streamUrl);
  13. mVideoSource = new HlsMediaSource(daUri, dataSourceFactory, 1, null, null);
  14. }
  15. initExoPlayer();
  16. if (mExoPlayerFullscreen) {
  17. ((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView);
  18. mFullScreenDialog.addContentView(mExoPlayerView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
  19. mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_fullscreen_skrink));
  20. mFullScreenDialog.show();
  21. }
  22. }

代码示例来源:origin: hubing8658/UPnP-DLNA-Demo

  1. ListView lvMDP = new ListView(this);
  2. LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  3. dialog.addContentView(lvMDP, params);
  4. dialog.setTitle(R.string.select_render);
  5. dialog.show();

代码示例来源:origin: derry/delion

  1. mDialog.addContentView(scrollView, new LinearLayout.LayoutParams(
  2. LinearLayout.LayoutParams.MATCH_PARENT,
  3. LinearLayout.LayoutParams.MATCH_PARENT));
  4. mDialog.addContentView(scrollView, new LinearLayout.LayoutParams(
  5. LinearLayout.LayoutParams.WRAP_CONTENT,
  6. LinearLayout.LayoutParams.MATCH_PARENT));

代码示例来源:origin: derry/delion

  1. mDialog.addContentView(mFullContainer,
  2. new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

相关文章