当前位置: 首页>>代码示例>>C#>>正文


C# Widget.SeekBar类代码示例

本文整理汇总了C#中Android.Widget.SeekBar的典型用法代码示例。如果您正苦于以下问题:C# SeekBar类的具体用法?C# SeekBar怎么用?C# SeekBar使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SeekBar类属于Android.Widget命名空间,在下文中一共展示了SeekBar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SeekBarOnProgressChanged

 private void SeekBarOnProgressChanged(object sender, SeekBar.ProgressChangedEventArgs progressChangedEventArgs)
 {            
     // Time shifting range: 50% to 150%. Seek bar range: 0-1000
     float timeShiftingValue = (((float)_seekBar.Progress) / 10f) + 50f;
     //Console.WriteLine("SeekBarProgressChanged progress: {0} timeShiftingValue: {1}", _seekBar.Progress, timeShiftingValue);
     OnSetTimeShifting(timeShiftingValue);
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:7,代码来源:TimeShiftingFragment.cs

示例2: DecodeFloatElementLayout

        public static void DecodeFloatElementLayout(Context context, View layout, out TextView label, out SeekBar slider,
                                                    out ImageView left, out ImageView right)
        {
            if (layout == null)
            {
                label = null;
                slider = null;
                left = null;
                right = null;
                return;
            }

            label =
                layout.FindViewById<TextView>(context.Resources.GetIdentifier("dialog_LabelField", "id",
                                                                              context.PackageName));
            slider =
                layout.FindViewById<SeekBar>(context.Resources.GetIdentifier("dialog_SliderField", "id",
                                                                             context.PackageName));
            left =
                layout.FindViewById<ImageView>(context.Resources.GetIdentifier("dialog_ImageLeft", "id",
                                                                               context.PackageName));
            right =
                layout.FindViewById<ImageView>(context.Resources.GetIdentifier("dialog_ImageRight", "id",
                                                                               context.PackageName));
        }
开发者ID:talisqualis,项目名称:MvvmCross-Build,代码行数:25,代码来源:DroidResources.cs

示例3: SetTint

 public static void SetTint(SeekBar seekBar, Color color)
 {
     ColorStateList s1 = ColorStateList.ValueOf(color);
     if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
     {
         seekBar.ThumbTintList = s1;
         seekBar.ProgressTintList = s1;
     }
     else if (Build.VERSION.SdkInt > BuildVersionCodes.GingerbreadMr1)
     {
         Drawable progressDrawable = DrawableCompat.Wrap(seekBar.ProgressDrawable);
         seekBar.ProgressDrawable = progressDrawable;
         DrawableCompat.SetTintList(progressDrawable, s1);
         if (Build.VERSION.SdkInt >= BuildVersionCodes.JellyBean)
         {
             Drawable thumbDrawable = DrawableCompat.Wrap(seekBar.Thumb);
             DrawableCompat.SetTintList(thumbDrawable, s1);
             seekBar.SetThumb(thumbDrawable);
         }
     }
     else
     {
         PorterDuff.Mode mode = PorterDuff.Mode.SrcIn;
         if (Build.VERSION.SdkInt <= BuildVersionCodes.GingerbreadMr1)
         {
             mode = PorterDuff.Mode.Multiply;
         }
         if (seekBar.IndeterminateDrawable != null)
             seekBar.IndeterminateDrawable.SetColorFilter(color, mode);
         if (seekBar.ProgressDrawable != null)
             seekBar.ProgressDrawable.SetColorFilter(color, mode);
     }
 }
开发者ID:devxiaruwei,项目名称:MaterialDialogs,代码行数:33,代码来源:MDTintHelper.cs

示例4: SetTheme

		public static void SetTheme(SeekBar seekBar, FlatTheme theme)
		{
			// setting thumb
			var thumb = new PaintDrawable(theme.DarkAccentColor);
			thumb.SetCornerRadius(15);
			thumb.SetIntrinsicWidth(30);
			thumb.SetIntrinsicHeight(30);
			seekBar.SetThumb(thumb);

			// progress
			var progress = new PaintDrawable(theme.BackgroundColor);
			progress.SetCornerRadius(10);
			progress.SetIntrinsicHeight(10);
			progress.SetIntrinsicWidth(5);
			progress.SetDither(true);
			var progressClip = new ClipDrawable(progress, GravityFlags.Left, ClipDrawableOrientation.Horizontal);

			// secondary progress
			var secondary = new PaintDrawable(theme.LightAccentColor);
			secondary.SetCornerRadius(10);
			secondary.SetIntrinsicHeight(10);
			var secondaryProgressClip = new ClipDrawable(secondary, GravityFlags.Left, ClipDrawableOrientation.Horizontal);

			// background
			PaintDrawable background = new PaintDrawable(theme.VeryLightAccentColor);
			background.SetCornerRadius(10);
			background.SetIntrinsicHeight(10);

			// applying drawable
			LayerDrawable ld = (LayerDrawable) seekBar.ProgressDrawable;
			ld.SetDrawableByLayerId(Android.Resource.Id.Background, background);
			ld.SetDrawableByLayerId(Android.Resource.Id.Progress, progressClip);
			ld.SetDrawableByLayerId(Android.Resource.Id.SecondaryProgress, secondaryProgressClip);
		}
开发者ID:kuruminbr,项目名称:FlatUI.Xamarin.Android,代码行数:34,代码来源:FlatSeekBar.cs

示例5: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            Console.WriteLine("EqualizerPresetsActivity - OnCreate");
            base.OnCreate(bundle);

            _navigationManager = Bootstrapper.GetContainer().Resolve<MobileNavigationManager>();
            SetContentView(Resource.Layout.EqualizerPresets);
            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            _seekBarVolume = FindViewById<SeekBar>(Resource.Id.equalizerPresets_seekBarVolume);
            _seekBarVolume.ProgressChanged += (sender, args) => OnSetVolume(1);

            _btnBypass = FindViewById<ToggleButton>(Resource.Id.equalizerPresets_btnBypass);
            _btnBypass.Click += (sender, args) => OnBypassEqualizer();

            _outputMeter = FindViewById<OutputMeterView>(Resource.Id.equalizerPresets_outputMeterView);

            _listView = FindViewById<ListView>(Resource.Id.equalizerPresets_listView);
            _listAdapter = new EqualizerPresetsListAdapter(this, _listView, new List<EQPreset>());
            _listView.SetAdapter(_listAdapter);
            _listView.ItemClick += ListViewOnItemClick;
            _listView.ItemLongClick += ListViewOnItemLongClick;

            // Save the source activity type for later (for providing Up navigation)
            _sourceActivityType = Intent.GetStringExtra("sourceActivity");

            // Since the onViewReady action could not be added to an intent, tell the NavMgr the view is ready
            //((AndroidNavigationManager)_navigationManager).SetEqualizerPresetsActivityInstance(this);
            _navigationManager.BindEqualizerPresetsView(null, this);
        }
