seekbar

SurfaceView播放器篇三

旧巷老猫 提交于 2019-11-26 16:54:06
实现功能: 1、下次进入,从上一次播放位置开始播放; 2、来电保存视频进度; 3、视频未看部分不能快进; 4、适应视频大小,防止播放画面变形; 5、播放与暂停按钮; 6、按home键、查看最新打开应用键,back返回键后,再次回到或打开播放页面,不报错,能正常播放。 解决问题: 1、避免MediaPlayer error(-38, 0),MediaPlayer error(-19, 0); 2、避免Mediaplayer setVideoSurfaceTexture failed: -22问题; 3、避免进入onError回调函数后,Mediaplayer的start(),pause()方面无效果; 4、Mediaplayer onCompletion后 再次start后 再调用pause无暂停效果,还是会继续播放。 解决思路: Mediaplayer和SurfaceView都重新new一个,一切重新开始。 实现代码: import android.content.SharedPreferences; import android.media.MediaPlayer; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v7

How add TextView in middle of SeekBar thumb? [duplicate]

一笑奈何 提交于 2019-11-26 16:28:02
问题 This question already has an answer here : Combine image and text to drawable (1 answer) Closed 5 years ago . I am working in Android . I want to make a SeekBar . In thumb of SeekBar i want to show progress (probably on a TextView aligned over thumb which moves along with thumb). This is my XML for SeekBar and TextView . <SeekBar android:id="@+id/ProgressBar01" android:layout_width="fill_parent" android:paddingLeft="10px" android:paddingRight ="10px" android:layout_height="70dp" android

How to make a vertical SeekBar in Android?

本秂侑毒 提交于 2019-11-26 15:19:11
Can a seekbar be vertical? I am not very good at UI design, so how make seekbar more beautiful, please give me some templates and examples. Andro Selva Here is a very good implementation of vertical seekbar. Have a look. http://560b.sakura.ne.jp/android/VerticalSlidebarExample.zip And Here is my own implementation for Vertical and Inverted Seekbar based on this https://github.com/AndroSelva/Vertical-SeekBar-Android protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(),0); super.onDraw(c); } @Override public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) {

How can I get a working vertical SeekBar in Android?

最后都变了- 提交于 2019-11-26 14:09:58
I've implemented the commonly-pointed-to VerticalSeekBar post here . As it is, the SeekBar operates a little quirky. Here is my slightly adapted onTouchEvent() from that example: public boolean onTouchEvent(MotionEvent event) { xPos = event.getX(); yPos = event.getY(); oOffset = this.getThumbOffset(); oProgress = this.getProgress(); //Code from example - Not working //this.setThumbOffset( progress * (this.getBottom()-this.getTop()) ); this.setProgress((int)(29*yPos/this.getBottom())); return true; } I've managed to implement one VerticalSeekBar in which the progress updates as expected and is

How to set seekbar min and max value

帅比萌擦擦* 提交于 2019-11-26 12:43:21
问题 I have a seekbar and trying to set the value from 60 to 180 for one and 40 to 190 for the second one in step of 1. sb1 = (SeekBar) findViewById(R.id.progresss); sb1.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar seekBar) { // TODO Auto-generated method stub //int inVal = Integer.parseInt(String.valueOf(seekBar.getProgress())); //inVal =+ 70; //Toast.makeText(getApplicationContext(), String.valueOf(inVal),Toast.LENGTH_LONG).show();

Custom seekbar (thumb size, color and background)

假装没事ソ 提交于 2019-11-26 09:20:45
问题 I would like to have this seekbar in my Android project : This is my seekbar : <SeekBar android:id=\"@+id/seekBar_luminosite\" android:layout_width=\"@dimen/seekbar_width\" android:layout_height=\"@dimen/seekbar_height\" android:minHeight=\"15dp\" android:minWidth=\"15dp\" android:maxHeight=\"15dp\" android:maxWidth=\"15dp\" android:progress=\"@integer/luminosite_defaut\" android:progressDrawable=\"@drawable/custom_seekbar\" android:thumb=\"@drawable/custom_thumb\" /> This is my custom_thumb

Modifying the Android seekbar widget to operate vertically

ぃ、小莉子 提交于 2019-11-26 08:11:53
问题 I\'m trying to get a vertical seekbar going with the emulator, but I\'m sort of stuck. I can get the seekbar to display the way I want it to, and I can get the progress to do what I want, and I can modify the onTouchEvent to get the thumb to go vertically instead of horizontally. What I can\'t do is get the thumb to move outside of the default 29 horizontal pixels without using setThumbOffset(). This in itself isn\'t a problem. The problem is coming from the fact that I don\'t understand the

How to make a vertical SeekBar in Android?

≯℡__Kan透↙ 提交于 2019-11-26 05:25:10
问题 Can a seekbar be vertical? I am not very good at UI design, so how make seekbar more beautiful, please give me some templates and examples. 回答1: Here is a very good implementation of vertical seekbar. Have a look. http://560b.sakura.ne.jp/android/VerticalSlidebarExample.zip And Here is my own implementation for Vertical and Inverted Seekbar based on this https://github.com/AndroSelva/Vertical-SeekBar-Android protected void onDraw(Canvas c) { c.rotate(-90); c.translate(-getHeight(),0); super

Using SeekBar to Control Volume in android?

那年仲夏 提交于 2019-11-26 05:22:25
问题 How can I accurately change the volume of my app using a seekbar without controlling the volume by the volume buttons on my android device? I have seperate function on the Volume keys on my android that\'s why I want to use a seekbar to control the volume. Can Anyone please help me? 回答1: Please look at below code . It solves your problem. import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.os.Bundle; import android.widget.SeekBar;

How can I get a working vertical SeekBar in Android?

一个人想着一个人 提交于 2019-11-26 03:49:12
问题 I\'ve implemented the commonly-pointed-to VerticalSeekBar post here. As it is, the SeekBar operates a little quirky. Here is my slightly adapted onTouchEvent() from that example: public boolean onTouchEvent(MotionEvent event) { xPos = event.getX(); yPos = event.getY(); oOffset = this.getThumbOffset(); oProgress = this.getProgress(); //Code from example - Not working //this.setThumbOffset( progress * (this.getBottom()-this.getTop()) ); this.setProgress((int)(29*yPos/this.getBottom())); return