Add hint for scroll to top/bottom

multisite
Floens 10 years ago
parent 7250c214ed
commit 56638c8aa9
  1. 8
      Clover/app/src/main/java/org/floens/chan/ui/controller/ViewThreadController.java
  2. 1
      Clover/app/src/main/res/values/strings.xml

@ -56,6 +56,7 @@ public class ViewThreadController extends ThreadController implements ThreadLayo
private static final int OPEN_BROWSER_ID = 107;
private ToolbarMenuItem pinItem;
private ToolbarMenuItem overflowItem;
private Loadable loadable;
public ViewThreadController(Context context) {
@ -88,7 +89,7 @@ public class ViewThreadController extends ThreadController implements ThreadLayo
items.add(new FloatingMenuItem(SHARE_ID, context.getString(R.string.action_share)));
items.add(new FloatingMenuItem(UP_ID, context.getString(R.string.action_up)));
items.add(new FloatingMenuItem(DOWN_ID, context.getString(R.string.action_down)));
navigationItem.createOverflow(context, this, items);
overflowItem = navigationItem.createOverflow(context, this, items);
loadThread(loadable);
}
@ -148,7 +149,10 @@ public class ViewThreadController extends ThreadController implements ThreadLayo
updateLeftPaneHighlighting(loadable);
presenter.requestInitialData();
if (ChanSettings.threadOpenCounter.increase() == 2) {
int counter = ChanSettings.threadOpenCounter.increase();
if (counter == 2) {
HintPopup.show(context, overflowItem.getView(), context.getString(R.string.thread_up_down_hint), -dp(1), 0);
} else if (counter == 3) {
HintPopup.show(context, pinItem.getView(), context.getString(R.string.thread_pin_hint), -dp(1), 0);
}
}

@ -154,6 +154,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="thread_new_posts">%1$d new %2$s</string>
<string name="thread_new_posts_goto">View</string>
<string name="thread_empty_select">Please select a thread</string>
<string name="thread_up_down_hint">Scroll to top/bottom</string>
<string name="thread_pin_hint">Bookmark this thread</string>
<string name="board_edit">Board editor</string>

Loading…
Cancel
Save