示例#1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            //"a16fe3fa136e7b54b24664bb2a3c647e"
            ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader));
            ActionBar.SetBackgroundDrawable (colorDrawable);

            //fb = new FacebookClient ();
            appId = Intent.GetStringExtra ("AppId");
            extendedPermissions = Intent.GetStringExtra ("ExtendedPermissions");
            url = GetFacebookLoginUrl (appId, extendedPermissions);

            WebView webView = new WebView(this);
            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.SetSupportZoom(true);
            webView.Settings.BuiltInZoomControls = true;
            webView.Settings.LoadWithOverviewMode = true; //Load 100% zoomed out
            webView.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
            webView.ScrollbarFadingEnabled = true;

            webView.VerticalScrollBarEnabled = true;
            webView.HorizontalScrollBarEnabled = true;

            webView.SetWebViewClient(new FBWebClient (this));
            webView.SetWebChromeClient(new FBWebChromeClient (this));

            AddContentView(webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));

            webView.LoadUrl(url);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            int calcNo = Intent.GetIntExtra("CalculationType",-1);

            SetContentView (Resource.Layout.PercentDrawer);

            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawerLayout);
            drawerLayout.SetBackgroundColor(Android.Graphics.Color.AntiqueWhite);
            ColorDrawable colorDrawable = new ColorDrawable (Color.Black);
            this.ActionBar.SetBackgroundDrawable (colorDrawable);

            drawerToggle = new ActionBarDrawerToggle (this, drawerLayout, Resource.String.DrawerOpenDescription, Resource.String.DrawerCloseDescription);

            drawerLayout.SetDrawerListener (drawerToggle);

            drawerListView = FindViewById<ListView> (Resource.Id.drawerListView);
            drawerListView.Adapter = new ArrayAdapter<string> (this, Android.Resource.Layout.SimpleListItem1, calculationTitles);
            drawerListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => OnMenuItemClick(e.Position);
            drawerListView.SetItemChecked (calcNo, true);
            OnMenuItemClick (calcNo);

            ActionBar.SetDisplayHomeAsUpEnabled (true);
        }
        protected override void OnCreate(Bundle savedInstanceState) {
            base.OnCreate(savedInstanceState);
            
            var pos = 0;
            if (Intent.Extras != null)
                pos = Intent.Extras.GetInt("pos");

            var birds = Resources.GetStringArray(Resource.Array.birds);
            var imgs = Resources.ObtainTypedArray(Resource.Array.birds_img);
            var resId = imgs.GetResourceId(pos, -1);

            Title = birds[pos];
            Window.RequestFeature(WindowFeatures.ActionBarOverlay);
            var color = new ColorDrawable(Color.Black);
            color.SetAlpha(128);
            ActionBar.SetBackgroundDrawable(color);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            _handler = new Handler();

            var imageView = new ImageView(this);
            imageView.SetScaleType(ImageView.ScaleType.CenterInside);
            imageView.SetImageResource(resId);
            imageView.Click += (sender, args) =>
                {
                    ActionBar.Show();
                    HideActionBarDelayed(_handler);
                };
            SetContentView(imageView);
            Window.SetBackgroundDrawableResource(Android.Resource.Color.BackgroundDark);
        }
示例#4
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.RegisterActivity);
			ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader));
			ActionBar.SetBackgroundDrawable (colorDrawable); 

			TxtName = FindViewById<EditText> (Resource.Id.TxtName);
			TxtLastName = FindViewById<EditText> (Resource.Id.TxtLastName);
			TxtEmail = FindViewById<EditText> (Resource.Id.TxtEmail);
			TxtEdad = FindViewById<EditText> (Resource.Id.TxtEdad);
			TxtPassword = FindViewById<EditText> (Resource.Id.TxtPassword);

			BntContinuar = FindViewById<Button> (Resource.Id.BntContinuar);
			BntContinuar.Click+= CuntinuarClick;

			try {
				Account[] accounts = AccountManager.Get (this).GetAccountsByType ("com.google");

				foreach (Account account in accounts) {

					if (!string.IsNullOrEmpty (account.Name)) {
						TxtEmail.Text = account.Name;
						return;
					}

					//accountsList.add(item);
				}
			} catch (Exception) {
				return;
			}

		}
