Update audio sharing dialog text.

Also add a radius to the qr code image.

Test: atest
Bug: 381775542
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Change-Id: I6b06b02f63bc46ec20b7a9e0aa236f2547a5f612
This commit is contained in:
chelseahao
2025-01-24 13:12:24 +08:00
committed by Chelsea Hao
parent b6ba9c3bbc
commit e7ccbf436e
9 changed files with 90 additions and 29 deletions

View File

@@ -18,7 +18,7 @@ package com.android.settings.connecteddevice.audiosharing;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
@@ -162,13 +162,13 @@ public class AudioSharingDialogFactory {
/**
* Sets the custom image of the dialog custom body.
*
* @param bitmap The bitmap to be used for the image.
* @param drawable The drawable to be used for the image.
* @return This builder.
*/
@NonNull
public AudioSharingDialogFactory.DialogBuilder setCustomImage(Bitmap bitmap) {
public AudioSharingDialogFactory.DialogBuilder setCustomImage(Drawable drawable) {
ImageView image = mCustomBody.findViewById(R.id.description_image);
image.setImageBitmap(bitmap);
image.setImageDrawable(drawable);
image.setVisibility(View.VISIBLE);
return this;
}
@@ -202,6 +202,21 @@ public class AudioSharingDialogFactory {
return this;
}
/**
* Sets the custom message below image.
*
* @param messageRes Resource ID of the string to be used for the message body.
* @return This builder.
*/
@NonNull
public AudioSharingDialogFactory.DialogBuilder setCustomMessage2(
@StringRes int messageRes) {
TextView subTitle = mCustomBody.findViewById(R.id.description_text_2);
subTitle.setText(messageRes);
subTitle.setVisibility(View.VISIBLE);
return this;
}
/**
* Sets the custom device actions of the dialog custom body.
*