[Android] [PATCH 1/3] Safer for threading

Jean-Baptiste Kempf jb at videolan.org
Mon Feb 16 17:20:32 CET 2015


OK the 3

On 16 Feb, Geoffrey Métais wrote :
> Plus, removed redundant call to onSizeChanged
> ---
>  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;
> -- 
> 2.1.0
> 
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the Android mailing list