public CircleImageView(Context context, IAttributeSet attrs, int defStyle)
			: base(context, attrs, defStyle)
		{

			// init paint
			paint = new Paint();
			paint.AntiAlias = true;

			paintBorder = new Paint();
			paintBorder.AntiAlias = true;

			// load the styled attributes and set their properties
			TypedArray attributes = context.ObtainStyledAttributes(attrs, Resource.Styleable.CircularImageView, defStyle, 0);

			if (attributes.GetBoolean(Resource.Styleable.CircularImageView_border, true))
			{
				int defaultBorderSize = (int)(4 * context.Resources.DisplayMetrics.Density+ 0.5f);
				BorderWidth = attributes.GetDimensionPixelOffset(Resource.Styleable.CircularImageView_border_width, defaultBorderSize);
				BorderColor = attributes.GetColor(Resource.Styleable.CircularImageView_border_color, Color.White);
			}

			if (attributes.GetBoolean(Resource.Styleable.CircularImageView_shadow, false))
			{
				addShadow();
			}
		}
Exemplo n.º 2
1
 public TeamFindMemberAdapter(Context context,global::Android.Support.V4.App.Fragment fragment,List<Tap5050PotentialTeamMemberInfo> list,EventCard card)
 {
     nn_fragment = fragment;
     nn_context = context;
     nn_list = list;
     nn_card = card;
 }
Exemplo n.º 3
0
 public static Typeface GetTypeface(Context context, string font)
 {
     var key = AssetsRoot + font;
     if (!cache.ContainsKey(key))
         cache[key] = Typeface.CreateFromAsset(context.Assets, key);
     return cache[key];
 }
 public AddEventToCalAction(Context context, Intent intent, int drawable, string url)
 {
     Drawable = drawable;
     Context = context;
     Intent = intent;
     Url = url;
 }
 public MvxViewPagerFragmentAdapter(
   Context context, FragmentManager fragmentManager, IEnumerable<FragmentInfo> fragments)
     : base(fragmentManager)
 {
     _context = context;
     Fragments = fragments;
 }
		public CustomInfoWindow (Context context, ViewGroup viewGroup, List<CustomPin> pins)
		{
			_context = context;
			_viewGroup = viewGroup;
			_pins = pins;

		}
		public ProgressDialogHelper(Context context) {
			this.progress = new ProgressDialog(context);
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.Indeterminate = false;
			progress.Progress = 99;
			progress.SetCanceledOnTouchOutside(false);
		}
Exemplo n.º 8
0
		public static AppData Instance (Context cxt)
		{
			if (instance == null) {
				instance = new AppData (cxt);
			}
			return instance;
		}
        public MonoGameAndroidGameView(Context context, AndroidGameWindow androidGameWindow, Game game)
            : base(context)
        {
            _gameWindow = androidGameWindow;
			_game = game;
            _touchManager = new AndroidTouchEventManager(androidGameWindow);
        }
 public MvxLayoutDrivenAdapter(Context context, IMvxLayoutListItemViewFactory defaultItemLayout,
                               Dictionary<string, IMvxLayoutListItemViewFactory> itemLayouts)
     : base(context)
 {
     _defaultItemLayout = defaultItemLayout;
     _itemLayouts = itemLayouts;
 }
 public SmoothStreamingRendererBuilder(Context context, string userAgent, string url, IMediaDrmCallback drmCallback)
 {
     _context = context;
     _userAgent = userAgent;
     _url = ExoPlayerUtil.ToLowerInvariant(url).EndsWith("/manifest") ? url : url + "/Manifest";
     _drmCallback = drmCallback;
 }
 public ProgressButton(Context context, IAttributeSet attrs,
     int defStyle)
     : base(context, attrs, defStyle)
 {
     ResourceIdManager.UpdateIdValues();
     Initialize(context, attrs, defStyle);
 }
Exemplo n.º 13
0
        public void displayTracks(string track, Context c, Action<string> callback)
        {
            if (checkForNetwork() != true)
            {
                callback(NETFAULT);
            }
            else
            {
                POHWS.webservice.Service1 Service3 = new POHWS.webservice.Service1();
                string retStr = "";
                Service3.BeginGetTrack(track, delegate(IAsyncResult iar)
                    {
                        POHWS.webservice.Track tableData = Service3.EndGetTrack(iar);
            #if DEBUG
                        Console.WriteLine("in displayTracks : track = {0}, tableData.Content = {1}.", track, tableData.Content);
            #endif
                        Android.App.Application.SynchronizationContext.Post(delegate
                            {
                                string uri = "StyleSheet.css";
                                string settings = string.Empty;

                                var input = c.Assets.Open(uri);
                                using (StreamReader sr = new System.IO.StreamReader(input))
                                {
                                    settings = sr.ReadToEnd();
                                }

                                string CSS = "<html><head><style>" + settings + "</style></head><body style='height:600px;background: url(file:///android_asset/Back_AQHA.png)' >";
                                retStr = CSS + tableData.Content + "</body></html>";
                                callback(retStr);
                            }, null);
                    }, null);
            }
        }
Exemplo n.º 14
0
 public void Apply(IMenu menu, Context context, object parent)
 {
     PlatformExtensions.ValidateTemplate(ItemsSource, Items);
     var setter = new XmlPropertySetter<IMenu>(menu, context, new BindingSet());
     menu.SetBindingMemberValue(AttachedMembers.Object.Parent, parent);
     setter.SetBinding(nameof(DataContext), DataContext, false);
     setter.SetBoolProperty(nameof(IsVisible), IsVisible);
     setter.SetBoolProperty(nameof(IsEnabled), IsEnabled);
     if (!string.IsNullOrEmpty(Bind))
         setter.BindingSet.BindFromExpression(menu, Bind);
     if (string.IsNullOrEmpty(ItemsSource))
     {
         if (Items != null)
         {
             for (int index = 0; index < Items.Count; index++)
                 Items[index].Apply(menu, context, index, index);
         }
     }
     else
     {
         menu.SetBindingMemberValue(AttachedMembers.Menu.ItemsSourceGenerator, new MenuItemsSourceGenerator(menu, context, ItemTemplate));
         setter.SetBinding(nameof(ItemsSource), ItemsSource, true);
     }
     setter.Apply();
 }
Exemplo n.º 15
0
        private void Initialize (Context ctx)
        {
            var dm = ctx.Resources.DisplayMetrics;
            var inflater = LayoutInflater.FromContext (ctx);

            overlayInset = (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, 45, dm);

            backgroundView = new SliceView (ctx) {
                StartAngle = 0,
                EndAngle = 360,
                Color = emptyPieColor,
            };
            AddView (backgroundView);

            loadingOverlayView = inflater.Inflate (Resource.Layout.PieChartLoading, this, false);
            AddView (loadingOverlayView);

            emptyOverlayView = inflater.Inflate (Resource.Layout.PieChartEmpty, this, false);
            emptyOverlayView.Visibility = ViewStates.Gone;
            AddView (emptyOverlayView);

            statsOverlayView = inflater.Inflate (Resource.Layout.PieChartStats, this, false);
            statsOverlayView.Visibility = ViewStates.Gone;
            AddView (statsOverlayView);

            statsTimeTextView = statsOverlayView.FindViewById<TextView> (Resource.Id.TimeTextView);
            statsMoneyTextView = statsOverlayView.FindViewById<TextView> (Resource.Id.MoneyTextView);

            Click += delegate {
                // Deselect slices on click. The Clickable property is set to true only when a slice is selected.
                ActiveSlice = -1;
            };
            Clickable = false;
        }
        public virtual View CreateView(View parent, string name, Context context, IAttributeSet attrs)
        {
            // resolve the tag name to a type
            var viewType = ViewTypeResolver.Resolve(name);

            if (viewType == null)
            {
                //MvxBindingTrace.Trace(MvxTraceLevel.Error, "View type not found - {0}", name);
                return null;
            }

            try
            {
                var view = Activator.CreateInstance(viewType, context, attrs) as View;
                if (view == null)
                {
                    MvxBindingTrace.Trace(MvxTraceLevel.Error, "Unable to load view {0} from type {1}", name,
                                          viewType.FullName);
                }
                return view;
            }
            catch (ThreadAbortException)
            {
                throw;
            }
            catch (Exception exception)
            {
                MvxBindingTrace.Trace(MvxTraceLevel.Error,
                                      "Exception during creation of {0} from type {1} - exception {2}", name,
                                      viewType.FullName, exception.ToLongString());
                return null;
            }
        }
