ventana studio personalizado emergente ejemplo edittext dialogo custom cuadro crear con android themes appcompat material-design material-theme

studio - dialogo con edittext android



Uso de un tema de diálogo basado en materiales con AppCompat (4)

Esto debería funcionar para usted: https://github.com/afollestad/material-dialogs

Lo utilicé para construir el diálogo en un DialogFragment , con estilos personalizados aplicados. Funciona genial.

Tengo una actividad en mi Manifiesto que solía estilizar con un tema de diálogo. No puedo encontrar cómo reemplazar esto en la biblioteca AppCompat .

<activity android:name=".LoginActivity" android:theme="@android:styles/Theme.Holo.Dialog" android:configChanges="orientation|screenSize|keyboardHidden" android:label="Login" >

¿Hay un equivalente basado en materiales?


No hay un tema basado en material para un diálogo en AppCompat todavía, vea here

Will appcompat automatically theme dialogs to look like the Lollipop version?

Respuesta

Not yet, but it''s on the todo list.

Actualizar:

En la versión 22.1 de la Support Library , ahora puede obtener el estilo de diálogo del material utilizando AppCompatDialog


Utiliza la última biblioteca de Appcompat

compile ''com.android.support:appcompat-v7:23.2.1''// or any version greater than 22.1

y en Manifiesto usar el siguiente tema.

android:theme="@style/Theme.AppCompat.Light.Dialog"


Código Java

AlertDialog.Builder builder = new AlertDialog.Builder(SecondActivity.this, R.style.AppCompatAlertDialogStyle); builder.setTitle("SCRUM"); builder.setMessage("In the SCRUM methodology a sprint is the basic unit of development. Each sprint is preceded by a planning meeting, where the tasks for the sprint are identified and an estimated commitment for the sprint goal is made, and followed by a review or retrospective meeting where the progress is reviewed and lessons for the next sprint are identified. During each sprint, the team creates finished portions of a product....."); builder.setPositiveButton("OK", null);//second parameter used for onclicklistener builder.setNegativeButton("Cancel", null); builder.show();

Usa este tema

<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert"> <item name="colorAccent">#FFCC00</item> <item name="android:textColorPrimary">#FFFFFF</item> <item name="android:background">#5fa3d0</item> </style>

Importar soporte v7 diálogo de alerta

import android.support.v7.app.AlertDialog;

Salida como esta,