mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
[android] Use @UiThread instead of @MainThread
This commit is contained in:
@@ -14,9 +14,9 @@ import android.os.PowerManager;
|
|||||||
import android.support.annotation.AttrRes;
|
import android.support.annotation.AttrRes;
|
||||||
import android.support.annotation.ColorInt;
|
import android.support.annotation.ColorInt;
|
||||||
import android.support.annotation.ColorRes;
|
import android.support.annotation.ColorRes;
|
||||||
import android.support.annotation.MainThread;
|
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.annotation.RequiresApi;
|
import android.support.annotation.RequiresApi;
|
||||||
|
import android.support.annotation.UiThread;
|
||||||
import android.support.design.widget.TextInputLayout;
|
import android.support.design.widget.TextInputLayout;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
@@ -342,7 +342,7 @@ public class UiUtils {
|
|||||||
* If the LiveData's value is available, the {@link Observer} will be
|
* If the LiveData's value is available, the {@link Observer} will be
|
||||||
* called right away.
|
* called right away.
|
||||||
*/
|
*/
|
||||||
@MainThread
|
@UiThread
|
||||||
public static <T> void observeOnce(LiveData<T> liveData,
|
public static <T> void observeOnce(LiveData<T> liveData,
|
||||||
LifecycleOwner owner, Observer<T> observer) {
|
LifecycleOwner owner, Observer<T> observer) {
|
||||||
liveData.observe(owner, new Observer<T>() {
|
liveData.observe(owner, new Observer<T>() {
|
||||||
@@ -360,7 +360,7 @@ public class UiUtils {
|
|||||||
*
|
*
|
||||||
* Warning: Do NOT call from objects that have a lifecycle.
|
* Warning: Do NOT call from objects that have a lifecycle.
|
||||||
*/
|
*/
|
||||||
@MainThread
|
@UiThread
|
||||||
public static <T> void observeForeverOnce(LiveData<T> liveData,
|
public static <T> void observeForeverOnce(LiveData<T> liveData,
|
||||||
Observer<T> observer) {
|
Observer<T> observer) {
|
||||||
liveData.observeForever(new Observer<T>() {
|
liveData.observeForever(new Observer<T>() {
|
||||||
|
|||||||
Reference in New Issue
Block a user