Exemplo n.º 17
0
		public SampleBrowser(Context context, IGraphicsContext graphicsContext, IWindowInfo windowInfo)
		{
			// TODO: Complete member initialization
			this.androidContext = context;
			this.GLGraphicsContext = graphicsContext;
			this.GlWindowInfo = windowInfo;
		}
Exemplo n.º 18
0
		public UpdateChecker(Context ctx, DataBaseWrapper db, Setting setting) {
			if (string.IsNullOrEmpty (setting.NewestVersion)) {
				setting.NewestVersion = Setting.CurrentVersion;
			}
			var connectivityManager = (ConnectivityManager)ctx.GetSystemService(Context.ConnectivityService);
			if (setting.Synchronisation != Setting.Frequency.wlan || connectivityManager.GetNetworkInfo(ConnectivityType.Wifi).GetState() == NetworkInfo.State.Connected) {
				new Thread (async () => {
					string contentsTask;
					try {
						using(var httpClient = new HttpClient()) {
							contentsTask = await httpClient.GetStringAsync ("https://raw.githubusercontent.com/Bla-Chat/Android/master/version.txt");
						}
					} catch (Exception e) {
						Log.Error ("BlaChat", e.StackTrace);
						contentsTask = null;
					} finally {
						//semaphore.Release ();
					}
					if (contentsTask != null) {
						setting.NewestVersion = contentsTask;
						db.Update(setting);
					}
				}).Start ();
			}
		}
Exemplo n.º 19
0
        public MvxLayoutInflater(LayoutInflater original, Context newContext, MvxBindingVisitor bindingVisitor, bool cloned)
            : base(original, newContext)
        {
            this._bindingVisitor = bindingVisitor ?? new MvxBindingVisitor();

            this.SetupLayoutFactories(cloned);
        }
Exemplo n.º 20
0
		public override void OnReceive(Context context, Intent intent)
		{
			Android.Util.Log.Info("MonoGame", intent.Action.ToString());
			if(intent.Action == Intent.ActionScreenOff)
			{
				ScreenReceiver.ScreenLocked = true;
				MediaPlayer.IsMuted = true;
			}
			else if(intent.Action == Intent.ActionScreenOn)
			{
                // If the user turns the screen on just after it has automatically turned off, 
                // the keyguard will not have had time to activate and the ActionUserPreset intent
                // will not be broadcast. We need to check if the lock is currently active
                // and if not re-enable the game related functions.
                // http://stackoverflow.com/questions/4260794/how-to-tell-if-device-is-sleeping
                KeyguardManager keyguard = (KeyguardManager)context.GetSystemService(Context.KeyguardService);
                if (!keyguard.InKeyguardRestrictedInputMode())
                {
                    ScreenReceiver.ScreenLocked = false;
                    MediaPlayer.IsMuted = false;
                }
			}
			else if(intent.Action == Intent.ActionUserPresent)
			{
                // This intent is broadcast when the user unlocks the phone
				ScreenReceiver.ScreenLocked = false;
				MediaPlayer.IsMuted = false;
			}
		}
Exemplo n.º 21
0
 public CircularImageView(Context context, IAttributeSet attrs, int defStyle)
     : base(context, attrs, defStyle)
 {
     this._attrs = attrs;
     this._defStyle = defStyle;
     Init();
 }
Exemplo n.º 22
0
 public WrapedViewGroup(Context context)
     : base(context)
 {
     this.Clickable = true;
     this.tapDetector = new TapDetector(this);
     this.clickDetector = new ClickDetector(this);
 }
Exemplo n.º 23
0
 public static Intent CreateIntent(Context context, String action, int albumID, int episodeID)
 {
     var intent = CreateIntent(context, action);
     ExtraUtils.PutAlbum (intent, albumID);
     ExtraUtils.PutEpisode(intent, episodeID);
     return intent;
 }
        /// <summary>
        /// The get apk expansion files.
        /// </summary>
        /// <param name="ctx">
        /// The ctx.
        /// </param>
        /// <param name="mainVersion">
        /// The main version.
        /// </param>
        /// <param name="patchVersion">
        /// The patch version.
        /// </param>
        /// <returns>
        /// A list of obb files for this app.
        /// </returns>
        public static IEnumerable<string> GetApkExpansionFiles(Context ctx, int mainVersion, int patchVersion)
        {
            var ret = new List<string>();

            if (Environment.ExternalStorageState.Equals(Environment.MediaMounted))
            {
                string packageName = ctx.PackageName;

                // Build the full path to the app's expansion files
                string expPath = Environment.ExternalStorageDirectory + ExpansionFilesPath + packageName;

                // Check that expansion file path exists
                if (Directory.Exists(expPath))
                {
                    string main = Path.Combine(expPath, string.Format("main.{0}.{1}.obb", mainVersion, packageName));
                    string patch = Path.Combine(expPath, string.Format("patch.{0}.{1}.obb", mainVersion, packageName));

                    if (mainVersion > 0 && File.Exists(main))
                    {
                        ret.Add(main);
                    }

                    if (patchVersion > 0 && File.Exists(patch))
                    {
                        ret.Add(patch);
                    }
                }
            }

            return ret.ToArray();
        }
Exemplo n.º 25
0
		public void Show (Context context, string status = null, int progress = -1, MaskType maskType = MaskType.Black, TimeSpan? timeout = null, Action clickCallback = null, bool centered = true, Action cancelCallback = null)
		{
			if (progress >= 0)
				showProgress (context, progress, status, maskType, timeout, clickCallback, cancelCallback);
			else
				showStatus (context, true, status, maskType, timeout, clickCallback, centered, cancelCallback);
		}
Exemplo n.º 26
0
		public override View GetView(Context context, View convertView, ViewGroup parent)
        {
			var view = convertView as RelativeLayout;
			
			if (view == null)
				view = new RelativeLayout(context);
						
            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                        ViewGroup.LayoutParams.WrapContent);
            parms.SetMargins(5, 3, 5, 0);
            parms.AddRule((int) LayoutRules.AlignParentLeft);

            _caption = new TextView(context) {Text = Caption, TextSize = 16f};
            view.AddView(_caption, parms);

            if (!string.IsNullOrEmpty(Value))
            {
                var tparms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                             ViewGroup.LayoutParams.WrapContent);
                tparms.SetMargins(5, 3, 5, 0);
                tparms.AddRule((int) LayoutRules.AlignParentRight);

                _text = new TextView(context) {Text = Value, TextSize = 16f};
                view.AddView(_text, tparms);
            }

            return view;
        }
		public SlidingTabStrip(Context context, IAttributeSet Attrs):base(context, Attrs) {
			SetWillNotDraw(false);

			float density = Resources.DisplayMetrics.Density;

			TypedValue outValue = new TypedValue();
			context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true);
			int themeForegroundColor =  outValue.Data;

			_defaultBottomBorderColor = SetColorAlpha(themeForegroundColor,0x26);

			_defaultTabColorizer = new SimpleTabColorizer();
			_defaultTabColorizer.SetIndicatorColors(0xFF33B5);
			_defaultTabColorizer.SetDividerColors(SetColorAlpha(themeForegroundColor,0x20));

			_bottomBorderThickness = (int) (2 * density);
			_bottomBorderPaint = new Paint();
			_bottomBorderPaint.Color = Color.White;

			_selectedIndicatorThickness = (int) (6 * density);
			_selectedIndicatorPaint = new Paint();

			_dividerHeight = 0.5f;
			_dividerPaint = new Paint();
			_dividerPaint.StrokeWidth=((int) (1 * density));
		}
