From 1945f477913a0a2e4d6e1a33caf8a81f841abc50 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 25 Jun 2018 16:02:30 +0200 Subject: global: Small cleanups --- .../main/java/com/wireguard/android/util/SharedLibraryLoader.java | 4 ++-- .../java/com/wireguard/android/widget/fab/FloatingActionsMenu.java | 2 +- .../java/com/wireguard/android/widget/fab/TouchDelegateGroup.java | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/src/main/java/com/wireguard/android/util/SharedLibraryLoader.java b/app/src/main/java/com/wireguard/android/util/SharedLibraryLoader.java index 5d01a4fd..b4d9a3aa 100644 --- a/app/src/main/java/com/wireguard/android/util/SharedLibraryLoader.java +++ b/app/src/main/java/com/wireguard/android/util/SharedLibraryLoader.java @@ -27,7 +27,7 @@ public final class SharedLibraryLoader { try { System.loadLibrary(libName); return; - } catch (UnsatisfiedLinkError e) { + } catch (final UnsatisfiedLinkError e) { Log.d(TAG, "Failed to load library normally, so attempting to extract from apk", e); noAbiException = e; } @@ -59,7 +59,7 @@ public final class SharedLibraryLoader { } System.load(f.getAbsolutePath()); return; - } catch (Exception e) { + } catch (final Exception e) { Log.d(TAG, "Failed to load library apk:/" + libZipPath, e); noAbiException = e; } finally { diff --git a/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java b/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java index a6b977cc..24bb8d25 100644 --- a/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java +++ b/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java @@ -466,7 +466,7 @@ public class FloatingActionsMenu extends ViewGroup { } @Override - public void setEnabled(boolean enabled) { + public void setEnabled(final boolean enabled) { super.setEnabled(enabled); mAddButton.setEnabled(enabled); diff --git a/app/src/main/java/com/wireguard/android/widget/fab/TouchDelegateGroup.java b/app/src/main/java/com/wireguard/android/widget/fab/TouchDelegateGroup.java index 9aa221ed..c8cf188b 100644 --- a/app/src/main/java/com/wireguard/android/widget/fab/TouchDelegateGroup.java +++ b/app/src/main/java/com/wireguard/android/widget/fab/TouchDelegateGroup.java @@ -13,11 +13,11 @@ import android.view.TouchDelegate; import android.view.View; import java.util.ArrayList; -import java.util.List; +import java.util.Collection; public class TouchDelegateGroup extends TouchDelegate { private static final Rect USELESS_HACKY_RECT = new Rect(); - private final List mTouchDelegates = new ArrayList<>(); + private final Collection mTouchDelegates = new ArrayList<>(); private TouchDelegate mCurrentTouchDelegate; private boolean mEnabled; @@ -49,8 +49,7 @@ public class TouchDelegateGroup extends TouchDelegate { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: - for (int i = 0; i < mTouchDelegates.size(); i++) { - final TouchDelegate touchDelegate = mTouchDelegates.get(i); + for (final TouchDelegate touchDelegate : mTouchDelegates) { if (touchDelegate.onTouchEvent(event)) { mCurrentTouchDelegate = touchDelegate; return true; -- cgit v1.2.3