示例#5
0
 public AddTabbedRenderer()
 {
     activity = this.Context as Activity;
     ActionBar actionBar = activity.ActionBar;
     ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.ParseColor(COLOUR));
     actionBar.SetStackedBackgroundDrawable(colorDrawable);
 }
示例#6
0
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.TabbedPage> e)
        {
            base.OnElementChanged(e);

            var a = this.Context as Activity;
            var drb = new Android.Graphics.Drawables.ColorDrawable(Color.White.ToAndroid());
            a.ActionBar.SetStackedBackgroundDrawable(drb);
        }
示例#7
0
 protected override void OnWindowVisibilityChanged(Android.Views.ViewStates visibility)
 {
     base.OnWindowVisibilityChanged(visibility);
     var actionBar = activity.ActionBar;
     var colorDrawable = new ColorDrawable(Android.Graphics.Color.Red);
     actionBar.SetStackedBackgroundDrawable(colorDrawable);
     ActionBarTabsSetup(actionBar);
 }
示例#8
0
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.TabbedPage> e)
        {
            base.OnElementChanged(e);

            var a   = this.Context as Activity;
            var drb = new Android.Graphics.Drawables.ColorDrawable(Color.White.ToAndroid());

            a.ActionBar.SetStackedBackgroundDrawable(drb);
        }
		protected override void OnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Button> e)
		{
			base.OnElementChanged(e);

			if (Control != null)
			{
				var color = GetColor();
				var drawable = new ColorDrawable(color);
				Control.Background = drawable;
			}
		}
        public static void Initialize(Context context)
        {
            var wm = context.GetSystemService(Context.WindowService).JavaCast<IWindowManager>();
            var displayMetrics = new DisplayMetrics();
            wm.DefaultDisplay.GetMetrics(displayMetrics);
            density = displayMetrics.Density;

            var bg = new TypedValue();
            context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorBackground, bg, true);
            DefaultBackground = new ColorDrawable(new Color(bg.Data));
        }
        protected override void OnWindowVisibilityChanged(ViewStates visibility)
        {
            base.OnWindowVisibilityChanged(visibility);
            if (isFirstTime)
            {
                ActionBar actionBar = activity.ActionBar;

                ColorDrawable colorDrawable = new ColorDrawable(Styling.BarColor.ToAndroid());
                actionBar.SetStackedBackgroundDrawable(colorDrawable);
                isFirstTime = false;
            }
        }
示例#12
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			SetContentView (Resource.Layout.OperatorActivity);

			ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader));
			ActionBar.SetBackgroundDrawable (colorDrawable); 

			BtnOperator = FindViewById<Button> (Resource.Id.BtnOperator);
			TxtOperator = FindViewById<TextView> (Resource.Id.TxtOperator);
			BntContinuar = FindViewById<Button> (Resource.Id.BntContinuar);

			TxtMobil= FindViewById<TextView> (Resource.Id.TxtMobil);

			BntContinuar.Click += ContinuarClick;
			BntContinuar.Enabled= false;
			BtnOperator.Click += (sender, e) => {


				List<string> Item = new List<string> ();


				Item.Add ("CLARO");
				Item.Add ("TIGO");
				Item.Add ("MOVISTAR");
				Item.Add ("UFF!");
				Item.Add ("AVANTEL");
				Item.Add ("VIRGIN");

				AlertDialog.Builder builder = new AlertDialog.Builder (this);
				builder.SetTitle ("LISTA  DE OPERADORES");
				builder.SetSingleChoiceItems (Item.ToArray (), -1, delegate(object  Sender, DialogClickEventArgs  E) {

					TxtOperator.Text = Item [E.Which];
					BntContinuar.Enabled= true;

				});

				builder.SetPositiveButton ("Ok", delegate { 

				

				});
				builder.Show ();


			};

		


		}