开发者ID:pascalfr,项目名称:MPfm,代码行数:31,代码来源:EqualizerPresetsActivity.cs

示例6: OnProgressChanged

 public void OnProgressChanged(SeekBar seekBar, int progress, bool fromUser)
 {
     if(fromUser)
     {
         _requestedSeek = (double)progress / seekBar.Max;
     }
 }
开发者ID:jcwmoore,项目名称:ampache-net,代码行数:7,代码来源:NowPlaying.cs

示例7: LoadLayout

		public static View LoadFloatElementLayout
			(
			  Context context
			, View convertView
			, ViewGroup parent
			, int layoutId
			, out TextView label
			, out SeekBar slider
			, out ImageView left
			, out ImageView right
			)
		{
			string msg = "DroidResources.LoadFloatElementLayout " + "layoutid=" + layoutId.ToString();
			Log.Info("MM.D", msg);
			Debug.WriteLine(msg);

			View layout = convertView ?? LoadLayout(context, parent, layoutId);
			if (layout != null)
			{
				label = layout.FindViewById<TextView>(context.Resources.GetIdentifier("dialog_LabelField", "id", context.PackageName));
				slider = layout.FindViewById<SeekBar>(context.Resources.GetIdentifier("dialog_SliderField", "id", context.PackageName));
				left = layout.FindViewById<ImageView>(context.Resources.GetIdentifier("dialog_ImageLeft", "id", context.PackageName));
				right = layout.FindViewById<ImageView>(context.Resources.GetIdentifier("dialog_ImageRight", "id", context.PackageName));
			}
			else
			{
				label = null; 
				slider = null;
				left = right = null;
			}
			return layout;
		}
开发者ID:moljac,项目名称:MonoMobile.Dialog,代码行数:32,代码来源:DroidResources.cs

示例8: OnProgressChanged

 public void OnProgressChanged(SeekBar seekBar, int progress, bool fromUser)
 {
     if (fromUser)
     {
         _textView.Text = string.Format("The you adjusted the value of the SeekBar to {0}", seekBar.Progress);
     }
 }
开发者ID:yofanana,项目名称:recipes,代码行数:7,代码来源:MainActivity.cs

示例9: InitCurrentValueSeekBar1

 protected void InitCurrentValueSeekBar1()
 {
     CurrentValueSeekBar1 = FindViewById<SeekBar> (Resource.Id.currentValueSeekBar1);
     CurrentValueSeekBar1.Max = 400;
     CurrentValueSeekBar1.Progress = 50;
     CurrentValueSeekBar1.ProgressChanged += HandleCurrentValue1Changed;
 }
开发者ID:benbishop,项目名称:xamarin_razor_svg,代码行数:7,代码来源:MainActivity.cs

