~singpolyma/cheogram-android

f5aeab7dd281e4808631ebfd38407622f31659b8 — Stephen Paul Weber 1 year, 16 days ago fabdfd4
If timer is already cancelled, then we don't need to schedule
1 files changed, 19 insertions(+), 17 deletions(-)

M src/main/java/eu/siacs/conversations/entities/Conversation.java
M src/main/java/eu/siacs/conversations/entities/Conversation.java => src/main/java/eu/siacs/conversations/entities/Conversation.java +19 -17
@@ 3068,25 3068,27 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl

            protected void loading() {
                View v = getView();
                loadingTimer.schedule(new TimerTask() {
                    @Override
                    public void run() {
                        View v2 = getView();
                        loading = true;
                try {
                    loadingTimer.schedule(new TimerTask() {
                        @Override
                        public void run() {
                            View v2 = getView();
                            loading = true;

                        loadingTimer.schedule(new TimerTask() {
                            @Override
                            public void run() {
                                loadingHasBeenLong = true;
                                if (v == null && v2 == null) return;
                                (v == null ? v2 : v).post(() -> notifyDataSetChanged());
                            }
                        }, 3000);
                            loadingTimer.schedule(new TimerTask() {
                                @Override
                                public void run() {
                                    loadingHasBeenLong = true;
                                    if (v == null && v2 == null) return;
                                    (v == null ? v2 : v).post(() -> notifyDataSetChanged());
                                }
                            }, 3000);

                        if (v == null && v2 == null) return;
                        (v == null ? v2 : v).post(() -> notifyDataSetChanged());
                    }
                }, 500);
                            if (v == null && v2 == null) return;
                            (v == null ? v2 : v).post(() -> notifyDataSetChanged());
                        }
                    }, 500);
                } catch (final IllegalStateException e) { }
            }

            protected GridLayoutManager setupLayoutManager() {