示例#13
0
        public CubeAnimationView(Context context) : base(context)
        {
            Visibility = ViewStates.Visible;
            Activated  = true;
            Background = new Android.Graphics.Drawables.ColorDrawable(Color.Black);
            Touch     += RedrawCube;

            Rect r = new Rect();

            GetWindowVisibleDisplayFrame(r);

            bm = Bitmap.CreateBitmap(r.Width(), r.Height(), Bitmap.Config.Argb8888);
        }
示例#14
0
        public ActionSheet(Context context) : base(context, Android.Resource.Style.ThemeLightNoTitleBar)// 全屏
        {

            this._mContext = context;
            InitViews();
            if (Window != null)
            {
                Window.SetGravity(GravityFlags.Bottom);
                Drawable drawable = new ColorDrawable();
                drawable.Alpha = 0;// 去除黑色背景
                Window.SetBackgroundDrawable(drawable);
            }
        }
示例#15
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();

            LoadApplication(new AdminApp());
            ImageCircleRenderer.Init();

            ColorDrawable colorDrawable = new ColorDrawable(Resources.GetColor(Resource.Color.material_blue_500));
            ActionBar.SetStackedBackgroundDrawable(colorDrawable);
            //ActionBar.SetSplitBackgroundDrawable(new ColorDrawable(Color.White));
        }
        public static PointStyle CreatePointStyle(PointStyleInfo styleInfo, AssetManager assetManager)
        {
            Drawable drawable = null;
            if (!string.IsNullOrWhiteSpace(styleInfo.ImageUrl))
            {
                drawable = CreateBitmapDrawable(styleInfo.ImageUrl, assetManager);
            }
            else
            {
                drawable = new ColorDrawable(CreateColor(styleInfo.SolidColor));    
            }

            return new PointStyle(drawable);
        }
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);
			SetContentView(Resource.Layout.activity_filepicker);

			FileListFragment fileListFragment = new FileListFragment (FileListFragment.DefaultInitialDirectory);
			SupportFragmentManager.BeginTransaction().Add (Resource.Id.fragment_container_filepicker, fileListFragment).Commit ();

			//Change color of action bar
			ColorDrawable colorDrawable;
			if (!String.IsNullOrEmpty (HomeActivity.colorOfSelectedLocalBox)) {
				colorDrawable = new ColorDrawable (Color.ParseColor (HomeActivity.colorOfSelectedLocalBox));
			} else {
				colorDrawable = new ColorDrawable (Color.ParseColor (Constants.lightblue));
			}
			this.ActionBar.SetBackgroundDrawable (colorDrawable); 
		}
示例#18
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView (Resource.Layout.PublicAcivity);

			ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader));
			ActionBar.SetBackgroundDrawable (colorDrawable); 

			WebView = FindViewById<WebView> (Resource.Id.Webview);

			ProGWebview = FindViewById<ProgressBar> (Resource.Id.ProGWebview);
			PrgBViews = FindViewById<ProgressBar> (Resource.Id.PrgBViews);
			LnYNext = FindViewById<LinearLayout> (Resource.Id.LnYNext);
			LnYNext.SetBackgroundColor (Color.ParseColor (Helpers.ColorHeader));


			imageButton1 = FindViewById<ImageButton> (Resource.Id.imageButton1);
			imageButton2 = FindViewById<ImageButton> (Resource.Id.imageButton2);
			imageButton3 = FindViewById<ImageButton> (Resource.Id.imageButton3);
			imageButton4 = FindViewById<ImageButton> (Resource.Id.imageButton4);
			imageButton5 = FindViewById<ImageButton> (Resource.Id.imageButton5);

			TxtPuntosR=FindViewById<TextView>(Resource.Id.TxtPuntosR);
			TxtPuntosRR=FindViewById<TextView>(Resource.Id.TxtPuntosRR);

			PrgBViews.Max = 6;

			WebView.Settings.JavaScriptEnabled = true;
			WebView.Settings.LoadsImagesAutomatically = true;
			WebView.SetWebViewClient (new BulletinWebViewClient (this, ProGWebview));

			imageButton1.Click+= (sender, e) => ValidaControl((ImageButton)sender);
			imageButton2.Click+= (sender, e) => ValidaControl((ImageButton)sender);
			imageButton3.Click+= (sender, e) => ValidaControl((ImageButton)sender);
			imageButton4.Click+= (sender, e) => ValidaControl((ImageButton)sender);
			imageButton5.Click+= (sender, e) => ValidaControl((ImageButton)sender);

			var telephonyManager = (TelephonyManager) GetSystemService(TelephonyService);

			Imei = telephonyManager.DeviceId;

			DatoUser = GetUserDatos ();



		}
