android-seekbar

Android SeekBar thumb gets clipped/cut off

余生长醉 提交于 2019-11-27 00:42:25
问题 When using a custom thumb drawable with a SeekBar view, the thumb drawable is clipped at the left and right edges of the view. How can I fix this behavior? 回答1: You should be able to fix this by setting paddingLeft and paddingRight on your SeekBar to half the thumb width (remember to use density-independent units). You can also control the space allowed at the edges for a seek bar's thumb by calling setThumbOffset. 回答2: I ran into this issue myself, and I believe the "correct" decision would

SeekBar and media player in android

一笑奈何 提交于 2019-11-27 00:13:39
I have a simple player and recorder. Everything works great but have a one problem. I want to add seek bar to see progress in playing record and use this seek bar to set place from player should play. I have onProgress but with no effect. This is code: package com.example.recorder; import java.io.IOException; import android.app.Activity; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.os.Bundle; import android.os.Environment; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import

Custom seekbar thumb not transparent on Lollipop API21

纵然是瞬间 提交于 2019-11-26 20:31:06
问题 This is my seekbar : <SeekBar android:id="@+id/seek1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:progressDrawable="@drawable/style_progressbar" android:thumb="@drawable/style_progressbar_circle" android:progress="20" /> This is style_progressbar.xml : <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape android:shape="rectangle" > <corners android:radius="5dp"

SeekBar and media player in android

寵の児 提交于 2019-11-26 17:27:51
问题 I have a simple player and recorder. Everything works great but have a one problem. I want to add seek bar to see progress in playing record and use this seek bar to set place from player should play. I have onProgress but with no effect. This is code: package com.example.recorder; import java.io.IOException; import android.app.Activity; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.os.Bundle; import android.os.Environment; import android.util.Log;

Android - styling seek bar

倖福魔咒の 提交于 2019-11-26 01:36:49
问题 I wanted to style a seek bar which looks like the one in the image below. By using default seekbar I will get something like this: So what I need is to only change the color. I need no extra styles. Is there any straight forward approach to do this or should I build my custom drawable.? I tried building custom one, but I could not get the exact one as shown above. After using custom drawable, what I get is as shown below: If I need to build the custom one, then please suggest how to reduce