お世話になっております。
Android開発初心者です。
AlertDialogにて画像の埋め込みと位置の調節をしたく質問をいたしました。
以下の画像のようにAlertDialogを表示しました。
上記の位置取りを一行にしたいのですがパーツの仕組みを理解しておらず
うまく実装できていない状況です。
円になっている個所を「設定確認中…」の左右どちらかに配置したいです。
前提として
・ProgressDialogはAndroid8.0にて非推奨となりましたので使用しない
表示のソースと画像のxmlを添付いたします。
ご存じあればご教示お願いいたします。
AlertDialog
1 /** 設定待ちダイアログ. */ 2 public static class ProgressDialogFR extends DialogFragment { 3 /** ダイアログメッセージ用。setArguments時のキー. */ 4 private static final String MESSAGE = "message"; 5 6 /** 7 * 新しいインスタンスを作成する. 8 * @param msg ダイアログメッセージ 9 * @return ProgressDialogFR 10 */ 11 public static ProgressDialogFR newInstance(final String msg) { 12 ProgressDialogFR fragment = new ProgressDialogFR(); 13 Bundle args = new Bundle(); 14 fragment.setCancelable(false); 15 args.putString(MESSAGE, msg); 16 fragment.setArguments(args); 17 //fragment. 18 return fragment; 19 } 20 21 @Override 22 public final Dialog onCreateDialog(final Bundle savedInstanceState) { 23 AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppThemeBlackDialog); 24 25 LayoutInflater inflater = getActivity().getLayoutInflater(); 26 27 View view = inflater.inflate(R.layout.dialog_progress, null); 28 builder.setView(view); 29 builder.setMessage(getArguments().getString(MESSAGE)); 30 return builder.create(); 31 } 32 }
dialog
1<?xml version="1.0" encoding="utf-8"?> 2<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:app="http://schemas.android.com/apk/res-auto" 4 android:layout_width="wrap_content" 5 android:layout_height="wrap_content"> 6 7 <ProgressBar xmlns:android="http://schemas.android.com/apk/res/android" 8 android:id="@+id/progress" 9 android:layout_width="80dp" 10 android:layout_height="80dp" 11 android:layout_gravity="center" 12 android:layout_marginLeft="16dp" 13 android:layout_marginTop="16dp" 14 app:layout_constraintLeft_toLeftOf="parent" 15 app:layout_constraintTop_toTopOf="parent" 16 app:layout_constraintBottom_toBottomOf="parent" 17 android:layout_marginBottom="16dp" /> 18</android.support.constraint.ConstraintLayout>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。