示例#19
0
		private void ChangeColor(Color newColor) {
			tabs.SetBackgroundColor(newColor);
		
			// change ActionBar color just if an ActionBar is available
			Drawable colorDrawable = new ColorDrawable(newColor);
			Drawable bottomDrawable = new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent));
			LayerDrawable ld = new LayerDrawable(new Drawable[]{colorDrawable, bottomDrawable});
			if (oldBackground == null) {
				SupportActionBar.SetBackgroundDrawable(ld);
			} else {
				TransitionDrawable td = new TransitionDrawable(new Drawable[]{oldBackground, ld});
				SupportActionBar.SetBackgroundDrawable(td);
				td.StartTransition(200);
			}

			oldBackground = ld;
			currentColor = newColor;
		}
示例#20
0
		protected override void OnCreate(global::Android.OS.Bundle bundle)
		{
			if(InsightsManager.IsEnabled)
				Xamarin.Insights.Initialize(Keys.InsightsApiKey, this);

			AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
			{
				try
				{
					var ex = ((Exception)e.ExceptionObject).GetBaseException();
					Console.WriteLine("**SPORT MAIN ACTIVITY EXCEPTION**\n\n" + ex);
					InsightsManager.Report(ex, Xamarin.Insights.Severity.Critical);
				}
				catch
				{
				}
			};

			try
			{
				base.OnCreate(bundle);
				Window.SetSoftInputMode(SoftInput.AdjustPan);
				Xamarin.Forms.Forms.Init(this, bundle);
				ImageCircleRenderer.Init();

				//We're using the value of the StyleId as the content description for use w/ Xamarin UITest / XTC
				Xamarin.Forms.Forms.ViewInitialized += (sender, e) =>
				{
					if(!string.IsNullOrWhiteSpace(e.View.StyleId))
					{
						e.NativeView.ContentDescription = e.View.StyleId;
					}
				};

				LoadApplication(new App());

				var color = new ColorDrawable(Color.Transparent);
				ActionBar.SetIcon(color);
			}
			catch(Exception e)
			{
				Debug.WriteLine(e);
			}
		}
示例#21
0
        //@Override
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //Window.RequestFeature(WindowFeatures.ActionBarOverlay);
            int pos = 0;
            if (Intent.Extras != null)
            {
                pos = Intent.Extras.GetInt("pos");
            }

            string[] birds = Resources.GetStringArray(Resource.Array.birds);
            TypedArray imgs = Resources.ObtainTypedArray(Resource.Array.birds_img);
            int resId = imgs.GetResourceId(pos, -1);

            Title = birds[pos];
            //Window.RequestFeature(WindowFeatures.ActionBarOverlay);
            ColorDrawable color = new ColorDrawable(Color.Black);
            color.SetAlpha(128);

            SupportActionBar.SetBackgroundDrawable(color);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            mHandler = new Handler();

            ImageView imageView = new ImageView(this);
            imageView.SetScaleType(Android.Widget.ImageView.ScaleType.CenterInside);
            imageView.SetImageResource(resId);
            //imageView.setOnClickListener(new OnClickListener() {
            //    public void onClick(View v) {
            //        getSupportActionBar().show();
            //        hideActionBarDelayed(mHandler);
            //    }
            //});
            imageView.Click += delegate
            {
                SupportActionBar.Show();
                hideActionBarDelayed(mHandler);
            };

            SetContentView(imageView);
            this.Window.SetBackgroundDrawableResource(Android.Resource.Color.Black);
        }
