Ejemplo n.º 1
0
 public virtual Com.Zhy.Adapter.Abslistview.ViewHolder SetImageDrawable(int viewId
                                                                        , Android.Graphics.Drawables.Drawable drawable)
 {
     Android.Widget.ImageView view = GetView <ImageView>(viewId);
     view.SetImageDrawable(drawable);
     return(this);
 }
Ejemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.fragment_makeorderpartlist, container, false);

            partList = view.FindViewById <RecyclerView>(Resource.Id.makeorderpartlist_partList);
            partList.SetLayoutManager(new LinearLayoutManager(this.Context));
            var dividerItemDecoration = new DividerItemDecoration(partList.Context, DividerItemDecoration.Vertical);

            dividerItemDecoration.SetDrawable(ContextCompat.GetDrawable(this.Context, Resource.Drawable.line_devider));
            partList.AddItemDecoration(dividerItemDecoration);

            cardView = view.FindViewById <CardView>(Resource.Id.makeorderpartlist_bottom_sheet);

            bottomSheetBehavior = From(cardView);
            bottomSheetBehavior.SetBottomSheetCallback(new PartFragmentBehavior());
            bottomSheetBehavior.PeekHeight = 140;
            image      = view.FindViewById <Android.Widget.ImageView>(Resource.Id.makeorderpartlist_image);
            zoomLayout = view.FindViewById <ZoomableLayout>(Resource.Id.zoomableLayout);

            var list    = new List <Dictionary <string, object> >();
            var adapter = new PartListAdapter(null);

            adapter.ItemClick  += PartList_ItemClick;
            adapter.LaborClick += PartList_LaborClick;
            partList.SetAdapter(adapter);
            return(view);
        }
Ejemplo n.º 3
0
 public virtual Com.Zhy.Adapter.Abslistview.ViewHolder SetImageBitmap(int viewId,
                                                                      Android.Graphics.Bitmap bitmap)
 {
     Android.Widget.ImageView view = GetView <ImageView>(viewId);
     view.SetImageBitmap(bitmap);
     return(this);
 }
Ejemplo n.º 4
0
 public virtual Com.Zhy.Adapter.Abslistview.ViewHolder SetImageResource(int viewId
                                                                        , int resId)
 {
     Android.Widget.ImageView view = GetView <ImageView>(viewId);
     view.SetImageResource(resId);
     return(this);
 }
        protected override void OnElementChanged(ElementChangedEventArgs <VideoPlayer> args)
        {
            base.OnElementChanged(args);

            if (args.NewElement != null)
            {
                if (Control == null)
                {
                    // Save the VideoView for future reference
                    InitializePlayer();
                    //videoView = new VideoView(Context);

                    // Put the VideoView in a RelativeLayout
                    relativeLayout = new ARelativeLayout(Context);
                    //relativeLayout.AddView(videoView);
                    relativeLayout.AddView(PlayerView);
                    // Center the VideoView in the RelativeLayout
                    ARelativeLayout.LayoutParams layoutParams =
                        new ARelativeLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
                    layoutParams.AddRule(LayoutRules.CenterInParent);
                    // videoView.LayoutParameters = layoutParams;
                    PlayerView.LayoutParameters = layoutParams;
                    PlayerView.SetShowBuffering(true);
                    PlayerView.ControllerAutoShow = false;
                    // Handle a VideoView event
                    // videoView.Prepared += OnVideoViewPrepared;
                    SetNativeControl(relativeLayout);
                    mFullScreen = PlayerView.FindViewById <Android.Widget.ImageView>(Resource.Id.exo_fullscreen_icon);
                    mainpage    = ((ViewGroup)PlayerView.Parent);
                    initFullscreenDialog();
                    mFullScreen.Click += MFullScreen_Click;
                }


                SetAreTransportControlsEnabled();
                SetSource();

                args.NewElement.UpdateStatus   += OnUpdateStatus;
                args.NewElement.PlayRequested  += OnPlayRequested;
                args.NewElement.PauseRequested += OnPauseRequested;
                args.NewElement.StopRequested  += OnStopRequested;
            }

            if (args.OldElement != null)
            {
                args.OldElement.UpdateStatus   -= OnUpdateStatus;
                args.OldElement.PlayRequested  -= OnPlayRequested;
                args.OldElement.PauseRequested -= OnPauseRequested;
                args.OldElement.StopRequested  -= OnStopRequested;
            }
        }
