[Android] Safer for threading

Geoffrey Métais git at videolan.org
Tue Feb 17 10:55:31 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 16 16:33:55 2015 +0100| [7c91fed99b21b2bcb7da6260766b9aac5d500b44] | committer: Geoffrey Métais

Safer for threading

Plus, removed redundant call to onSizeChanged

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7c91fed99b21b2bcb7da6260766b9aac5d500b44
---

 vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java    |    5 +++--
 vlc-android/src/org/videolan/vlc/widget/VerticalSeekBar.java |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java b/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
index 65af6ed..9da56f2 100644
--- a/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
@@ -130,8 +130,9 @@ public class BrowserActivity extends ListActivity {
                 // remove any checkmarks of the custom item
                 final MediaDatabase dbManager = MediaDatabase.getInstance();
                 for(File f : dbManager.getMediaDirs()) {
-                    if(f.getPath().startsWith(item.getPath()))
-                        dbManager.removeDir(f.getPath());
+                    final String path = f.getPath();
+                    if(path.startsWith(item.getPath()))
+                        dbManager.removeDir(path);
                 }
                 CustomDirectories.removeCustomDirectory(item.getPath());
                 refresh();
diff --git a/vlc-android/src/org/videolan/vlc/widget/VerticalSeekBar.java b/vlc-android/src/org/videolan/vlc/widget/VerticalSeekBar.java
index b451321..360cd64 100644
--- a/vlc-android/src/org/videolan/vlc/widget/VerticalSeekBar.java
+++ b/vlc-android/src/org/videolan/vlc/widget/VerticalSeekBar.java
@@ -100,8 +100,8 @@ public class VerticalSeekBar extends SeekBar {
             case MotionEvent.ACTION_MOVE:
                 if (mIsMovingThumb) {
                     final int max = getMax();
-                    setProgress( max - (int) (max* event.getY() / getHeight()));
-                    onSizeChanged(getWidth(), getHeight(), 0, 0);
+                    final int progress = max - (int) (max* event.getY() / getHeight());
+                    setProgress(progress);
                     handled = true;
                 }
                 break;



More information about the Android mailing list