示例#22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            intent = new Intent (this, typeof(PercentDrawer));

            var layout = FindViewById<LinearLayout> (Resource.Id.mainLayout);
            layout.SetBackgroundColor (Android.Graphics.Color.AntiqueWhite);

            ColorDrawable colorDrawable = new ColorDrawable (Color.Black);
            this.ActionBar.SetBackgroundDrawable (colorDrawable);

            var listView = FindViewById<ListView> (Resource.Id.mainListView);

            listView.Adapter = new MainAdapter (this, CalculationData.Calculations);

            listView.ItemClick += ListView_ItemClick;
        }
示例#23
0
        public static Drawable ColorWithBorders(this IStyleSheet styleSheet, IStyledObject control, Color color)
        {
            IStyleSheetHelper helper = styleSheet.Helper;
            Drawable drawable;
            if (styleSheet.Helper.HasBorder(control))
            {
                var shape = new GradientDrawable();
                var borderWidth = (int)Math.Round(helper.BorderWidth(control));
                Color borderColor = ToColorOrTransparent(helper.BorderColor(control));

                shape.SetShape(ShapeType.Rectangle);
                shape.SetColor(color);
                shape.SetCornerRadius(helper.BorderRadius(control));
                shape.SetStroke(borderWidth, borderColor);
                drawable = shape;
            }
            else
                drawable = new ColorDrawable(color);
            return drawable;
        }
示例#24
0
 public Attributes(Context context)
 {
     _mContext = context;
     Background = new ColorDrawable(Color.Transparent);
     CancelButtonBackground = new ColorDrawable(Color.Black);
     ColorDrawable gray = new ColorDrawable(Color.Gray);
     OtherButtonTopBackground = gray;
     OtherButtonMiddleBackground = gray;
     OtherButtonBottomBackground = gray;
     OtherButtonSingleBackground = gray;
     CancelButtonTextColor = Color.White;
     OtherButtonTextColor = Color.Black;
     Padding = Dp2Px(20);
     OtherButtonSpacing = Dp2Px(2);
     CancelButtonMarginTop = Dp2Px(10);
     ActionSheetTextSize = Dp2Px(16);
 }
示例#25
0
        public static bool BackgroundChanged(this IStyleHelper helper
            , IStyleSheet styleSheet, IBound bound, out Drawable background, bool whithoutImage = false)
        {
            if (!whithoutImage)
            {
                IBackgroundImage image;
                if (helper.TryGet(out image) && !string.IsNullOrWhiteSpace(image.Path))
                {
                    background = styleSheet.GetCache<ImageCache>().GetImage(image.Path, bound.Width, bound.Height);
                    return true;
                }

                // if control has background image, we have to ignore background color
                if (!string.IsNullOrWhiteSpace(image.Path))
                {
                    background = null;
                    return false;
                }
            }

            IBackgroundColor backgroundColor;
            IBorderStyle borderStyle;
            IBorderWidth borderWidth;
            IBorderColor borderColor;
            IBorderRadius borderRadius;
            if (helper.TryGet(out backgroundColor) | helper.TryGet(out borderStyle) | helper.TryGet(out borderWidth)
                | helper.TryGet(out borderColor) | helper.TryGet(out borderRadius))
            {
                if (borderStyle.Style == BorderStyleValues.Solid)
                {
                    var shape = new GradientDrawable();
                    var width = (int)Math.Round(borderWidth.Value);
                    Color color = borderColor.ToColorOrTransparent();

                    shape.SetShape(ShapeType.Rectangle);
                    shape.SetColor(backgroundColor.ToColorOrTransparent());
                    shape.SetCornerRadius(borderRadius.Radius);
                    shape.SetStroke(width, color);
                    background = shape;
                }
                else
                    background = new ColorDrawable(backgroundColor.ToColorOrTransparent());
                return true;
            }

            background = null;
            return false;
        }
		private void ChangeColor(Color newColor)
		{
			_tabs.IndicatorColor = newColor;
			_tabs.TextColor = newColor;

			// change ActionBar color just if an ActionBar is available
			if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Honeycomb)
			{

				Drawable colorDrawable = new ColorDrawable(newColor);
				Drawable bottomDrawable = Resources.GetDrawable(Resource.Drawable.actionbar_bottom);
				LayerDrawable ld = new LayerDrawable(new Drawable[] { colorDrawable, bottomDrawable });

				if (_oldBackground == null)
				{

					if ((int)Build.VERSION.SdkInt < 17)
					{
						ld.Callback = _drawableCallback;
					}
					else
					{
						ActionBar.SetBackgroundDrawable(ld);
					}
				}
				else
				{
					TransitionDrawable td = new TransitionDrawable(new Drawable[] { _oldBackground, ld });

					// workaround for broken ActionBarContainer drawable handling on
					// pre-API 17 builds
					// https://github.com/android/platform_frameworks_base/commit/a7cc06d82e45918c37429a59b14545c6a57db4e4
					if ((int)Build.VERSION.SdkInt < 17)
					{
						td.Callback = _drawableCallback;
					}
					else
					{
						ActionBar.SetBackgroundDrawable(td);
					}

					td.StartTransition(200);

				}

				_oldBackground = ld;

				// http://stackoverflow.com/questions/11002691/actionbar-setbackgrounddrawable-nulling-background-from-thread-handler
				ActionBar.SetDisplayShowTitleEnabled(false);
				ActionBar.SetDisplayShowTitleEnabled(true);
			}

			_currentColor = newColor;
		}
