~singpolyma/cheogram-android

9bc26e7e1159dafbfc513e37751f0bf5a9d499a5 — Stephen Paul Weber 1 year, 7 months ago fa9c578
Thread marker mini-tutorial
1 files changed, 11 insertions(+), 0 deletions(-)

M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java => src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +11 -0
@@ 1268,6 1268,7 @@ public class ConversationFragment extends XmppFragment
            } else {
                newThread();
                conversation.setUserSelectedThread(true);
                newThreadTutorialToast("Switched to new thread");
            }
        });



@@ 1277,12 1278,22 @@ public class ConversationFragment extends XmppFragment
            setThread(null);
            conversation.setUserSelectedThread(true);
            if (wasLocked) refresh();
            newThreadTutorialToast("Cleared thread");
            return true;
        });

        return binding.getRoot();
    }

    protected void newThreadTutorialToast(String s) {
        final SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(activity);
        final int tutorialCount = p.getInt("thread_tutorial", 0);
        if (tutorialCount < 5) {
            Toast.makeText(activity, s, Toast.LENGTH_SHORT).show();
            p.edit().putInt("thread_tutorial", tutorialCount + 1).apply();
        }
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();