Exemplo n.º 28
0
        public SlidingTabStrip1(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            SetWillNotDraw(false);

            float density = Resources.DisplayMetrics.Density;

            TypedValue outValue = new TypedValue();
            context.Theme.ResolveAttribute(Android.Resource.Attribute.ColorForeground, outValue, true);
            int themeForeGround = outValue.Data;
            mDefaultBottomBorderColor = SetColorAlpha(themeForeGround, DEFAULT_BOTTOM_BORDER_COLOR_ALPHA);

            mDefaultTabColorizer = new SimpleTabColorizer1();
            mDefaultTabColorizer.IndicatorColors = INDICATOR_COLORS;
            mDefaultTabColorizer.DividerColors = DIVIDER_COLORS;

            mBottomBorderThickness = (int)(DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density);
            mBottomBorderPaint = new Paint();
            mBottomBorderPaint.Color = GetColorFromInteger(0xC5C5C5); //Gray

            mSelectedIndicatorThickness = (int)(SELECTED_INDICATOR_THICKNESS_DIPS * density);
            mSelectedIndicatorPaint = new Paint();

            mDividerHeight = DEFAULT_DIVIDER_HEIGHT;
            mDividerPaint = new Paint();
            mDividerPaint.StrokeWidth = (int)(DEFAULT_DIVIDER_THICKNESS_DIPS * density);
        }
Exemplo n.º 29
0
		protected override AView GetCellCore(Cell item, AView convertView, ViewGroup parent, Context context)
		{
			Performance.Start();
			var cell = (ViewCell)item;

			var container = convertView as ViewCellContainer;
			if (container != null)
			{
				container.Update(cell);
				Performance.Stop();
				return container;
			}

			BindableProperty unevenRows = null, rowHeight = null;
			if (ParentView is TableView)
			{
				unevenRows = TableView.HasUnevenRowsProperty;
				rowHeight = TableView.RowHeightProperty;
			}
			else if (ParentView is ListView)
			{
				unevenRows = ListView.HasUnevenRowsProperty;
				rowHeight = ListView.RowHeightProperty;
			}

			IVisualElementRenderer view = Platform.CreateRenderer(cell.View);
			Platform.SetRenderer(cell.View, view);
			cell.View.IsPlatformEnabled = true;
			var c = new ViewCellContainer(context, view, cell, ParentView, unevenRows, rowHeight);

			Performance.Stop();

			return c;
		}
Exemplo n.º 30
0
 private MyMediaPlayer(Android.Content.Context context)
 {
     this.context = context;
 }
Exemplo n.º 31
0
 public MaxWidthLinearLayout(Android.Content.Context context)
     : base(context)
 {
     maxWidth = 0;
 }
        /// <summary>
        /// 通知チャンネルを生成します。
        /// </summary>
        /// <param name="notificationManager"></param>
        public void CreateNotificationChannel(NotificationManager notificationManager, Android.Content.Context context)
        {
            this.notificationManager = notificationManager;
            if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
            {
                // ステータス通知チャンネル
                var statusNotificationChannel = new NotificationChannel(
                    STATUS_NOTIFICATION_CHANNEL_ID,
                    context.GetString(Resource.String.notificationchannel_description),
                    NotificationImportance.High);
                statusNotificationChannel.Description = "Update notification of occupancy status";
                statusNotificationChannel.EnableLights(true);
                statusNotificationChannel.LightColor = Color.Red;
                //notificationChannel.SetVibrationPattern(new long[]{ 0, 1000, 500, 1000});
                //notificationChannel.EnableVibration(true);
                notificationManager.CreateNotificationChannel(statusNotificationChannel);

                // フォアグラウンド通知チャンネル
                var serviceNotificationChannel = new NotificationChannel(
                    SERVICE_NOTIFICATION_CHANNEL_ID,
                    context.GetString(Resource.String.notificationchannel_description),
                    NotificationImportance.High);

                // Configure the notification channel.
                serviceNotificationChannel.Description = "Update notification of occupancy status";
                serviceNotificationChannel.EnableLights(true);
                serviceNotificationChannel.LightColor = Color.Red;
                //notificationChannel.SetVibrationPattern(new long[]{ 0, 1000, 500, 1000});
                //notificationChannel.EnableVibration(true);
                notificationManager.CreateNotificationChannel(serviceNotificationChannel);
            }
        }
