@@ 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();