Example #1
0
        public static void SetBar(Activity activity, String title, String recentTitle, int imageResource)
        {
            if (controlColor == Color.LightGray)
            {
                controlColor = new Color(82, 121, 143);
            }
            activity.ActionBar.SetBackgroundDrawable(new ColorDrawable(controlColor));
            activity.ActionBar.Title = title;


            Bitmap bm = BitmapFactory.DecodeResource(activity.Resources, imageResource);

            ActivityManager.TaskDescription taskDesc = new ActivityManager.TaskDescription(recentTitle, bm, controlColor);
            activity.SetTaskDescription(taskDesc);

            Window window = activity.Window;

            window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
            window.ClearFlags(WindowManagerFlags.TranslucentStatus);



            //set the status bar to a slight darker color
            window.SetStatusBarColor(new Color((int)(controlColor.R * 0.8f), (int)(controlColor.G * 0.8f), (int)(controlColor.B * 0.8f)));
            //window.SetStatusBarColor(controlColor);
            window.SetNavigationBarColor(controlColor);
        }
		/**
		 * Creates a new ActivityManager.TaskDescription witha  new label and icon to change the 
		 * appearance of this activity in the recents stack.
		 */ 
		private ActivityManager.TaskDescription NewTaskDescription()
		{
			Bitmap newIcon = BitmapFactory.DecodeResource (Resources,Resource.Drawable.new_icon);
			string newDocumentRecentsLabel = GetString (Resource.String.new_document_recents_label);
			var newTaskDescription = new ActivityManager.TaskDescription (newDocumentRecentsLabel, newIcon);
			return newTaskDescription;
		}
        /**
         * Creates a new ActivityManager.TaskDescription witha  new label and icon to change the
         * appearance of this activity in the recents stack.
         */
        private ActivityManager.TaskDescription NewTaskDescription()
        {
            Bitmap newIcon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.new_icon);
            string newDocumentRecentsLabel = GetString(Resource.String.new_document_recents_label);
            var    newTaskDescription      = new ActivityManager.TaskDescription(newDocumentRecentsLabel, newIcon);

            return(newTaskDescription);
        }
Example #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SplashLayout);

            if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
            {
                var iconBitmap      = BitmapFactory.DecodeResource(Resources, Resource.Drawable.Icon);
                var taskDescription = new ActivityManager.TaskDescription("Twitter Safari", iconBitmap, Color.ParseColor("#555555"));
                SetTaskDescription(taskDescription);
            }
        }
Example #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if ((int)Build.VERSION.SdkInt >= 21)
            {
                //TODO: Fix color
                var taskDesc = new ActivityManager.TaskDescription(Title,
                                                                   BitmapFactory.DecodeResource(this.Resources, Resource.Drawable.ic_launcher_white), Color.DarkGray);
                SetTaskDescription(taskDesc);
            }
            MediaBrowser = new MediaBrowserCompat(this, new ComponentName(this, Java.Lang.Class.FromType((typeof(MusicService)))), new MediaBrowserCallBack {
                Parent = this
            }, null);
        }
Example #6
0
        /// <summary>
        /// Called when the activity is first created, in this case, when the application opens
        /// </summary>
        /// <param name="savedInstanceState"></param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Store a color defined in Resources/colors.xml in a variable
            Color KavLachayimColor = new Color(ContextCompat.GetColor(this, Resource.Color.kavlachayim));
            //Store an image stored in Resources/drawable in a variable of type Bitmap
            Bitmap bm = BitmapFactory.DecodeResource(Resources, Resource.Drawable.logo_white);

            //Change the properties of the TaskDescription for the application (what's shown when you see the application in
            //the recents screen / "task manager")

            ActivityManager.TaskDescription td = new ActivityManager.TaskDescription("קו לחיים", bm, KavLachayimColor);
            SetTaskDescription(td);

            //Start the MainActivity activity
            StartActivity(typeof(MainActivity));
        }
Example #7
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);
            //Store a color defined in Resources/colors.xml in a variable
            Android.Graphics.Color KavLachayimColor = new Android.Graphics.Color(ContextCompat.GetColor(this, Resource.Color.kavlachayim));
            //Store an image stored in Resources/drawable in a variable of type Bitmap
            Bitmap bm = BitmapFactory.DecodeResource(Resources, Resource.Drawable.logo_white);

            //Change the properties of the TaskDescription for the application (what's shown when you see the application in
            //the recents screen / "task manager")

            ActivityManager.TaskDescription td = new ActivityManager.TaskDescription("קו לחיים", bm, KavLachayimColor);
            SetTaskDescription(td);

            Forms.Init(this, bundle);
            CarouselViewRenderer.Init(); //Init CarouselViewRenderer
            LoadApplication(new App());
        }