Exemplo n.º 33
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            var deviceDensity = (int)context.Resources.DisplayMetrics.Density;
            // Set our view from the "main" layout resource
            var layoutInflater = LayoutInflater.From(context);

            view = layoutInflater.Inflate(Resource.Layout.EditorCustomization, null);


            FrameLayout mainLayout = view.FindViewById <FrameLayout>
                                         (Resource.Id.CustomizationMain);

            editor               = new SfImageEditor(context);
            editor.Bitmap        = BitmapFactory.DecodeResource(context.Resources, Resource.Drawable.Customize);
            editor.ItemSelected += Editor_ItemSelected;
            editor.ToolbarSettings.IsVisible = false;
            editor.SetBackgroundColor(Color.Black);


            var bottomview = layoutInflater.Inflate(Resource.Layout.BottomView, mainLayout, true);
            var topview    = layoutInflater.Inflate(Resource.Layout.TopView, mainLayout, true);
            var rightview  = layoutInflater.Inflate(Resource.Layout.RightView, mainLayout, true);


            //Bottom View------------------------------------
            var bottomView = bottomview.FindViewById <LinearLayout>(Resource.Id.bottomView);

            bottomView.SetGravity(GravityFlags.Bottom);
            var bParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, 50 * deviceDensity, GravityFlags.Bottom);

            bottomView.SetBackgroundColor(Color.Transparent);
            bParams.SetMargins(0, 0, 0, 10 * deviceDensity);
            bottomView.LayoutParameters = bParams;


            //Top View------------------------------------
            var topView = topview.FindViewById <LinearLayout>(Resource.Id.topView);
            var tParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, 50 * deviceDensity, GravityFlags.Top);

            tParams.SetMargins(0, 10 * deviceDensity, 0, 0);
            topView.LayoutParameters = tParams;


            //Right View------------------------------------

            var rightView = rightview.FindViewById <LinearLayout>(Resource.Id.rightView);
            var rParams   = new FrameLayout.LayoutParams(65 * deviceDensity, FrameLayout.LayoutParams.MatchParent, GravityFlags.Right);

            rParams.SetMargins(0, 250, 0, 250);
            rightView.SetBackgroundColor(Color.Transparent);
            rightView.SetPadding(0, 0, 15 * deviceDensity, 15 * deviceDensity);
            rightView.LayoutParameters = rParams;
            rightView.Visibility       = ViewStates.Invisible;
            topView.Visibility         = ViewStates.Invisible;
            mainLayout.RemoveAllViews();
            (mainLayout.Parent as ViewGroup)?.RemoveAllViews();


            mainLayout.AddView(editor);
            mainLayout.AddView(topView);
            mainLayout.AddView(bottomView);
            mainLayout.AddView(rightView);

            Button dummyLayout = new Button(context);

            dummyLayout.SetBackgroundColor(Color.Transparent);
            dummyLayout.Alpha = 0.5F;
            mainLayout.AddView(dummyLayout);
            dummyLayout.Click += (sender, e) =>
            {
                topView.Visibility     = ViewStates.Visible;
                dummyLayout.Visibility = ViewStates.Invisible;
            };


            //Top view

            var reset = topView.FindViewById <ImageButton>(Resource.Id.resetButton);
            var undo  = topView.FindViewById <ImageButton>(Resource.Id.undoButton);
            var rect  = topView.FindViewById <ImageButton>(Resource.Id.rectButton);
            var text  = topView.FindViewById <ImageButton>(Resource.Id.textButton);
            var path  = topView.FindViewById <ImageButton>(Resource.Id.pathButton);

            reset.Click += (sender, e) =>
            {
                if (editor.IsImageEdited)
                {
                    editor.Reset();
                }
                rightView.Visibility   = ViewStates.Invisible;
                topView.Visibility     = ViewStates.Invisible;
                dummyLayout.Visibility = ViewStates.Visible;
                isPath = false;
                isText = false;
                isRect = false;
            };
            undo.Click += (sender, e) =>
            {
                if (editor.IsImageEdited)
                {
                    editor.Undo();
                }
            };
            rect.Click += (sender, e) =>
            {
                isPath = false;
                isText = false;
                isRect = true;
                AddShapes();
                rightView.Visibility = ViewStates.Visible;
            };
            text.Click += (sender, e) =>
            {
                isPath = false;
                isRect = false;
                isText = true;
                AddShapes();
                rightView.Visibility = ViewStates.Visible;
            };
            path.Click += (sender, e) =>
            {
                isPath = true;
                isRect = false;
                isText = false;
                rightView.Visibility = ViewStates.Visible;
                editor.AddShape();
            };



            // colorLayout
            var firstBut   = rightview.FindViewById <Button>(Resource.Id.firstButton);
            var secondBut  = rightview.FindViewById <Button>(Resource.Id.secondButton);
            var thirdBut   = rightview.FindViewById <Button>(Resource.Id.thirdButton);
            var fourthBut  = rightview.FindViewById <Button>(Resource.Id.fourthButton);
            var fifthBut   = rightview.FindViewById <Button>(Resource.Id.fifthButton);
            var sixthBut   = rightview.FindViewById <Button>(Resource.Id.sixthButton);
            var seventhBut = rightview.FindViewById <Button>(Resource.Id.seventhButton);
            var eightBut   = rightview.FindViewById <Button>(Resource.Id.eightButton);
            var ninthBut   = rightview.FindViewById <Button>(Resource.Id.ninthButton);
            var tenthBut   = rightview.FindViewById <Button>(Resource.Id.tenthButton);

            firstBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#4472c4");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            secondBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#ed7d31");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            thirdBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#ffc000");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            fourthBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#70ad47");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            fifthBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#5b9bd5");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            sixthBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#c1c1c1");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            seventhBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#6f6fe2");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            eightBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#e269ae");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            ninthBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#9e480e");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };
            tenthBut.Click += (sender, e) =>
            {
                var color = Color.ParseColor("#997300");
                setting(Settings, color);
                if (isPath)
                {
                    editor.AddShape(Syncfusion.SfImageEditor.Android.ShapeType.Path, new PenSettings()
                    {
                        Color = color
                    });
                }
            };


            //Share

            var share = bottomView.FindViewById <ImageButton>(Resource.Id.sharecustomization);

            editText     = bottomView.FindViewById <EditText>(Resource.Id.captionText);
            share.Click += (sender, e) =>
            {
                ShareImage();
            };
            return(mainLayout);
        }
Exemplo n.º 34
0
 public LocationListener(Context ctx)
 {
     this.context = ctx;
 }
Exemplo n.º 35
0
 public ExtendedViewPager(Android.Content.Context context, IAttributeSet attrs)
     : base(context, attrs)
 {
     Initialize();
 }
Exemplo n.º 36
0
 public ExtendedViewPager(Android.Content.Context context)
     : base(context)
 {
     Initialize();
 }
Exemplo n.º 37
0
 protected override void AttachBaseContext(Android.Content.Context @base)
 {
     base.AttachBaseContext(CalligraphyContextWrapper.Wrap(@base));
 }
        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            TextView pointervalue = new TextView(context);

            pointervalue.Text     = "Change Pointer Value";
            pointervalue.Typeface = Typeface.DefaultBold;
            pointervalue.SetTextColor(Color.ParseColor("#262626"));
            pointervalue.TextSize = 20;

            SeekBar pointerSeek = new SeekBar(context);

            pointerSeek.Max              = 1000;
            pointerSeek.Progress         = 800;
            pointerSeek.ProgressChanged += pointerSeek_ProgressChanged;

            TextView pointervalue1 = new TextView(context);

            pointervalue1.Text     = "RangePointer Color";
            pointervalue1.Typeface = Typeface.DefaultBold;
            pointervalue1.SetTextColor(Color.ParseColor("#262626"));
            pointervalue1.TextSize = 20;

            Spinner selectLabelMode = new Spinner(context, SpinnerMode.Dialog);

            adapter = new List <String>()
            {
                "Yellow", "Green", "Pink"
            };

            ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>
                                                    (context, Android.Resource.Layout.SimpleSpinnerItem, adapter);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelMode.Adapter       = dataAdapter;
            selectLabelMode.ItemSelected += SelectLabelMode_ItemSelected;

            TextView pointervalue2 = new TextView(context);

            pointervalue2.Text     = "NeedlePointer Color";
            pointervalue2.Typeface = Typeface.DefaultBold;
            pointervalue2.SetTextColor(Color.ParseColor("#262626"));
            pointervalue2.TextSize = 20;

            Spinner selectLabelModel1 = new Spinner(context, SpinnerMode.Dialog);

            adapter1 = new List <String>()
            {
                "Black", "Violet", "Brown"
            };

            ArrayAdapter <String> dataAdapter1 = new ArrayAdapter <String>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, adapter1);

            dataAdapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelModel1.Adapter       = dataAdapter1;
            selectLabelModel1.ItemSelected += SelectLabelMode_ItemSelected1;

            TextView pointervalue3 = new TextView(context);

            pointervalue3.Text     = "Range Color";
            pointervalue3.Typeface = Typeface.DefaultBold;
            pointervalue3.SetTextColor(Color.ParseColor("#262626"));
            pointervalue3.TextSize = 20;

            Spinner selectLabelModel2 = new Spinner(context, SpinnerMode.Dialog);

            adapter2 = new List <String>()
            {
                "LightGray", "Blue", "Orange"
            };

            ArrayAdapter <String> dataAdapter2 = new ArrayAdapter <String>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, adapter2);

            dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            selectLabelModel2.Adapter       = dataAdapter2;
            selectLabelModel2.ItemSelected += SelectLabelMode_ItemSelected2;

            optionsPage = new LinearLayout(context);

            optionsPage.Orientation = Orientation.Vertical;
            optionsPage.AddView(pointervalue);
            optionsPage.AddView(pointerSeek);
            optionsPage.AddView(pointervalue1);
            optionsPage.AddView(selectLabelMode);
            optionsPage.AddView(pointervalue2);
            optionsPage.AddView(selectLabelModel1);
            optionsPage.AddView(pointervalue3);
            optionsPage.AddView(selectLabelModel2);

            optionsPage.SetPadding(10, 10, 10, 10);
            optionsPage.SetBackgroundColor(Color.White);

            return(optionsPage);
        }
 public RoundedContentViewRenderer(Android.Content.Context context) : base(context)
 {
 }
 public AuthenticateUIType AuthenticationUIPlatformSpecificEmbeddedBrowser(UIContext context)
 {
     return(GetPlatformUIEmbeddedBrowser(context));
 }
