Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
Android Widget with Glance make around corners for SDK lower than 31

Announcing Jetpack Glance Alpha for app widgets. However rounded corners do not work for SDK lower than 31 (Android 12). Ideally, you would want to change the background color with rounded corners programmatically.

Does anyone have an idea for a workaround for this issue?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I faced this issue. And, I solved the problem with background drawable. Give background drawable to your root.

MyWidgetClass.kt

    @Composable
    override fun Content() {
        Column(
            modifier = GlanceModifier
                .width(170.dp).height(130.dp)
                .background(ImageProvider(R.drawable.background_widget))
                .padding(8.dp)
        ) {
            //...
        }
    }

background_widget.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#FFFFFFFF" />

    <corners android:radius="10dp" />
</shape>
over 4 years ago · Santiago Trujillo Denunciar

0

An easy way to add rounded corners is this, but it works for Android S +.

@Composable
override fun Content() {
    Column(
        modifier = GlanceModifier
            .width(170.dp).height(130.dp)
            .background(color = Color.Gray)
            .cornerRadius(8.dp)
    ) {
        //...
    }
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda