Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UserDialogs custom UI in MVVMCross

I am using UserDialogs library in my MVVMCross project. The following code has been tested and works perfectly fine, I could able to see Loading Dialog. The issue that I have, how could I able to change the color of the circular loading progress in order to match with my theme?

private async Testing ()
{
   using (Mvx.Resolve<IUserDialogs>().Loading("Loading..."))
   {
     await PutTaskDelay();
   }
}

async Task PutTaskDelay()
{
     await Task.Delay(2000);
}
like image 702
casillas Avatar asked Jun 30 '16 19:06

casillas


1 Answers

You can supply AppCompat dialog themes using styles.xml:

<style name="Base.Theme.App" parent="Theme.AppCompat.DayNight.NoActionBar">
    ...
    <item name="dialogTheme">@style/Base.Theme.Dialog.App</item>
    <item name="alertDialogTheme">@style/Base.Theme.AlertDialog.App</item>
</style>

<style name="Base.Theme.Dialog.App" parent="Theme.AppCompat.DayNight.Dialog">
  <item name="colorAccent">@color/accent</item>
</style>

<style name="Base.Theme.AlertDialog.App" parent="Theme.AppCompat.DayNight.Dialog.Alert">
  <item name="colorAccent">@color/accent</item>
</style>

This will change the color of the progress widget in the ACR.UserDialogs library, along with the negative/positive/neutral action buttons. See more information here: How to Use and Style the new AlertDialog from appCompat 22.1 and above

like image 148
Trevor Balcom Avatar answered Sep 27 '22 21:09

Trevor Balcom