diff options
author | Samuel Holland <samuel@sholland.org> | 2018-01-06 23:07:17 -0600 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-01-06 23:07:17 -0600 |
commit | 4f2b6bef84f75bc17101a17c60251fc0df43aae1 (patch) | |
tree | c51c8fdfec422779d921f0455f029d55b52b34db /app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java | |
parent | project: Minor cleanups (diff) | |
download | wireguard-android-4f2b6bef84f75bc17101a17c60251fc0df43aae1.tar.xz wireguard-android-4f2b6bef84f75bc17101a17c60251fc0df43aae1.zip |
Keyed...: Rename all the things
Hooray for diamond interface inheritance.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java b/app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java index f4dd2aff..34ddb010 100644 --- a/app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java +++ b/app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java @@ -11,7 +11,7 @@ import android.widget.TextView; import com.wireguard.android.R; import com.wireguard.android.util.Keyed; -import com.wireguard.android.util.KeyedObservableList; +import com.wireguard.android.util.ObservableKeyedList; import com.wireguard.android.widget.ToggleSwitch; import com.wireguard.android.widget.ToggleSwitch.OnBeforeCheckedChangeListener; @@ -68,13 +68,13 @@ public final class BindingAdapters { @BindingAdapter({"items", "layout"}) public static <K, E extends Keyed<? extends K>> void setItems(final ListView view, - final KeyedObservableList<K, E> oldList, final int oldLayoutId, - final KeyedObservableList<K, E> newList, final int newLayoutId) { + final ObservableKeyedList<K, E> oldList, final int oldLayoutId, + final ObservableKeyedList<K, E> newList, final int newLayoutId) { if (oldList == newList && oldLayoutId == newLayoutId) return; // The ListAdapter interface is not generic, so this cannot be checked. - @SuppressWarnings("unchecked") KeyedObservableListAdapter<K, E> adapter = - (KeyedObservableListAdapter<K, E>) view.getAdapter(); + @SuppressWarnings("unchecked") ObservableKeyedListAdapter<K, E> adapter = + (ObservableKeyedListAdapter<K, E>) view.getAdapter(); // If the layout changes, any existing adapter must be replaced. if (adapter != null && oldList != null && oldLayoutId != newLayoutId) { adapter.setList(null); @@ -84,7 +84,7 @@ public final class BindingAdapters { if (newList == null || newLayoutId == 0) return; if (adapter == null) { - adapter = new KeyedObservableListAdapter<>(view.getContext(), newLayoutId, newList); + adapter = new ObservableKeyedListAdapter<>(view.getContext(), newLayoutId, newList); view.setAdapter(adapter); } // Either the list changed, or this is an entirely new listener because the layout changed. |