seekbar

Appium+Java笔记 查找屏幕外指定控件 ,操作seekbar

主宰稳场 提交于 2019-11-29 04:54:32
试验方法记录: 使用Java+appium,查找屏幕外控件,控制seekbar移动。 1.查找并点击Setting中的“辅助功能”;driver.findElementByAndroidUIAutomator 2.滑动“显示”中的seekbar ;driver.swipe(startX, startY, endX, endY, duration) 试验用的老平板,这种系统应用运行的比第三方应用流畅很多。 import org.junit.After; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.DesiredCapabilities; import java.net.MalformedURLException; import java.net.URL; import io.appium.java_client.android.AndroidDriver; public class TestSettingsDemo { public AndroidDriver<?> appiumDriver; @Before public

Android seekbar set custom style using nine-patch images

杀马特。学长 韩版系。学妹 提交于 2019-11-29 04:10:01
I am trying to create a custom-styled seekbar. I have two nine-patch images one is a gray stretching bar search_progress.9.png (background color) and the other is a green stretching bar search_progress_bar.9.png (foreground color). I use this xml as my seekbar's progressDrawable: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/search_progress"></item> <item android:id="@android:id/progress" android:drawable="@drawable/search_progress_bar"></item> </layer-list> My

How to Set an Android SeekBar to be unmoveable/frozen?

纵然是瞬间 提交于 2019-11-29 02:56:29
In my XML, I've set the focusable , focusableInTouchMode , clickable , and longClickable variables to false, yet I can still click and move the SeekBar. Do I need to actually change the listener events to do this? That seems so unnecessary. mySeekBar.setEnabled(false); or for XML: android:enabled="false" greg7gkb You could create a subclass whose parent is a SeekBar . In your new class, override the onTouchEvent() method to always return false. This solution should not "grey out" the seek bar since the enabled state will not change. 来源: https://stackoverflow.com/questions/4136569/how-to-set-an

How to make a color gradient in a SeekBar?

一曲冷凌霜 提交于 2019-11-29 02:45:18
I want to use a SeekBar (i.e. old school Java Slider) into a color gradient picker. I have seen some examples like this but they all require making new classes and such. There has got to be a way to modify or override the original classes. Or just replace the background with a gradient. JPM I figured it out here is how you do it. You create a standard seekbar in your XML. <SeekBar android:id="@+id/seekbar_font" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10px" android:layout_below="@id/color_font_text" android:max="100" android:progress="50"><

Discrete seekbar in Android app?

主宰稳场 提交于 2019-11-29 02:19:37
问题 I would like to create a seekbar for an Android app that allows the user to select a value between -5 and 5 (which maps to "strongly disagree" and "strongly agree"). How do I make a seekbar with discrete values? or is there a better UI widget I could use for this? Thanks. 回答1: The Seekbar works great for discrete values. We use a Seekbar for discrete data as shown below. To show which item is selected, we just change the font of the selected text view so it is bigger. You could also highlight

Android SeekBar Flipped Horizontally

北城余情 提交于 2019-11-29 02:18:33
With the Android SeekBar, you can normally drag the thumb to the left or to the right and the yellow progress color is to the left of the thumb. I want the exact opposite, essentially flipping the yellow progress color to the right of the thumb and flipping the entire SeekBar on the y-axis. Can anyone point me in the right direction? Thanks! mhenry After fiddling around with some code this is what I got and it seems to work pretty well. Hopefully it will help someone else in the future. public class ReversedSeekBar extends SeekBar { public ReversedSeekBar(Context context) { super(context); }

How to set Android SeekBar progress drawable programmatically

强颜欢笑 提交于 2019-11-29 01:47:56
I have a problem with programmatically setting the progress drawable of a SeekBar. When I set it in the .xml file everything is working fine. <SeekBar android:id="@+id/sb" android:layout_width="fill_parent" android:layout_height="wrap_content" ..... android:progressDrawable="@drawable/seek_bar"/> But, I have a problem when I try to set it from code like this: seekBar.setProgressDrawable(getResources().getDrawable(R.drawable.seek_bar)); Background drawable then takes the whole seek bar, and I'm not able to modify the progress at all later on - the thumb moves but the progress drawable still

How to change colour of the thumb in seekbar?

安稳与你 提交于 2019-11-29 01:24:37
I have the default seekbar in my android app. I noticed that when the thumb on the seekbar is held, it turns yellow. Instead, I want it to turn blue when it is held. How can this be done? I apologize if this is a basic question, I am new to android development. Thanks. If you don't like the default thumb, you will have to create your own Drawable , which you can then set the thumb in code with something like: Drawable thumb = getResources().getDrawable( R.drawable.myThumb ); SeekBar mSeekBar = (SeekBar) findViewById(R.id.mySeekBar); mSeekbar.setThumb(thumb); Or you can set the thumb in XML

Android media player and seekbar sync issue

爱⌒轻易说出口 提交于 2019-11-29 00:41:35
I am working on a media player app. I am trying to sync it to a seekbar so that when media is played the seek bar progresses automatically. Here is my source code: public class MusicDroid extends ListActivity implements SeekBar.OnSeekBarChangeListener, Runnable { private int cur_time = 0; private SeekBar seekbar; int song_dur = 0; GroveService gs; public Chronometer timer; int timer_time = 0; @Override public void onCreate(Bundle icicle) { try { super.onCreate(icicle); setContentView(R.layout.songlist); gs = new GroveService(); gs.updateSongList(); } catch (NullPointerException e) { Log.v

Create Custom Seekbar in android

蓝咒 提交于 2019-11-28 22:11:43
can any one help me to create balow image cutomize seek bar i have already go throught SeekBar with custom thumb and segmented text and SeekBar Thumb position issue but i am not success to create my custome seekbar pls help me Use Library From This Link: This link and put into your project, Now Create A Seekbar Like This Class: package com.tokaracamara.android.verticalslidevar; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android