Show qr code in "Share your audio" dialog

Test: atest
Bug: 381775542
Flag: com.android.settingslib.flags.enable_le_audio_sharing
Change-Id: I6fe339beb50803989d4110fca681e609d2d600c1
This commit is contained in:
chelseahao
2025-01-23 13:35:11 +08:00
parent cc0c66a7ee
commit b6ba9c3bbc
6 changed files with 128 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ package com.android.settings.connecteddevice.audiosharing;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
@@ -147,7 +148,7 @@ public class AudioSharingDialogFactory {
/**
* Sets the custom image of the dialog custom body.
*
* @param iconRes The text to be used for the title.
* @param iconRes The iconRes to be used for the image.
* @return This builder.
*/
@NonNull
@@ -158,6 +159,20 @@ public class AudioSharingDialogFactory {
return this;
}
/**
* Sets the custom image of the dialog custom body.
*
* @param bitmap The bitmap to be used for the image.
* @return This builder.
*/
@NonNull
public AudioSharingDialogFactory.DialogBuilder setCustomImage(Bitmap bitmap) {
ImageView image = mCustomBody.findViewById(R.id.description_image);
image.setImageBitmap(bitmap);
image.setVisibility(View.VISIBLE);
return this;
}
/**
* Sets the custom message of the dialog custom body.
*