public ArcView(Context context, Android.Util.IAttributeSet attrib) : base(context) { try { SetWillNotDraw(false); mPaints = new Paint(); mPaints.AntiAlias = true; //mPaints.SetStyle(Paint.Style.Fill); mPaints.SetStyle(Paint.Style.Stroke); mPaints.StrokeWidth = (80); mPaints.Color = Color.Red; mPaints2 = new Paint(); mPaints2.AntiAlias = true; //mPaints.SetStyle(Paint.Style.Fill); mPaints2.SetStyle(Paint.Style.Stroke); mPaints2.StrokeWidth = (4); mPaints2.Color = Color.DarkRed; mFramePaint = new Paint(); mFramePaint.AntiAlias = true; mFramePaint.SetStyle(Paint.Style.Stroke); mFramePaint.StrokeWidth = (1); Invalidate(); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
private void init(Context context, Android.Util.IAttributeSet attrs, int defStyle) { LayoutInflater.From(context).Inflate(Resource.Layout.sat_main, this, true); imgMain = FindViewById <ImageView>(Resource.Id.sat_main); if (attrs != null) { TypedArray typedArray = context.ObtainStyledAttributes(attrs, Resource.Styleable.SatelliteMenu, defStyle, 0); satelliteDistance = typedArray.GetDimensionPixelSize(Resource.Styleable.SatelliteMenu_satelliteDistance, DEFAULT_SATELLITE_DISTANCE); totalSpacingDegree = typedArray.GetFloat(Resource.Styleable.SatelliteMenu_totalSpacingDegree, DEFAULT_TOTAL_SPACING_DEGREES); closeItemsOnClick = typedArray.GetBoolean(Resource.Styleable.SatelliteMenu_closeOnClick, DEFAULT_CLOSE_ON_CLICK); expandDuration = typedArray.GetInt(Resource.Styleable.SatelliteMenu_expandDuration, DEFAULT_EXPAND_DURATION); //float satelliteDistance = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 170, getResources().getDisplayMetrics()); typedArray.Recycle(); } mainRotateLeft = SatelliteAnimationCreator.createMainButtonAnimation(context); mainRotateRight = SatelliteAnimationCreator.createMainButtonInverseAnimation(context); mainRotateLeft.SetAnimationListener(this); mainRotateRight.SetAnimationListener(this); imgMain.Click += (s, e) => { onClick(); }; internalItemClickListener = new InternalSatelliteOnClickListener(this); }
public ColorButton(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { colorInicial = "#ffbf360c"; colorProcesando = "#11bf360c"; valor = 100000000; Click += OnClicked; }
public unsafe SmartRefreshLayout(Context context, Android.Util.IAttributeSet attrs) : base(IntPtr.Zero, JniHandleOwnership.DoNotTransfer) { const string __id = "(Landroid/content/Context;Landroid/util/AttributeSet;)V"; if (Handle != IntPtr.Zero) { return; } try { JniArgumentValue *__args = stackalloc JniArgumentValue[2]; __args[0] = new JniArgumentValue((context == null) ? IntPtr.Zero : context.Handle); __args[1] = new JniArgumentValue((attrs == null) ? IntPtr.Zero : ((Java.Lang.Object)attrs).Handle); var __r = _members.InstanceMethods.StartCreateInstance(__id, GetType(), __args); SetHandle(__r.Handle, JniHandleOwnership.TransferLocalRef); _members.InstanceMethods.FinishCreateInstance(__id, this, __args); } finally { } FixEgg(); }
public ColorButton(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { //colorInicial = "#ffbf36"; //colorProcesando = "#11bf36"; //valor = 100000000; //Click += OnClicked; Android.Content.Res.TypedArray styled = context.Theme.ObtainStyledAttributes( attrs, Resource.Styleable.ColorButton, 0, 0); try { // set the property from the attribute valor = styled.GetInt( Resource.Styleable.ColorButton_valor, 100000000); colorInicial = styled.GetText( Resource.Styleable.ColorButton_colorInicial); colorProcesando = styled.GetText( Resource.Styleable.ColorButton_colorProcesando); } finally { // clean up styled.Recycle(); styled.Dispose(); } Click += OnClicked; }
public TreeView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { _allNodes = new List <TreeNode> (); _currentShowNodes = new List <TreeNode> (); _treeViewAdapter = new TreeViewAdapter(context, _currentShowNodes); this.Adapter = _treeViewAdapter; }
/** * Parse attributes during inflation from a view hierarchy into the * arguments we handle. */ public override void OnInflate(Activity activity, Android.Util.IAttributeSet attrs, Bundle savedInstanceState) { base.OnInflate(activity, attrs, savedInstanceState); var a = activity.ObtainStyledAttributes(attrs, Resource.Styleable.FragmentArguments); mLabel = a.GetText(Resource.Styleable.FragmentArguments_android_label); a.Recycle(); }
public CustomImageView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { arrow = BitmapFactory.DecodeResource(Resources, Resource.Drawable.arrow); SetWillNotDraw(false); this.BuildDrawingCache(true); bitmap = this.GetDrawingCache(true); }
public FluidSliderView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { InitPaints(); var ion = AppState.context; __pressureUnit = ion.preferences.units.pressure; __temperatureUnit = ion.preferences.units.temperature; ptChart = ion.fluidManager.lastUsedFluid.GetPtChart(Fluid.EState.Bubble); isTouchLocked = false; }
public override View OnCreateView(String name, Context context, Android.Util.IAttributeSet attrs) { var result = base.OnCreateView(name, context, attrs); //var textureView = result.FindViewById<TextureView>(Resource.Id.textureView); //var st = new Surface(textureView.SurfaceTexture); //textureView.SurfaceTextureListener = mSurfaceTextureListener; //Video.Decoder.surface = st; return(result); }
public Cell(Context context, Android.Util.IAttributeSet attrs, int defStyleAttr) : base(context, attrs, defStyleAttr) { if (attrs != null) { var styledAttrs = context.ObtainStyledAttributes(attrs, Resource.Styleable.Cell); title = styledAttrs.GetString(Resource.Styleable.Cell_title); description = styledAttrs.GetString(Resource.Styleable.Cell_description); var orientationOrdinal = styledAttrs.GetInt(Resource.Styleable.Cell_orientation, (int)DefaultOrientation); orientation = (CellOrientation)orientationOrdinal; styledAttrs.Recycle(); } }
private void Initialize(Context context, Android.Util.IAttributeSet attrs) { this.context = context; try { var values = context.ObtainStyledAttributes(attrs, Resource.Styleable.HeightAdjustableImageView); widthRatio = values.GetFloat(Resource.Styleable.HeightAdjustableImageView_ratio, 1.0f); values.Recycle(); this.Invalidate(); } catch (Exception ex) { } }
private void InitAttrs(Context context, AttributeSet attrs) { try { TypedArray ta = context.ObtainStyledAttributes(attrs, Resource.Styleable.LoadingView); int loadingRendererId = ta.GetInt(Resource.Styleable.LoadingView_loading_renderer, 0); LoadingRenderer = LoadingRendererFactory.CreateLoadingRenderer(context, loadingRendererId); ta.Recycle(); } catch (Exception e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } }
public HelloRhinoView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { // Create an OpenGL ES 2.0 context. SetEGLContextClientVersion(2); // Set the Renderer for drawing on the GLSurfaceView AndroidRenderer = new HelloRhinoAndroidRenderer(); SetRenderer(AndroidRenderer); // The renderer only renders when the surface is created, or when requestRender() is called. this.RenderMode = Rendermode.WhenDirty; ZoomDetector = new ScaleGestureDetector(context, new ZoomScaleListener(AndroidRenderer)); OrbitDollyDetector = new OrbitDollyGestureDetector(); DoubleTapDetector = new GestureDetector(new DoubleTapListener(AndroidRenderer)); DoubleTapDetector.SetOnDoubleTapListener(new DoubleTapListener(AndroidRenderer)); }
private void GetAttrs(Context context, AttributeSet attrs) { TypedArray a = context.ObtainStyledAttributes(attrs, Resource.Styleable.AlphaMaskLayout); alphaFrom = a.GetInt(Resource.Styleable.AlphaMaskLayout_aml_alpha_from, DEFAULT_ALPHA_FROM); alphaTo = a.GetInt(Resource.Styleable.AlphaMaskLayout_aml_alpha_to, DEFAULT_ALPHA_TO); duration = a.GetInt(Resource.Styleable.AlphaMaskLayout_aml_duration, DEFAULT_DURATION); a.Recycle(); //init foreground alpha if (Foreground == null) { Foreground = new ColorDrawable(Color.ParseColor(DEFAULT_COLOR)); } Foreground.Alpha = 0; CheckAttrsValues(); }
// Constructor para XML public LayoutPersonalizado(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { Android.Content.Res.TypedArray styled = context.Theme.ObtainStyledAttributes( attrs, Resource.Styleable.LayoutPersonalizado, 0, 0); try { // set the property from the attribute colorBotonGuardar = styled.GetText(Resource.Styleable.LayoutPersonalizado_colorBotonGuardar); colorBotonActualizar = styled.GetText(Resource.Styleable.LayoutPersonalizado_colorBotonActualizar); colorBotonBorrar = styled.GetText(Resource.Styleable.LayoutPersonalizado_colorBotonBorrar); this.Orientation = Orientation.Vertical; TextView txtEtiqueta = new TextView(context); txtEtiqueta.SetText(Resource.String.etiqueta); this.AddView(txtEtiqueta); EditText editTexto = new EditText(context); editTexto.InputType = Android.Text.InputTypes.ClassText; this.AddView(editTexto); Button botonGuardar = new Button(context); botonGuardar.Text = "Guardar"; botonGuardar.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorBotonGuardar)); this.AddView(botonGuardar); Button botonActualizar = new Button(context); botonActualizar.Text = "Actualizar"; botonGuardar.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorBotonActualizar)); this.AddView(botonActualizar); Button botonBorrar = new Button(context); botonBorrar.Text = "Borrar"; botonGuardar.SetBackgroundColor(Android.Graphics.Color.ParseColor(colorBotonBorrar)); this.AddView(botonBorrar); } finally { // clean up styled.Recycle(); styled.Dispose(); } }
public IconButton(Context context, AttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { Init(); }
public IconButton(Context context, AttributeSet attrs) : base(context, attrs) { Init(); }
public OcrResultView(Context context, Android.Util.IAttributeSet attrs, int defStyleAttr) : base(context, attrs, defStyleAttr) { Init(); }
public OcrResultView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { Init(); }
public RoundMenuView(Context context, IAttributeSet attrs) : base(context, attrs) { }
public CachedImageFastRenderer(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { }
public CachedImageRenderer(Context context, Android.Util.IAttributeSet attrs) : this(context) { }
/** * Standard View constructor. In order to render something, you must call * {@link #setRenderer} to register a renderer. */ public GLSurfaceView(Context context, AttributeSet attrs) : base(context, attrs) { this.Init(); }
public IconTextView(Context context, AttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { Init(); }
public IconTextView(Context context, AttributeSet attrs) : base(context, attrs) { Init(); }
public FooterView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { Initialize(); }
public RoundMenuView(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { }
public FooterView(Context context, Android.Util.IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { Initialize(); }
public BindableViewPager(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { }
public UpcomingListLayout(Android.Content.Context context, Android.Util.IAttributeSet attrs) : base(context, attrs, new MedicationOncommingAdapter(context)) { }
public MedicationDosageTimeLayout(Android.Content.Context context, Android.Util.IAttributeSet attrs) : base(context, attrs, new MedicationDosageTimeListAdapter(context)) { }
public DrivingLicenseResultView(Context context, Android.Util.IAttributeSet attrs) : base(context, attrs) { Init(); }