Exemplo n.º 41
0
 public BindableDrawerLayout(Android.Content.Context context) : base(context)
 {
     Initialize();
 }
Exemplo n.º 42
0
 public CalendarButtonRenderer(Android.Content.Context context) : base(context)
 {
     this.context = context;
 }
Exemplo n.º 43
0
 public override View GetPropertyWindowLayout(Android.Content.Context context)
 {
     return(null);
 }
Exemplo n.º 44
0
 public BindableDrawerLayout(Android.Content.Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle)
 {
     Initialize();
 }
Exemplo n.º 45
0
        public ToyAdapter(Android.Content.Context context, System.Collections.Generic.List <ToySql> objects)
        {
            this.context = context;

            this.objects = objects;
        }
Exemplo n.º 46
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            handler = new Handler();

            LinearLayout layout = new LinearLayout(context);

            layout.Orientation = Orientation.Vertical;
            TextView textView = new TextView(context);

            textView.TextSize = 16;
            textView.SetPadding(10, 20, 0, 0);
            textView.SetHeight(90);

            textView.Text = "Top 40 countries population";
            layout.AddView(textView);
            textView.Gravity = Android.Views.GravityFlags.Top;
            maps             = new SfMaps(context);

            ShapeFileLayer layer = new ShapeFileLayer();

            layer.ShowItems         = true;
            layer.Uri               = "world1.shp";
            layer.DataSource        = GetDataSource();
            layer.ShapeIdPath       = "Country";
            layer.ShowItems         = true;
            layer.ShapeIdTableField = "NAME";

            layer.ShapeSettings           = new ShapeSetting();
            layer.ShapeSettings.ShapeFill = Color.LightGray;

            BubbleMarkerSetting marker = new BubbleMarkerSetting();

            marker.ValuePath      = "Population";
            marker.ColorValuePath = "Population";

            BubbleCustomTooltipSetting tooltipSetting = new BubbleCustomTooltipSetting(context);

            tooltipSetting.ShowTooltip = true;
            tooltipSetting.ValuePath   = "Country";
            marker.TooltipSettings     = tooltipSetting;

            RangeColorMapping rangeColorMapping = new RangeColorMapping();

            rangeColorMapping.Color       = Color.ParseColor("#2E769F");
            rangeColorMapping.To          = 1400000000;
            rangeColorMapping.From        = 325000000;
            rangeColorMapping.LegendLabel = "Above 4%";
            marker.ColorMapping.Add(rangeColorMapping);

            RangeColorMapping rangeColorMapping1 = new RangeColorMapping();

            rangeColorMapping1.Color       = Color.ParseColor("#D84444");
            rangeColorMapping1.To          = 325000000;
            rangeColorMapping1.From        = 180000000;
            rangeColorMapping1.LegendLabel = "4% - 2%";
            marker.ColorMapping.Add(rangeColorMapping1);

            RangeColorMapping rangeColorMapping2 = new RangeColorMapping();

            rangeColorMapping2.Color       = Color.ParseColor("#816F28");
            rangeColorMapping2.To          = 180000000;
            rangeColorMapping2.From        = 100000000;
            rangeColorMapping2.LegendLabel = "2% - 1%";
            marker.ColorMapping.Add(rangeColorMapping2);

            RangeColorMapping rangeColorMapping3 = new RangeColorMapping();

            rangeColorMapping3.Color       = Color.ParseColor("#7F38A0");
            rangeColorMapping3.To          = 100000000;
            rangeColorMapping3.From        = 5000000;
            rangeColorMapping3.LegendLabel = "Below 1%";
            marker.ColorMapping.Add(rangeColorMapping3);

            layer.BubbleMarkerSetting = marker;

            LegendSetting legendSetting = new LegendSetting();

            legendSetting.ShowLegend          = true;
            legendSetting.LegendType          = LegendType.Bubbles;
            legendSetting.IconHeight          = 15;
            legendSetting.IconWidth           = 15;
            legendSetting.LegendPosition      = new Point(50, 5);
            legendSetting.HorizontalAlignment = HorizontalAlignment.Center;
            layer.LegendSetting = legendSetting;

            maps.Layers.Add(layer);

            SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context);

            sfBusyIndicator.IsBusy        = true;
            sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle;
            sfBusyIndicator.ViewBoxWidth  = 50;
            sfBusyIndicator.ViewBoxHeight = 50;
            sfBusyIndicator.TextColor     = Color.ParseColor("#779772");
            layout.AddView(sfBusyIndicator);
            Java.Lang.Runnable run = new Java.Lang.Runnable(() =>
            {
                layout.RemoveView(sfBusyIndicator);
                layout.AddView(maps);
            });
            handler.PostDelayed(run, 100);

            return(layout);
        }
Exemplo n.º 47
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            mSelectedItems     = new List <Item>();
            con                = context;
            isLongPressEnabled = false;
            isDeleted          = false;
            Activity           = con as Activity;
            LayoutInflater layoutInflater = LayoutInflater.From(context);

            view     = layoutInflater.Inflate(Resource.Layout.SerializationFirstPage, null);
            gridview = view.FindViewById <GridView>(Resource.Id.gridview);

            var deviceDensity = (int)context.Resources.DisplayMetrics.Density;

            if (IsTabletDevice(context))
            {
                gridview.LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 650 * deviceDensity);
                gridview.NumColumns       = 3;
            }
            else if (deviceDensity >= 3 && deviceDensity < 4 && !IsTabletDevice(context))
            {
                gridview.LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 310 * deviceDensity);
            }
            else if (deviceDensity < 3 && !IsTabletDevice(context))
            {
                gridview.LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 400 * deviceDensity);
            }


            deleteButton        = view.FindViewById <ImageButton>(Resource.Id.editordelete);
            deleteButton.Click += DeleteButton_Click;
            gridview.Adapter    = new ImageAdapter(Activity);

            deleteButton.Visibility = ViewStates.Invisible;
            gridview.ItemClick     += delegate(object sender, AdapterView.ItemClickEventArgs args)
            {
                isDeleted    = false;
                SelectedItem = (gridview.Adapter as ImageAdapter).mItems[args.Position];
                if (!SelectedItem.IsLongPressedEnabled)
                {
                    isLongPressEnabled = false;
                    Activity           = con as Activity;
                    Activity?.StartActivity(typeof(SerializationActivity));
                    if (SelectedItem.ImageName != "Create New")
                    {
                        ImageStream = SelectedItem.Strm;
                        SelectedItem.IsItemChecked        = false;
                        SelectedItem.IsLongPressedEnabled = false;
                    }
                }
                else if (!SelectedItem.IsItemChecked)
                {
                    SelectedItem.IsItemChecked = true;
                    mSelectedItems.Add(SelectedItem);
                }
                else if (SelectedItem.IsItemChecked)
                {
                    SelectedItem.IsItemChecked = false;
                    if (mSelectedItems.Count > 0)
                    {
                        mSelectedItems.Remove(SelectedItem);
                    }
                }
                (gridview.Adapter as ImageAdapter).NotifyDataSetChanged();
            };

            gridview.ItemLongClick += (object sender, AdapterView.ItemLongClickEventArgs e) => {
                deleteButton.Visibility = ViewStates.Visible;
                SelectedItem            = (gridview.Adapter as ImageAdapter).mItems[e.Position];
                if (SelectedItem.ImageName != "CreateNew")
                {
                    SelectedItem.IsLongPressedEnabled = true;
                    isLongPressEnabled = true;
                    isDeleted          = false;
                    (gridview.Adapter as ImageAdapter).NotifyDataSetChanged();
                }
            };


            return(view);
        }
