jamesmontemagno / MediaPlugin

Take & Pick Photos and Video Plugin for Xamarin and Windows
MIT License
711 stars 360 forks source link

Change the Action Bar color & Title on Select a Photo UI. #928

Closed abhaylakkad closed 2 years ago

abhaylakkad commented 3 years ago

When navigated to show the Albums/Pick files, the default color of Action Bar is Blue. I tried to override the action bar color from my application but no Luck.

In my main application i called it like below - var file = await CrossMedia.Current.PickPhotoAsync();

In Android application i tried to override the color like below - public class MainApplication : Application, Application.IActivityLifecycleCallbacks { public MainApplication(IntPtr handle, JniHandleOwnership transer) : base(handle, transer) { } public override void OnCreate() { base.OnCreate(); RegisterActivityLifecycleCallbacks(this); }

public void OnActivityCreated(Activity activity, Bundle savedInstanceState) { if (activity != null) {

         activity.Window.ClearFlags(WindowManagerFlags.TranslucentStatus);
        activity.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
       activity.Window.SetStatusBarColor(Android.Graphics.Color.LightPink);
         activity.Window.SetTitleColor(Android.Graphics.Color.LightPink);
     }
     CrossCurrentActivity.Current.Activity = activity;

} }

The title bar color works fine inside my application... i want to make the color same when i click the browse button and it opens the UI to choose file. temp1

jamesmontemagno commented 2 years ago

Nope, it is the device displaying that not the plugin