diff options
author | Samuel Holland <samuel@sholland.org> | 2018-06-19 00:47:48 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2018-06-19 21:59:44 -0500 |
commit | 4acee49d4b0da6273cd9ffef1573185f955b5774 (patch) | |
tree | 3f322d5255209c3d14d50eec30f17e60c3e46101 | |
parent | d3a8291a7a0706337531e368e0ad9f584534aa7d (diff) |
util: Extract non-Android utility interfaces
As part of a refactoring that will likely introduce more custom
collection classes, move the non-Android-specific parts outside the
com.wireguard.android package.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
10 files changed, 17 insertions, 9 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 bd8d6efd..ba6845ba 100644 --- a/app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java +++ b/app/src/main/java/com/wireguard/android/databinding/BindingAdapters.java @@ -15,7 +15,7 @@ import android.widget.ListView; import android.widget.TextView; import com.wireguard.android.R; -import com.wireguard.android.util.Keyed; +import com.wireguard.util.Keyed; import com.wireguard.android.util.ObservableKeyedList; import com.wireguard.android.widget.ToggleSwitch; import com.wireguard.android.widget.ToggleSwitch.OnBeforeCheckedChangeListener; diff --git a/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedListAdapter.java b/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedListAdapter.java index 90c85582..452d2ec4 100644 --- a/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedListAdapter.java +++ b/app/src/main/java/com/wireguard/android/databinding/ObservableKeyedListAdapter.java @@ -16,7 +16,7 @@ import android.view.ViewGroup; import android.widget.BaseAdapter; import com.wireguard.android.BR; -import com.wireguard.android.util.Keyed; +import com.wireguard.util.Keyed; import com.wireguard.android.util.ObservableKeyedList; import java.lang.ref.WeakReference; diff --git a/app/src/main/java/com/wireguard/android/model/Tunnel.java b/app/src/main/java/com/wireguard/android/model/Tunnel.java index bdfa0dbc..0b1ba895 100644 --- a/app/src/main/java/com/wireguard/android/model/Tunnel.java +++ b/app/src/main/java/com/wireguard/android/model/Tunnel.java @@ -13,7 +13,7 @@ import android.support.annotation.Nullable; import com.wireguard.android.BR; import com.wireguard.android.util.ExceptionLoggers; -import com.wireguard.android.util.Keyed; +import com.wireguard.util.Keyed; import com.wireguard.config.Config; import java.util.regex.Pattern; diff --git a/app/src/main/java/com/wireguard/android/util/ObservableKeyedArrayList.java b/app/src/main/java/com/wireguard/android/util/ObservableKeyedArrayList.java index 70842052..10558319 100644 --- a/app/src/main/java/com/wireguard/android/util/ObservableKeyedArrayList.java +++ b/app/src/main/java/com/wireguard/android/util/ObservableKeyedArrayList.java @@ -9,6 +9,8 @@ package com.wireguard.android.util; import android.databinding.ObservableArrayList; import android.support.annotation.NonNull; +import com.wireguard.util.Keyed; + import java.util.Collection; import java.util.ListIterator; import java.util.Objects; diff --git a/app/src/main/java/com/wireguard/android/util/ObservableKeyedList.java b/app/src/main/java/com/wireguard/android/util/ObservableKeyedList.java index d810b703..169afe42 100644 --- a/app/src/main/java/com/wireguard/android/util/ObservableKeyedList.java +++ b/app/src/main/java/com/wireguard/android/util/ObservableKeyedList.java @@ -8,6 +8,9 @@ package com.wireguard.android.util; import android.databinding.ObservableList; +import com.wireguard.util.Keyed; +import com.wireguard.util.KeyedList; + /** * A list that is both keyed and observable. */ diff --git a/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java b/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java index 0612deb5..58ec4383 100644 --- a/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java +++ b/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedArrayList.java @@ -8,6 +8,9 @@ package com.wireguard.android.util; import android.support.annotation.NonNull; +import com.wireguard.util.Keyed; +import com.wireguard.util.SortedKeyedList; + import java.util.AbstractList; import java.util.Collection; import java.util.Collections; diff --git a/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedList.java b/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedList.java index 5a821689..8ebc5985 100644 --- a/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedList.java +++ b/app/src/main/java/com/wireguard/android/util/ObservableSortedKeyedList.java @@ -6,6 +6,9 @@ package com.wireguard.android.util; +import com.wireguard.util.Keyed; +import com.wireguard.util.SortedKeyedList; + /** * A list that is both sorted/keyed and observable. */ diff --git a/app/src/main/java/com/wireguard/android/util/Keyed.java b/app/src/main/java/com/wireguard/util/Keyed.java index ca8c142a..f0b32b6d 100644 --- a/app/src/main/java/com/wireguard/android/util/Keyed.java +++ b/app/src/main/java/com/wireguard/util/Keyed.java @@ -1,10 +1,9 @@ /* * Copyright © 2018 Samuel Holland <samuel@sholland.org> - * Copyright © 2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. * SPDX-License-Identifier: GPL-2.0-or-later */ -package com.wireguard.android.util; +package com.wireguard.util; /** * Interface for objects that have a identifying key of the given type. diff --git a/app/src/main/java/com/wireguard/android/util/KeyedList.java b/app/src/main/java/com/wireguard/util/KeyedList.java index 9518758e..1478dc19 100644 --- a/app/src/main/java/com/wireguard/android/util/KeyedList.java +++ b/app/src/main/java/com/wireguard/util/KeyedList.java @@ -1,10 +1,9 @@ /* * Copyright © 2018 Samuel Holland <samuel@sholland.org> - * Copyright © 2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. * SPDX-License-Identifier: GPL-2.0-or-later */ -package com.wireguard.android.util; +package com.wireguard.util; import java.util.Collection; import java.util.List; diff --git a/app/src/main/java/com/wireguard/android/util/SortedKeyedList.java b/app/src/main/java/com/wireguard/util/SortedKeyedList.java index cca6d017..85aeecff 100644 --- a/app/src/main/java/com/wireguard/android/util/SortedKeyedList.java +++ b/app/src/main/java/com/wireguard/util/SortedKeyedList.java @@ -1,10 +1,9 @@ /* * Copyright © 2018 Samuel Holland <samuel@sholland.org> - * Copyright © 2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. * SPDX-License-Identifier: GPL-2.0-or-later */ -package com.wireguard.android.util; +package com.wireguard.util; import java.util.Collection; import java.util.Comparator; |