Exemplo n.º 48
0
        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            int          width          = (context.Resources.DisplayMetrics.WidthPixels) / 2;
            LinearLayout propertylayout = new LinearLayout(context);

            propertylayout.Orientation = Android.Widget.Orientation.Vertical;
            LinearLayout.LayoutParams layoutParams1 = new LinearLayout.LayoutParams(
                width * 2, 5);
            layoutParams1.SetMargins(0, 20, 0, 0);
            type      = new TextView(context);
            type.Text = "Error Bar Type";
            type.SetPadding(5, 20, 0, 20);
            mode      = new TextView(context);
            mode.Text = "Drawing Mode";
            mode.SetPadding(5, 30, 0, 20);
            horizontalDirection      = new TextView(context);
            horizontalDirection.Text = "Horizontal Direction";
            horizontalDirection.SetPadding(5, 30, 0, 20);
            verticalDirection      = new TextView(context);
            verticalDirection.Text = "Vertical Direction";
            verticalDirection.SetPadding(5, 30, 0, 20);
            horizontalValue      = new TextView(context);
            horizontalValue.Text = "Horizontal Error : 3.0";
            horizontalValue.SetPadding(5, 30, 0, 20);
            verticalValue      = new TextView(context);
            verticalValue.Text = "Vertical Error : 3.0";
            verticalValue.SetPadding(5, 20, 0, 20);

            Spinner errorBarType        = new Spinner(context, SpinnerMode.Dialog);
            Spinner errorBarDrawingMode = new Spinner(context, SpinnerMode.Dialog);

            errorBarDrawingMode.SetSelection(2);
            SeekBar errorBarHorizontalError = new SeekBar(context);

            errorBarHorizontalError.Max      = 3;
            errorBarHorizontalError.Progress = 3;

            SeekBar errorBarVerticalError = new SeekBar(context);

            errorBarVerticalError.Max      = 3;
            errorBarVerticalError.Progress = 3;
            Spinner errorBarHorizontalDirection = new Spinner(context, SpinnerMode.Dialog);
            Spinner errorBarVerticalDirection   = new Spinner(context, SpinnerMode.Dialog);

            types = new List <string>()
            {
                "Fixed", "Custom", "percentage", "StandardDeviation", "StandardErrors"
            };
            modes = new List <string>()
            {
                "Both", "Horizontal", "Vertical"
            };
            horizonatalDirections = new List <string> {
                "Both", "Minus", "Plus"
            };
            verticalDirections = new List <string> {
                "Both", "Minus", "Plus"
            };

            ArrayAdapter <string> dataAdapter = new ArrayAdapter <string>
                                                    (context, Android.Resource.Layout.SimpleSpinnerItem, types);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            errorBarType.Adapter = dataAdapter;

            ArrayAdapter <string> dataAdapter1 = new ArrayAdapter <string>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, modes);

            dataAdapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            errorBarDrawingMode.Adapter = dataAdapter1;

            ArrayAdapter <string> dataAdapter2 = new ArrayAdapter <string>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, horizonatalDirections);

            dataAdapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            errorBarHorizontalDirection.Adapter = dataAdapter2;

            ArrayAdapter <string> dataAdapter3 = new ArrayAdapter <string>
                                                     (context, Android.Resource.Layout.SimpleSpinnerItem, verticalDirections);

            dataAdapter3.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            errorBarVerticalDirection.Adapter = dataAdapter3;

            errorBarType.ItemSelected                += Type_ItemSelected;
            errorBarDrawingMode.ItemSelected         += Mode_ItemSelected;
            errorBarHorizontalError.ProgressChanged  += HorizontalError_ProgressChanged;
            errorBarVerticalError.ProgressChanged    += VerticalError_ProgressChanged;
            errorBarHorizontalDirection.ItemSelected += HorizontalDirection_ItemSelected;
            errorBarVerticalDirection.ItemSelected   += VerticalDirection_ItemSelected;

            propertylayout.AddView(type);
            propertylayout.AddView(errorBarType);
            propertylayout.AddView(mode);
            propertylayout.AddView(errorBarDrawingMode);
            propertylayout.AddView(horizontalValue);
            propertylayout.AddView(errorBarHorizontalError);
            propertylayout.AddView(verticalValue);
            propertylayout.AddView(errorBarVerticalError);
            propertylayout.AddView(horizontalDirection);
            propertylayout.AddView(errorBarHorizontalDirection);
            propertylayout.AddView(verticalDirection);
            propertylayout.AddView(errorBarVerticalDirection);

            SeparatorView separate = new SeparatorView(context, width * 2);

            separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            propertylayout.AddView(separate, layoutParams1);

            return(propertylayout);
        }
Exemplo n.º 49
0
        public EasyGradientViewRenderer(Android.Content.Context context)
            :base(context)
        {

        }
 public unsafe ProducerFactory(
     Android.Content.Context i1,
     Com.Facebook.Common.Memory.IByteArrayPool i2,
     Com.Facebook.Imagepipeline.Decoder.IImageDecoder i3,
     Com.Facebook.Imagepipeline.Decoder.IProgressiveJpegConfig i4,
     bool i5, bool i6, bool i7,
     Com.Facebook.Imagepipeline.Core.IExecutorSupplier i8,
     Com.Facebook.Common.Memory.IPooledByteBufferFactory i9,
     Com.Facebook.Imagepipeline.Cache.IMemoryCache i10,
     Com.Facebook.Imagepipeline.Cache.IMemoryCache i11,
     Com.Facebook.Imagepipeline.Cache.BufferedDiskCache i12,
     Com.Facebook.Imagepipeline.Cache.BufferedDiskCache i13,
     Com.Facebook.Imagepipeline.Cache.ICacheKeyFactory i14,
     Com.Facebook.Imagepipeline.Bitmaps.PlatformBitmapFactory i15,
     int i16, int i17, bool i18)
     : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
 {
     if (Handle != IntPtr.Zero)
     {
         return;
     }
     if (GetType() != typeof(ProducerFactory))
     {
         SetHandle(
             Android.Runtime.JNIEnv.CreateInstance(GetType(), ctorSignature,
                                                   new JValue(i1),
                                                   new JValue(i2),
                                                   new JValue(i3),
                                                   new JValue(i4),
                                                   new JValue(i5),
                                                   new JValue(i6),
                                                   new JValue(i7),
                                                   new JValue(i8),
                                                   new JValue(i9),
                                                   new JValue(i10),
                                                   new JValue(i11),
                                                   new JValue(i12),
                                                   new JValue(i13),
                                                   new JValue(i14),
                                                   new JValue(i15),
                                                   new JValue(i16),
                                                   new JValue(i17),
                                                   new JValue(i18)),
             JniHandleOwnership.TransferLocalRef);
         return;
     }
     if (id_ctor_I == IntPtr.Zero)
     {
         id_ctor_I = JNIEnv.GetMethodID(class_ref, "<init>", ctorSignature);
     }
     SetHandle(
         JNIEnv.NewObject(class_ref, id_ctor_I,
                          new JValue(i1),
                          new JValue(i2),
                          new JValue(i3),
                          new JValue(i4),
                          new JValue(i5),
                          new JValue(i6),
                          new JValue(i7),
                          new JValue(i8),
                          new JValue(i9),
                          new JValue(i10),
                          new JValue(i11),
                          new JValue(i12),
                          new JValue(i13),
                          new JValue(i14),
                          new JValue(i15),
                          new JValue(i16),
                          new JValue(i17),
                          new JValue(i18)),
         JniHandleOwnership.TransferLocalRef);
 }
 public RoundedRectangleButton(Android.Content.Context context, IAttributeSet attrs, int defStyleAttr) : base(context, attrs, defStyleAttr)
 {
     Init(context, attrs);
 }