示例#27
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            SetContentView (Resource.Layout.InitActivity);
            ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Colores.BaseColo));

            ActionBar.SetBackgroundDrawable (colorDrawable);
            ActionBar.SetIcon (Resource.Drawable.ic_action_icon);
            ActionBar.SetDisplayHomeAsUpEnabled (true);
            ActionBar.SetHomeButtonEnabled (true);

            _title = _drawerTitle = Title;

            try {

                _drawer = FindViewById<DrawerLayout> (Resource.Id.drawer_layout);
                _drawerList = FindViewById<ListView> (Resource.Id.left_drawer);
                LoadMenu (2);
                var inputView = this.LayoutInflater.Inflate (Resource.Layout.ProcessBarView, null);

                ImgLogo = inputView.FindViewById<ImageView> (Resource.Id.ImgLogo);
                TxtEntrar = inputView.FindViewById<TextView> (Resource.Id.TxtEntrar);
                TxtContact = inputView.FindViewById<TextView> (Resource.Id.TxtContact);

                _drawerList.AddHeaderView (inputView);

                _drawer.SetDrawerShadow (Resource.Drawable.drawer_shadow_dark, (int)GravityFlags.Left);

                _drawerList.ItemClick += (sender, args) => SelectItem (args.Position);

                _drawerToggle = new MyActionBarDrawerToggle (this, _drawer,
                    Resource.Drawable.ic_drawer_light,
                    Resource.String.DrawerOpen,
                    Resource.String.DrawerClose);

                _drawerToggle.DrawerClosed += delegate {
                    ActionBar.Title = _title;
                    InvalidateOptionsMenu ();
                };

                _drawerToggle.DrawerOpened += delegate {
                    ActionBar.Title = _drawerTitle;
                    InvalidateOptionsMenu ();
                    LoadUserDatos ();
                };

                _drawer.SetDrawerListener (_drawerToggle);

                if (bundle == null) {
                    SelectItem (1);
                }

                LoadUserDatos ();

            } catch (Exception) {
                return;
            }
        }
示例#28
0
        private void SetTab(int categoryId)
        {
            GetList(categoryId, subCategoryId);

            if (categoryId == 1)
            {
                ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.Rgb(255, 0, 0));
                ActionBar.SetBackgroundDrawable(colorDrawable);
                Toast.MakeText(this, "ACTIVATE", ToastLength.Short).Show();
            }
            else if (categoryId == 2)
            {
                ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.Rgb(0, 128, 255));
                ActionBar.SetBackgroundDrawable(colorDrawable);
                Toast.MakeText(this, "TRAIN", ToastLength.Short).Show();
            }
            else if (categoryId == 3)
            {
                ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.Rgb(174, 180, 4));
                ActionBar.SetBackgroundDrawable(colorDrawable);
                Toast.MakeText(this, "RECOVER", ToastLength.Short).Show();
            }
        }
