summaryrefslogtreecommitdiffhomepage
path: root/app/src/main
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-08-19 18:48:07 -0500
committerSamuel Holland <samuel@sholland.org>2017-08-19 18:48:07 -0500
commitfbd923a0606befd2b116d35dbb3f271d1e7c234a (patch)
tree4b6ed744e58c085aefa0ea21b2ab74aa1e93af8d /app/src/main
parenta49fe9adf54cf9f3463e061e8dac8134e31584c8 (diff)
Minor cleanups
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/wireguard/android/BindingAdapters.java14
-rw-r--r--app/src/main/java/com/wireguard/android/ConfigListFragment.java1
2 files changed, 5 insertions, 10 deletions
diff --git a/app/src/main/java/com/wireguard/android/BindingAdapters.java b/app/src/main/java/com/wireguard/android/BindingAdapters.java
index e3df7bb4..6f375fe2 100644
--- a/app/src/main/java/com/wireguard/android/BindingAdapters.java
+++ b/app/src/main/java/com/wireguard/android/BindingAdapters.java
@@ -31,8 +31,7 @@ public final class BindingAdapters {
adapter = null;
// Add a new binding if there was none, or if it must be replaced due to a layout change.
if (adapter == null) {
- adapter = new ObservableListAdapter<>(view.getContext(), newLayoutId, newList);
- view.setAdapter(adapter);
+ view.setAdapter(new ObservableListAdapter<>(view.getContext(), newLayoutId, newList));
} else if (newList != oldList) {
// Changing the list only requires modifying the existing adapter.
adapter.setList(newList);
@@ -40,11 +39,9 @@ public final class BindingAdapters {
}
@BindingAdapter({"items", "layout"})
- public static <K extends Comparable<K>, V> void sortedMapBinding(final ListView view,
- final ObservableSortedMap<K, V> oldMap,
- final int oldLayoutId,
- final ObservableSortedMap<K, V> newMap,
- final int newLayoutId) {
+ public static <K extends Comparable<K>, V> void sortedMapBinding(
+ final ListView view, final ObservableSortedMap<K, V> oldMap, final int oldLayoutId,
+ final ObservableSortedMap<K, V> newMap, final int newLayoutId) {
// Remove any existing binding when there is no new map.
if (newMap == null) {
view.setAdapter(null);
@@ -58,8 +55,7 @@ public final class BindingAdapters {
adapter = null;
// Add a new binding if there was none, or if it must be replaced due to a layout change.
if (adapter == null) {
- adapter = new ObservableMapAdapter<>(view.getContext(), newLayoutId, newMap);
- view.setAdapter(adapter);
+ view.setAdapter(new ObservableMapAdapter<>(view.getContext(), newLayoutId, newMap));
} else if (newMap != oldMap) {
// Changing the list only requires modifying the existing adapter.
adapter.setMap(newMap);
diff --git a/app/src/main/java/com/wireguard/android/ConfigListFragment.java b/app/src/main/java/com/wireguard/android/ConfigListFragment.java
index ab87571b..bb146755 100644
--- a/app/src/main/java/com/wireguard/android/ConfigListFragment.java
+++ b/app/src/main/java/com/wireguard/android/ConfigListFragment.java
@@ -1,7 +1,6 @@
package com.wireguard.android;
import android.content.res.Resources;
-import android.databinding.ObservableArrayMap;
import android.os.Bundle;
import android.util.Log;
import android.view.ActionMode;