question

AbhayL-5080 avatar image
0 Votes"
AbhayL-5080 asked RobCaplan edited

CrossMedia.Current.PickPhotoAsync change Title & Color

I'm using Changing Title and Title background to pickup a file.

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.79476-color.jpg


dotnet-xamarin
color.jpg (19.8 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

From the source code of MediaPlugin, we can find class MediaImplementation and class MediaPickerActivity, so we know that the function of the picking media is implemented by the nuget itself. So If you want to change the UI, you can download the source code and change the code according to your requirement. Or you can post a new issue here:https://github.com/jamesmontemagno/MediaPlugin/issues


0 Votes 0 ·

0 Answers