示例10: SeekBar_ProgressChanged

        private void SeekBar_ProgressChanged(object sender, SeekBar.ProgressChangedEventArgs e)
        {
            var seekBar = (SeekBar)sender;
            var textViewChanged = textViews[seekBar.Id];
            textViewChanged.Text = seekBar.Progress.ToString();
            Android.Graphics.Color backgroundColor; // = new Android.Graphics.Color();
            switch (seekBar.Id)
            {
                case Resource.Id.redSeekBar:
                    backgroundColor = new Android.Graphics.Color(seekBar.Progress, 0, 0);
                    finalColor.R = (byte)seekBar.Progress;
                    break;
                case Resource.Id.greenSeekBar:
                    backgroundColor = new Android.Graphics.Color(0, seekBar.Progress, 0);
                    finalColor.G = (byte)seekBar.Progress;
                    break;
                case Resource.Id.blueSeekBar:
                    backgroundColor = new Android.Graphics.Color(0, 0, seekBar.Progress);
                    finalColor.B = (byte)seekBar.Progress;
                    break;
                default:
                    backgroundColor = new Android.Graphics.Color(255, 255, 255);
                    break;
            }

            textViewChanged.SetBackgroundColor(backgroundColor);
            colorValue.SetBackgroundColor(finalColor);
            colorValue.Text = GetHexValue();
        }
开发者ID:GerardoHP,项目名称:DaftPunkHelmet,代码行数:29,代码来源:ColorPickerActivity.cs

示例11: SeekBarOnProgressChanged

 private void SeekBarOnProgressChanged(object sender, SeekBar.ProgressChangedEventArgs e)
 {
     // Pitch shifting range: -12 to +12. Seek bar range: 0-23
     int interval = _seekBar.Progress - 12;
     //Console.WriteLine("SeekBarProgressChanged progress: {0} interval: {1}", _seekBar.Progress, interval);
     OnSetInterval(interval);
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:7,代码来源:PitchShiftingFragment.cs

示例12: OnCreateView

        protected override View OnCreateView(ViewGroup parent)
        {
            var view = base.OnCreateView(parent);
            _seekBar = view.FindViewById<SeekBar>(Sessions.Android.Resource.Id.seekBarPreference_seekBar);
            _lblTitle = view.FindViewById<TextView>(Sessions.Android.Resource.Id.seekBarPreference_lblTitle);
            _lblMinValue = view.FindViewById<TextView>(Sessions.Android.Resource.Id.seekBarPreference_lblMinValue);
            _lblMaxValue = view.FindViewById<TextView>(Sessions.Android.Resource.Id.seekBarPreference_lblMaxValue);
            _lblValue = view.FindViewById<TextView>(Sessions.Android.Resource.Id.seekBarPreference_lblValue);

            _lblTitle.Text = _title;
            _seekBar.Max = _maxValue;
            _seekBar.SetOnSeekBarChangeListener(this);

            var layout = (LinearLayout) view;
            layout.SetPadding(0, 0, 0, 0);
            layout.Orientation = Orientation.Vertical;

            // Hide standard preference widgets
            int childCount = layout.ChildCount;
            for (int i = 0; i < childCount; i++)
            {
                var v = layout.GetChildAt(i);
                if(v.Id != Android.Resource.Id.WidgetFrame)
                    v.Visibility = ViewStates.Gone;
            }

            return view;
        }
开发者ID:pascalfr,项目名称:MPfm,代码行数:28,代码来源:SeekBarPreference.cs

示例13: HandleUpdateSpeedChanged

 protected void HandleUpdateSpeedChanged(object sender, SeekBar.ProgressChangedEventArgs e)
 {
     if(UpdateSpeedSeekBar.Progress == 0){
         UpdateSpeedSeekBar.Progress = 1;
     }
     UpdateTimerInterval();
     UpdateSpeedLabelText();
 }
开发者ID:benbishop,项目名称:xamarin_razor_svg,代码行数:8,代码来源:MainActivity.cs

示例14: Init

			public void Init (TextView title, SeekBar seek)
			{
				// This called by the containing activity to supply the surrounding
				// state of the content browser that it will interact with.
				mTitleView = title;
				mSeekView = seek;
				SetNavVisibility (true);
			}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:8,代码来源:ContentBrowserActivity.cs

示例15: UpdateColor

 private void UpdateColor(object sender, SeekBar.ProgressChangedEventArgs e)
 {
     int colR = (r.Progress * 255) / 100;
     int colG = (g.Progress * 255) / 100;
     int colB = (b.Progress * 255) / 100;
     color = new Color(colR, colG, colB);
     col.SetBackgroundColor(color);
 }
开发者ID:evelinemart,项目名称:App1,代码行数:8,代码来源:ColorSelectActivity.cs


注:本文中的Android.Widget.SeekBar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。