Exemplo n.º 52
0
        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            /**
             * Property Window
             * */
            int          width          = (context.Resources.DisplayMetrics.WidthPixels) / 2;
            LinearLayout propertylayout = new LinearLayout(context); //= new LinearLayout(context);

            propertylayout.Orientation = Android.Widget.Orientation.Vertical;

            LinearLayout.LayoutParams layoutParams1 = new LinearLayout.LayoutParams(
                width * 2, 5);

            layoutParams1.SetMargins(0, 20, 0, 0);

            TrendTypeValue      = new TextView(context);
            TrendTypeValue.Text = "Trendline Type";
            TrendTypeValue.SetPadding(5, 20, 0, 20);

            ForwardForecast      = new TextView(context);
            ForwardForecast.Text = "Forward Forecast: 0";
            ForwardForecast.SetPadding(5, 20, 0, 20);

            SeekBar FwdForecast = new SeekBar(context);

            FwdForecast.Max              = 5;
            FwdForecast.Progress         = 0;
            FwdForecast.ProgressChanged += FwdForecast_ProgressChanged;

            BackwardForecast      = new TextView(context);
            BackwardForecast.Text = "Backward Forecast: 0";
            BackwardForecast.SetPadding(5, 20, 0, 20);

            SeekBar BwdForecast = new SeekBar(context);

            BwdForecast.Max              = 5;
            BwdForecast.Progress         = 0;
            BwdForecast.ProgressChanged += BwdForecast_ProgressChanged;

            PolyomialOrder      = new TextView(context);
            PolyomialOrder.Text = "Polynomial Order: 2";
            PolyomialOrder.SetPadding(5, 20, 0, 20);

            SeekBar PolyOrder = new SeekBar(context);

            PolyOrder.Max              = 5;
            PolyOrder.Progress         = 2;
            PolyOrder.ProgressChanged += PolyOrder_ProgressChanged;
            var spinner = new Spinner(context, SpinnerMode.Dialog);

            adapter = new List <String>()
            {
                "Linear", "Exponential", "Logarithmic", "Power", "Polynomial"
            };
            ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>
                                                    (context, Android.Resource.Layout.SimpleSpinnerItem, adapter);

            dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spinner.Adapter = dataAdapter;

            spinner.ItemSelected += Spinner_ItemSelected;

            propertylayout.AddView(TrendTypeValue);
            propertylayout.AddView(spinner);
            propertylayout.AddView(ForwardForecast);
            propertylayout.AddView(FwdForecast);
            propertylayout.AddView(BackwardForecast);
            propertylayout.AddView(BwdForecast);
            propertylayout.AddView(PolyomialOrder);
            propertylayout.AddView(PolyOrder);
            SeparatorView separate = new SeparatorView(context, width * 2);

            separate.LayoutParameters = new ViewGroup.LayoutParams(width * 2, 5);
            propertylayout.AddView(separate, layoutParams1);

            return(propertylayout);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Dialog to display
            LinearLayout dialogView = null;

            // Get the context for creating the dialog controls
            Android.Content.Context ctx = Activity.ApplicationContext;
            Android.Support.V7.View.ContextThemeWrapper ctxWrapper = new ContextThemeWrapper(ctx, Android.Resource.Style.ThemeMaterialLight);

            // Set a dialog title
            Dialog.SetTitle("Save map to Portal");

            try
            {
                base.OnCreateView(inflater, container, savedInstanceState);

                // The container for the dialog is a vertical linear layout
                dialogView = new LinearLayout(ctxWrapper)
                {
                    Orientation = Orientation.Vertical
                };
                dialogView.SetPadding(10, 0, 10, 10);

                // Add a text box for entering a title for the new web map
                _mapTitleTextbox = new EditText(ctxWrapper)
                {
                    Hint = "Title"
                };
                dialogView.AddView(_mapTitleTextbox);

                // Add a text box for entering a description
                _mapDescriptionTextbox = new EditText(ctxWrapper)
                {
                    Hint = "Description"
                };
                dialogView.AddView(_mapDescriptionTextbox);

                // Add a text box for entering tags (populate with some values so the user doesn't have to fill this in)
                _tagsTextbox = new EditText(ctxWrapper)
                {
                    Text = "ArcGIS Runtime, Web Map"
                };
                dialogView.AddView(_tagsTextbox);

                // Add a button to save the map
                Button saveMapButton = new Button(ctxWrapper)
                {
                    Text = "Save"
                };
                saveMapButton.Click += SaveMapButtonClick;
                dialogView.AddView(saveMapButton);

                // If there's an existing portal item, configure the dialog for "update" (read-only entries)
                if (_portalItem != null)
                {
                    _mapTitleTextbox.Text    = _portalItem.Title;
                    _mapTitleTextbox.Enabled = false;

                    _mapDescriptionTextbox.Text    = _portalItem.Description;
                    _mapDescriptionTextbox.Enabled = false;

                    _tagsTextbox.Text    = string.Join(",", _portalItem.Tags);
                    _tagsTextbox.Enabled = false;

                    // Change some of the control text
                    Dialog.SetTitle("Save changes to map");
                    saveMapButton.Text = "Update";
                }
            }
            catch (Exception ex)
            {
                // Show the exception message
                AlertDialog.Builder alertBuilder = new AlertDialog.Builder(Activity);
                alertBuilder.SetTitle("Error");
                alertBuilder.SetMessage(ex.Message);
                alertBuilder.Show();
            }

            // Return the new view for display
            return(dialogView);
        }
Exemplo n.º 54
0
 public BtnRenderer(Android.Content.Context context) : base(context)
 {
 }
Exemplo n.º 55
0
 public FacebookLoginPageRenderer(Android.Content.Context context) : base(context)
 {
     AutoPackage = false;
 }
Exemplo n.º 56
0
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            sampleContext = context;
            LinearLayout layout = new LinearLayout(context);

            layout.Orientation = Orientation.Vertical;
            TextView textView = new TextView(context);

            textView.TextSize = 16;
            textView.SetPadding(10, 20, 0, 0);
            textView.SetHeight(90);
            handler       = new Handler();
            textView.Text = "Top Population Countries";
            layout.AddView(textView);
            textView.Gravity = Android.Views.GravityFlags.Top;
            SfMaps         maps  = new SfMaps(context);
            ShapeFileLayer layer = new ShapeFileLayer();

            layer.Uri = "world1.shp";
            SfBusyIndicator sfBusyIndicator = new SfBusyIndicator(context);

            sfBusyIndicator.IsBusy        = true;
            sfBusyIndicator.AnimationType = AnimationTypes.SlicedCircle;
            sfBusyIndicator.ViewBoxWidth  = 50;
            sfBusyIndicator.ViewBoxHeight = 50;

            sfBusyIndicator.TextColor = Color.ParseColor("#779772");
            layout.AddView(sfBusyIndicator);
            Java.Lang.Runnable run = new Java.Lang.Runnable(() =>
            {
                layout.RemoveView(sfBusyIndicator);
                layout.AddView(maps);
            });
            handler.PostDelayed(run, 100);

            PopulationMarker usa = new PopulationMarker(context);

            usa.Latitude   = 38.8833;
            usa.Longitude  = -77.0167;
            usa.Name       = "United States";
            usa.Population = "321,174,000";
            layer.Markers.Add(usa);

            PopulationMarker brazil = new PopulationMarker(context);

            brazil.Latitude   = -15.7833;
            brazil.Longitude  = -47.8667;
            brazil.Name       = "Brazil";
            brazil.Population = "204,436,000";
            layer.Markers.Add(brazil);

            PopulationMarker india = new PopulationMarker(context);

            india.Latitude   = 21.0000;
            india.Longitude  = 78.0000;
            india.Name       = "India";
            india.Population = "1,272,470,000";
            layer.Markers.Add(india);

            PopulationMarker china = new PopulationMarker(context);

            china.Latitude   = 35.0000;
            china.Longitude  = 103.0000;
            china.Name       = "China";
            china.Population = "1,370,320,000";
            layer.Markers.Add(china);

            PopulationMarker indonesia = new PopulationMarker(context);

            indonesia.Latitude   = -6.1750;
            indonesia.Longitude  = 106.8283;
            indonesia.Name       = "Indonesia";
            indonesia.Population = "255,461,700";
            layer.Markers.Add(indonesia);

            maps.Adapter = new MarkerAdapter(context);

            MarkerCustomTooltipSetting tooltipSetting = new MarkerCustomTooltipSetting(context);

            tooltipSetting.ShowTooltip          = true;
            layer.MarkerSetting.TooltipSettings = tooltipSetting;

            maps.Layers.Add(layer);

            return(layout);
        }
