diff options
author | 2018-09-05 18:33:42 -0500 | |
---|---|---|
committer | 2018-11-11 21:50:23 -0600 | |
commit | 1d44e27caee1064096e2505b93b1e3164a5039c5 (patch) | |
tree | 8adb020e43111ff0420569c16c8c529f69b6a0e5 /app/src/main/java/com/wireguard/android/databinding | |
parent | tools: wg-quick: bump (diff) | |
download | wireguard-android-1d44e27caee1064096e2505b93b1e3164a5039c5.tar.xz wireguard-android-1d44e27caee1064096e2505b93b1e3164a5039c5.zip |
Auto-format the source directories
Blame Jason for writing Java in vim.
Diffstat (limited to 'app/src/main/java/com/wireguard/android/databinding')
-rw-r--r-- | app/src/main/java/com/wireguard/android/databinding/ObservableKeyedRecyclerViewAdapter.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedRecyclerViewAdapter.java b/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedRecyclerViewAdapter.java index 0420dee0..26e7687f 100644 --- a/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedRecyclerViewAdapter.java +++ b/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedRecyclerViewAdapter.java @@ -40,11 +40,6 @@ public class ObservableKeyedRecyclerViewAdapter<K, E extends Keyed<? extends K>> setList(list); } - @Override - public int getItemCount() { - return list != null ? list.size() : 0; - } - @Nullable private E getItem(final int position) { if (list == null || position < 0 || position >= list.size()) @@ -53,6 +48,11 @@ public class ObservableKeyedRecyclerViewAdapter<K, E extends Keyed<? extends K>> } @Override + public int getItemCount() { + return list != null ? list.size() : 0; + } + + @Override public long getItemId(final int position) { final K key = getKey(position); return key != null ? key.hashCode() : -1; @@ -64,11 +64,6 @@ public class ObservableKeyedRecyclerViewAdapter<K, E extends Keyed<? extends K>> return item != null ? item.getKey() : null; } - @Override - public ViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType) { - return new ViewHolder(DataBindingUtil.inflate(layoutInflater, layoutId, parent, false)); - } - @SuppressWarnings("unchecked") @Override public void onBindViewHolder(final ViewHolder holder, final int position) { @@ -85,6 +80,11 @@ public class ObservableKeyedRecyclerViewAdapter<K, E extends Keyed<? extends K>> } } + @Override + public ViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType) { + return new ViewHolder(DataBindingUtil.inflate(layoutInflater, layoutId, parent, false)); + } + void setList(@Nullable final ObservableKeyedList<K, E> newList) { if (list != null) list.removeOnListChangedCallback(callback); @@ -99,6 +99,10 @@ public class ObservableKeyedRecyclerViewAdapter<K, E extends Keyed<? extends K>> this.rowConfigurationHandler = rowConfigurationHandler; } + public interface RowConfigurationHandler<B extends ViewDataBinding, T> { + void onConfigureRow(B binding, T item, int position); + } + private static final class OnListChangedCallback<E extends Keyed<?>> extends ObservableList.OnListChangedCallback<ObservableList<E>> { @@ -152,8 +156,4 @@ public class ObservableKeyedRecyclerViewAdapter<K, E extends Keyed<? extends K>> } } - public interface RowConfigurationHandler<B extends ViewDataBinding, T> { - void onConfigureRow(B binding, T item, int position); - } - } |