Ответ 1
О цвете акцента. Вы используете тему AppCompat, чтобы удалить Android из пространства имен внутри своей темы.
<style name="AppTheme_Light" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/abc1</item>
<item name="colorPrimaryDark">@color/abc2</item>
<item name="colorAccent">@color/abc3</item>
</style>
О диалоговом окне. AppCompat не поддерживает его (как я знаю).
Вы можете попробовать использовать этот стиль в папке значений-v21:
<style name="Theme" parent="FrameworkRoot.Theme">
<item name="android:alertDialogTheme">@style/Theme.AlertDialog</item>
</style>
<style name="Theme.AlertDialog" parent="android:Theme.Material.Light.Dialog.Alert">
<item name="android:colorPrimary">@color/demo_primary_color</item>
<item name="android:colorPrimaryDark">@color/demo_colorPrimaryDark</item>
<item name="android:colorAccent">@color/theme_accent_1</item>
</style>
ОБНОВЛЕНИЕ 23/04/2015: ПОДДЕРЖКА БИБЛИОТЕКА V.22.1
Новый support library v22.1
работает с диалоговым окном.
Вы можете использовать android.support.v7.app.AlertDialog или новый AppCompatDialog.
Например:
import android.support.v7.app.AlertDialog
AlertDialog.Builder builder =
new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
builder.setTitle("Dialog");
builder.setMessage("Lorem ipsum dolor ....");
builder.setPositiveButton("OK", null);
builder.setNegativeButton("Cancel", null);
builder.show();
И используйте такой стиль:
<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>
В противном случае вы можете определить в текущей теме:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- your style -->
<item name="alertDialogTheme">@style/AppCompatAlertDialogStyle</item>
</style>
а затем в вашем коде:
import android.support.v7.app.AlertDialog
AlertDialog.Builder builder =
new AlertDialog.Builder(this);