Skip to content

Commit

Permalink
Add tip to long-press verse reference button.
Browse files Browse the repository at this point in the history
Add non-breaking space so long book names do not cause the chapter number to hide
  • Loading branch information
yukuku committed Sep 8, 2016
1 parent c0b2abc commit 7c388f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
25 changes: 17 additions & 8 deletions Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1158,13 +1158,28 @@ private void applyPreferences() {

void bGoto_click() {
App.trackEvent("nav_goto_button_click");
startActivityForResult(GotoActivity.createIntent(this.activeBook.bookId, this.chapter_1, lsSplit0.getVerseBasedOnScroll()), REQCODE_goto);

final Runnable r = () -> startActivityForResult(GotoActivity.createIntent(this.activeBook.bookId, this.chapter_1, lsSplit0.getVerseBasedOnScroll()), REQCODE_goto);

if (!Preferences.getBoolean(Prefkey.history_button_understood, false) && history.getSize() > 0) {
new MaterialDialog.Builder(this)
.content(R.string.goto_button_history_tip)
.positiveText(R.string.ok)
.onPositive((dialog, which) -> {
Preferences.setBoolean(Prefkey.history_button_understood, true);
r.run();
})
.show();
} else {
r.run();
}
}

void bGoto_longClick() {
App.trackEvent("nav_goto_button_long_click");
if (history.getSize() > 0) {
MaterialDialogAdapterHelper.show(new MaterialDialog.Builder(this), new HistoryAdapter());
Preferences.setBoolean(Prefkey.history_button_understood, true);
} else {
Snackbar.make(root, R.string.recentverses_not_available, Snackbar.LENGTH_SHORT).show();
}
Expand Down Expand Up @@ -1226,7 +1241,6 @@ public void onBindViewHolder(final RecyclerView.ViewHolder _holder_, final int p
final int ari = history.getAri(which);
jumpToAri(ari);
history.add(ari);
Preferences.setBoolean(Prefkey.history_button_understood, true);
});
}

Expand Down Expand Up @@ -1633,12 +1647,7 @@ int display(int chapter_1, int verse_1, boolean uncheckAllVerses) {

// set goto button text
final String reference = this.activeBook.reference(chapter_1);
if (Preferences.getBoolean(Prefkey.history_button_understood, false) || history.getSize() == 0) {
bGoto.setText(reference);
} else {
// TODO show something to indicate user can long press on goto button
bGoto.setText(reference);
}
bGoto.setText(reference.replace(' ', '\u00a0'));

if (fullScreen) {
if (fullScreenToast == null) {
Expand Down
3 changes: 2 additions & 1 deletion Alkitab/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@
<string name="market_short_desc">Fast, reliable and feature-rich offline Bible.</string>
<string name="no_url_for_facebook">This cannot be shared to Facebook.</string>
<string name="storage_permission_rationale">We need to access the storage to store shared media such as Bible versions and fonts.</string>
<string name="goto_button_history_tip">Tip: Next time, long-press this button to access your recently-opened verses.</string>

<!-- Goto tabs -->
<!-- Goto tabs -->
<string name="goto_tab_dialer_label">Dialer</string>
<string name="goto_tab_direct_label">Direct</string>
<string name="goto_tab_grid_label">Grid</string>
Expand Down

0 comments on commit 7c388f6

Please sign in to comment.