示例#29
0
        private CatalogStatus getVideos(int categoryId, int subcategoryId)
        {
            CatalogStatus status;
            var authkey = AppConfig.Auth_Token;

            if (categoryId == 1)
            {
                ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.Rgb(255, 0, 0));
                ActionBar.SetBackgroundDrawable(colorDrawable);
            }
            else if (categoryId == 2)
            {
                ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.Rgb(0, 128, 255));
                ActionBar.SetBackgroundDrawable(colorDrawable);
            }
            else if (categoryId == 3)
            {
                ColorDrawable colorDrawable = new ColorDrawable(Android.Graphics.Color.Rgb(174, 180, 4));
                ActionBar.SetBackgroundDrawable(colorDrawable);
            }

            subcategoryId = 0;
            string jsonInput = "{\"categoryid\":\"" + categoryId + "\",\"subcategoryid\":\"" + subcategoryId + "\",\"authtoken\":\"" + AppConfig.Auth_Token + "\"}";
            var catalogJson = ServerCommunication.ServerCallWebRequest(AppConfig.URL_GET_VIDEOS, jsonInput);
            catalogResponse = JsonConvert.DeserializeObject<CatalogResponse>(catalogJson);
            response = catalogResponse.Response;

            if (catalogResponse.Response.status == "success")
            {
                status = CatalogStatus.SUCCESS;
            }
            else
            {
                status = CatalogStatus.FAILED;
            }
            return status;
        }
示例#30
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.LoginActivitys);

            ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader));
            ActionBar.SetBackgroundDrawable (colorDrawable);

            BtnFacebook = FindViewById<Button> (Resource.Id.BtnFacebook);
            BtnRegister = FindViewById<Button> (Resource.Id.BtnRegister);
            BtnLogin = FindViewById<Button> (Resource.Id.BtnLogin);

            TxtLogin = FindViewById<EditText> (Resource.Id.TxtLogin);
            TxtPwd = FindViewById<EditText> (Resource.Id.TxtPwd);
            BtnFacebook.Visibility = ViewStates.Gone;

            #if DEBUG

            TxtLogin.Text="*****@*****.**";
            TxtPwd.Text="123456";

            #endif

            BtnRegister.Click += (sender, e) => {

                var datosActivity = new Intent (this, typeof(RegisterActivity));
                StartActivity (datosActivity);

            };

            BtnFacebook.Click += (sender, e) => {
                var webAuth = new Intent (this, typeof(FBWebViewAuthActivity));
                webAuth.PutExtra ("AppId", AppId);
                webAuth.PutExtra ("ExtendedPermissions", ExtendedPermissions);
                StartActivityForResult (webAuth, 0);
            };

            BtnLogin.Click += async (sender, e) => {

                if (TxtLogin.Text == string.Empty) {
                    TxtLogin.SetError ("Digite su Email", null);
                    TxtLogin.RequestFocus ();
                    return;
                }

                if (TxtPwd.Text == string.Empty) {
                    TxtPwd.SetError ("Digite su Contraseña", null);
                    TxtPwd.RequestFocus ();
                    return;
                }

                _ProgressDialog = ProgressDialog.Show (this, "Por favor espera...", "Procesando info...", true);

                ResultMsg<Users> user=	await _Bussines.Login (TxtLogin.Text, TxtPwd.Text);

                _ProgressDialog.Dismiss();

                if(user!=null && user.Dato!=null){

                    this.SetUserDatos(user.Dato);
                    var datosActivity = new Intent (this, typeof(GridActivity));
                    StartActivity (datosActivity);
                    Finish();

                }else{

                    Toast.MakeText (ApplicationContext, "Error: Su Usuario o Contraseña es erradas", ToastLength.Long).Show ();
                }

            };

            try {
                Account[] accounts = AccountManager.Get (this).GetAccountsByType ("com.google");

                foreach (Account account in accounts) {

                    if (!string.IsNullOrEmpty (account.Name)) {
                        TxtLogin.Text = account.Name;
                        return;
                    }

                    //accountsList.add(item);
                }
            } catch (Exception) {
                return;
            }
        }