protected override void UpdateCaptionDisplay(View cell) { if (cell == null) { return; } TextView label; SeekBar slider; ImageView left; ImageView right; DroidResources.DecodeFloatElementLayout(Context, cell, out label, out slider, out left, out right); if (label != null) { if (ShowCaption) { label.Text = Caption; } else { label.Visibility = ViewStates.Gone; } } }
protected override void UpdateDetailDisplay(View cell) { if (cell == null) { return; } TextView label; SeekBar slider; ImageView left; ImageView right; DroidResources.DecodeFloatElementLayout(Context, cell, out label, out slider, out left, out right); if (left != null) { if (Left != null) { left.SetImageBitmap(Left); } else { left.Visibility = ViewStates.Gone; } } if (right != null) { if (Right != null) { right.SetImageBitmap(Right); } else { right.Visibility = ViewStates.Gone; } } if (slider != null) { // Setting the two slider properties should be an atomic operation with no side effects. // However, setting Max may trigger OnProgressChanged, which will modify Value, // which will then be wrong when setting Progress. // Temporarily remove the listener to get over this hump. slider.SetOnSeekBarChangeListener(null); try { slider.Max = (int)((_maxValue - _minValue) * Precision); slider.Progress = (int)((Value - _minValue) * Precision); } finally { slider.SetOnSeekBarChangeListener(this); } } }
protected override View GetViewImpl(Context context, View convertView, ViewGroup parent) { View view = DroidResources.LoadFloatElementLayout(context, convertView, parent, LayoutName); if (view != null) { TextView label; SeekBar slider; ImageView left; ImageView right; DroidResources.DecodeFloatElementLayout(Context, view, out label, out slider, out left, out right); slider.SetOnSeekBarChangeListener(this); } else { Android.Util.Log.Error("FloatElement", "GetViewImpl failed to load template view"); } return(view); }
protected override void UpdateDetailDisplay(View cell) { if (cell == null) { return; } TextView label; SeekBar slider; ImageView left; ImageView right; DroidResources.DecodeFloatElementLayout(Context, cell, out label, out slider, out left, out right); if (left != null) { if (Left != null) { left.SetImageBitmap(Left); } else { left.Visibility = ViewStates.Gone; } } if (right != null) { if (Right != null) { right.SetImageBitmap(Right); } else { right.Visibility = ViewStates.Gone; } } if (slider != null) { slider.Max = (int)((_maxValue - _minValue) * precision); slider.Progress = (int)((Value - _minValue) * precision); } }