Ejemplo n.º 6
0
        async protected override void OnElementChanged(ElementChangedEventArgs <ImageControl> e)
        {
            base.OnElementChanged(e);

            m_control = e.NewElement;

            if (e.OldElement == null)
            {
                var nativeControl = new Android.Widget.FrameLayout(Context);
                nativeControl.LayoutParameters = new FrameLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
                nativeControl.SetBackgroundColor(m_control.BackgroundColor.ToAndroid());


                m_iconImageView = new Android.Widget.ImageView(Context);
                m_iconImageView.LayoutParameters = new FrameLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
                nativeControl.AddView(m_iconImageView);

                m_iconBitmap = await GetBitmapAsync(m_control.ImageUrl);

                if (m_iconBitmap != null)
                {
                    m_iconImageView.SetImageBitmap(m_iconBitmap);
                }

                SetNativeControl(nativeControl);
            }
            else
            {
                if (m_control.ImageUrl != e.OldElement.ImageUrl)
                {
                    m_iconBitmap = await GetBitmapAsync(m_control.ImageUrl);

                    if (m_iconBitmap != null)
                    {
                        m_iconImageView.SetImageBitmap(m_iconBitmap);
                    }
                }
            }
        }
Ejemplo n.º 7
0
            /// <summary>
            /// Modifies the view before adding it to the gridview.
            /// </summary>
            protected override void InvokeCallback(string url, Android.Widget.ImageView iv, Android.Graphics.Bitmap bitmap, AjaxStatus status)
            {
                //imageViewOriginial = iv;
                iv.LayoutParameters = new RelativeLayout.LayoutParams(WindowManagerLayoutParams.MatchParent, _width);
                iv.SetScaleType(Android.Widget.ImageView.ScaleType.FitXy);
                //iv.SetPadding (2, 2, 2, 2);

                //Matrix used to crop image
                Matrix matrix = new Matrix();

                matrix.PostScale(0.5f, 0.5f);

                int size = _bm.Width;

                if (size >= 40)
                {
                    size = 40;
                }

                iv.SetImageBitmap(global::Android.Graphics.Bitmap.CreateBitmap(_bm, 0, 0, size, size, matrix, true));
                iv = null;
                _bm.Recycle();
            }
        private void FindView(View view)
        {
            _titleTextView = view.FindViewById <Android.Support.V7.Widget.AppCompatTextView>(Resource.Id.fingerprint_dialog_title_default);
            if (string.IsNullOrWhiteSpace(_dialogConfiguration.DialogTitle))
            {
                _titleTextView.Visibility = ViewStates.Gone;
            }
            else
            {
                _titleTextView.Text = _dialogConfiguration.DialogTitle;
            }

            _descTextView = view.FindViewById <Android.Support.V7.Widget.AppCompatTextView>(Resource.Id.fingerprint_dialog_message_default);
            if (string.IsNullOrWhiteSpace(_dialogConfiguration.DialogDescription))
            {
                _descTextView.Visibility = ViewStates.Gone;
            }
            else
            {
                _descTextView.Text = _dialogConfiguration.DialogDescription;
            }

            _fingerprintIconView = view.FindViewById <Android.Widget.ImageView>(Resource.Id.fingerprint_icon);
            _statusTextView      = view.FindViewById <Android.Support.V7.Widget.AppCompatTextView>(Resource.Id.fingerprint_dialog_status_default);
            _statusTextView.Text = _dialogConfiguration.FingerprintDialogConfiguration.FingerprintHintString;

            _alternativeActionButton        = view.FindViewById <Android.Support.V7.Widget.AppCompatButton>(Resource.Id.fingerprint_dialog_alternative_default);
            _alternativeActionButton.Text   = _dialogConfiguration.AlternativeActionMessage;
            _alternativeActionButton.Click += (s, e) =>
            {
                //_fingerprintCancellationSignal.Cancel();
                DismissDialog();
                _dialogConfiguration.AlternativeAction?.Invoke();
            };

            _fingerprintStatusPanelLinearLayout = view.FindViewById <Android.Widget.LinearLayout>(Resource.Id.fingerprint_status_panel_default);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Sets the fault image in the custom InfoWindow if available
 /// </summary>
 private void SetFaultImage(Android.Widget.ImageView faultImageView, Marker selectedMarker)
 {
     // TODO: query the database for this current marker's bitmap fault image
     //faultImageView.SetImageBitmap()
 }