Exemplo n.º 57
0
    protected override Android.Views.View GetCellCore(Cell item, Android.Views.View convertView, Android.Views.ViewGroup parent, Android.Content.Context context)
    {
        var cell      = base.GetCellCore(item, convertView, parent, context);
        var backColor = new Android.Graphics.Color(20, 20, 20);

        var      layout = (LinearLayout)((LinearLayout)cell).GetChildAt(1);
        TextView t      = (TextView)layout.GetChildAt(0);
        TextView t2     = (TextView)layout.GetChildAt(1);

        List <string> attributes = new List <string>()
        {
            "FONTSIZE", "BOLD", "BLACK", "POSX", "POSY"
        };
        bool         applyCanges = false;
        string       resTxt      = t2.Text;
        List <bool>  values      = new List <bool>();
        List <float> ftts        = new List <float>();

        for (int i = 0; i < attributes.Count; i++)
        {
            values.Add(false);
            ftts.Add(1);
            if (resTxt.Contains(attributes[i] + ":"))
            {
                string _val = FindHTML(resTxt, attributes[i] + ":", ":");
                float  val  = 0;
                if (_val != "")
                {
                    val = float.Parse(_val);
                }
                resTxt    = resTxt.Replace(attributes[i] + ":" + _val + ":", "");
                ftts[i]   = val;
                values[i] = true;
            }
        }
        t.Typeface = values[1] ? Typeface.DefaultBold : Typeface.Default;
        t.TextSize = values[0] ? ftts[0] : 14;

        t.TranslationX = values[3] ? ftts[3] : 0;
        t.TranslationY = values[4] ? ftts[4] : 0;
        backColor      = values[2] ? new Android.Graphics.Color(17, 17, 17) : new Android.Graphics.Color(20, 20, 20);
        // t.texts = values[0] ? ftts[0] : 1;

        cell.SetBackgroundColor(backColor);


        /*
         * for (int i = 0; i < layout.ChildCount; i++) {
         *  print("CHILDCOUNT:" + layout.GetChildAt(i).ToString() + "::" + i);
         * }*/
        // var f =.ChildCount.GetChildAt(2);
        return(cell);
    }
Exemplo n.º 58
0
        public override View GetPropertyWindowLayout(Android.Content.Context context)
        {
            TextView startAngle = new TextView(context);

            startAngle.Text     = "Change StartAngle";
            startAngle.Typeface = Typeface.DefaultBold;
            startAngle.SetTextColor(Color.ParseColor("#262626"));
            startAngle.TextSize = 20;

            TextView sweepAngle = new TextView(context);

            sweepAngle.Text     = "Change SweepAngle";
            sweepAngle.Typeface = Typeface.DefaultBold;
            sweepAngle.SetTextColor(Color.ParseColor("#262626"));
            sweepAngle.TextSize = 20;

            TextView startAngle1 = new TextView(context);

            startAngle1.Text     = "Change StartAngle";
            startAngle1.Typeface = Typeface.DefaultBold;
            startAngle1.SetTextColor(Color.ParseColor("#262626"));
            startAngle1.TextSize = 20;

            TextView sweepAngle1 = new TextView(context);

            sweepAngle1.Text     = "Change SweepAngle";
            sweepAngle1.Typeface = Typeface.DefaultBold;
            sweepAngle1.SetTextColor(Color.ParseColor("#262626"));
            sweepAngle1.TextSize = 20;

            SeekBar pointerSeek = new SeekBar(context);

            pointerSeek.Max              = 350;
            pointerSeek.Progress         = 135;
            pointerSeek.ProgressChanged += pointerSeek_ProgressChanged;

            SeekBar pointerSeek1 = new SeekBar(context);

            pointerSeek1.Max              = 350;
            pointerSeek1.Progress         = 270;
            pointerSeek1.ProgressChanged += pointerSeek_ProgressChanged1;

            SeekBar pointerSeek2 = new SeekBar(context);

            pointerSeek2.Max              = 350;
            pointerSeek2.Progress         = 135;
            pointerSeek2.ProgressChanged += pointerSeek_ProgressChanged2;

            SeekBar pointerSeek3 = new SeekBar(context);

            pointerSeek3.Max              = 350;
            pointerSeek3.Progress         = 270;
            pointerSeek3.ProgressChanged += pointerSeek_ProgressChanged3;

            LinearLayout optionsPage = new LinearLayout(context);

            optionsPage.Orientation = Orientation.Vertical;
            optionsPage.AddView(startAngle);
            optionsPage.AddView(pointerSeek);
            optionsPage.AddView(sweepAngle);
            optionsPage.AddView(pointerSeek1);
            optionsPage.AddView(startAngle1);
            optionsPage.AddView(pointerSeek2);
            optionsPage.AddView(sweepAngle1);
            optionsPage.AddView(pointerSeek3);

            optionsPage.SetPadding(10, 10, 10, 10);
            optionsPage.SetBackgroundColor(Color.White);
            return(optionsPage);
        }
Exemplo n.º 59
0
 public CallDialyHistoryView(Android.Content.Context context, Android.Util.IAttributeSet attrs, int defStyleAttr, int defStyleRes) : base(context, attrs, defStyleAttr, defStyleRes)
 {
 }
Exemplo n.º 60
-1
       public override View GetSampleContent(Context context)
        {
            var chart = new SfChart(context);;
            chart.SetBackgroundColor(Color.White);
            chart.Legend.Visibility = Visibility.Visible;

            var datas = new ObservableArrayList();
            datas.Add(new ChartDataPoint("2010", 8000));
            datas.Add(new ChartDataPoint("2011", 8100));
            datas.Add(new ChartDataPoint("2012", 8250));
            datas.Add(new ChartDataPoint("2013", 8600));
            datas.Add(new ChartDataPoint("2014", 8700));

            var doughnutSeries = new DoughnutSeries
            {
                ExplodeIndex = 3,
                DataSource = datas,
                DataMarkerPosition = CircularSeriesDataMarkerPosition.OutsideExtended,
            };

            doughnutSeries.DataMarker.ShowLabel = true;
            doughnutSeries.ConnectorType = ConnectorType.Bezier;

            chart.Series.Add(doughnutSeries);
            return chart;
        }