diff --git a/Alkitab/build.gradle b/Alkitab/build.gradle
index e32815493..e5f78e367 100644
--- a/Alkitab/build.gradle
+++ b/Alkitab/build.gradle
@@ -17,8 +17,8 @@ android {
applicationId 'yuku.alkitab.debug'
minSdkVersion 14
targetSdkVersion 22
- versionCode 14000241
- versionName '4.3-beta1'
+ versionCode 14000242
+ versionName '4.3-beta2'
}
buildTypes {
release {
@@ -67,17 +67,17 @@ dependencies {
compile project(':AmbilWarna')
compile project(':FileChooser')
compile project(':ImportedDesktopVerseUtil')
- compile 'com.android.support:support-v4:22.2.0'
+ compile 'com.android.support:support-v4:22.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.5.0-SNAPSHOT'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0-SNAPSHOT'
compile 'net.sf.trove4j:trove4j:3.0.3'
compile 'com.google.code.gson:gson:2.3.1'
- compile 'com.google.android.gms:play-services-analytics:7.5.0'
- compile 'com.google.android.gms:play-services-gcm:7.5.0'
- compile 'com.android.support:appcompat-v7:22.2.0'
+ compile 'com.google.android.gms:play-services-analytics:7.8.0'
+ compile 'com.google.android.gms:play-services-gcm:7.8.0'
+ compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.afollestad:material-dialogs:0.7.6.0'
- compile 'com.android.support:design:22.2.0'
+ compile 'com.android.support:design:22.2.1'
testCompile 'junit:junit:4.12'
}
diff --git a/Alkitab/src/main/assets/help/credits.html b/Alkitab/src/main/assets/help/credits.html
index 4c3b8f9c0..0cca808f6 100644
--- a/Alkitab/src/main/assets/help/credits.html
+++ b/Alkitab/src/main/assets/help/credits.html
@@ -40,7 +40,7 @@
Interface Translators
Indonesian & English: Bible Team
- Malay: Wan Mohammad
+ Malay: Wan Mohammad, Shafiq Jamzuri
Chinese: Jandi Lau, Scribe
Dutch: Jaap Kievit
German: Michael Leimer
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.java b/Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.java
index 8a5a70015..eb079d331 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/IsiActivity.java
@@ -79,10 +79,8 @@
import yuku.alkitab.base.model.MVersion;
import yuku.alkitab.base.model.MVersionDb;
import yuku.alkitab.base.model.MVersionInternal;
-import yuku.alkitab.base.model.SyncShadow;
import yuku.alkitab.base.model.VersionImpl;
import yuku.alkitab.base.storage.Prefkey;
-import yuku.alkitab.base.sync.Sync;
import yuku.alkitab.base.util.Announce;
import yuku.alkitab.base.util.Appearances;
import yuku.alkitab.base.util.CurrentReading;
@@ -137,6 +135,7 @@ public class IsiActivity extends BaseLeftDrawerActivity implements XrefDialog.Xr
public static final String ACTION_ATTRIBUTE_MAP_CHANGED = "yuku.alkitab.action.ATTRIBUTE_MAP_CHANGED";
public static final String ACTION_ACTIVE_VERSION_CHANGED = IsiActivity.class.getName() + ".action.ACTIVE_VERSION_CHANGED";
public static final String ACTION_NIGHT_MODE_CHANGED = IsiActivity.class.getName() + ".action.NIGHT_MODE_CHANGED";
+ public static final String ACTION_NEEDS_RESTART = IsiActivity.class.getName() + ".action.NEEDS_RESTART";
private static final int REQCODE_goto = 1;
private static final int REQCODE_share = 7;
@@ -148,6 +147,8 @@ public class IsiActivity extends BaseLeftDrawerActivity implements XrefDialog.Xr
private static final String EXTRA_verseUrl = "verseUrl";
private boolean uncheckVersesWhenActionModeDestroyed = true;
+ private boolean needsRestart; // whether this activity needs to be restarted
+
private GotoButton.FloaterDragListener bGoto_floaterDrag = new GotoButton.FloaterDragListener() {
final int[] floaterLocationOnScreen = {0, 0};
@@ -269,6 +270,7 @@ public void onTwofingerEnd(final TwofingerLinearLayout.Mode mode) {
FrameLayout overlayContainer;
View root;
+ Toolbar toolbar;
VersesView lsSplit0;
VersesView lsSplit1;
TextView tSplitEmpty;
@@ -399,7 +401,7 @@ public void onReceive(final Context context, final Intent intent) {
leftDrawer = V.get(this, R.id.left_drawer);
leftDrawer.configure(this, drawerLayout);
- final Toolbar toolbar = V.get(this, R.id.toolbar);
+ toolbar = V.get(this, R.id.toolbar);
setSupportActionBar(toolbar);
setTitle("");
@@ -420,6 +422,8 @@ public void onReceive(final Context context, final Intent intent) {
splitHandleButton = V.get(this, R.id.splitHandleButton);
floater = V.get(this, R.id.floater);
+ updateToolbarLocation();
+
lsSplit0.setName("lsSplit0");
lsSplit1.setName("lsSplit1");
@@ -564,8 +568,17 @@ && thereIsYukuAlkitabBackupFiles()) {
}
Announce.checkAnnouncements();
+
+ App.getLbm().registerReceiver(needsRestartReceiver, new IntentFilter(ACTION_NEEDS_RESTART));
}
+ final BroadcastReceiver needsRestartReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(final Context context, final Intent intent) {
+ needsRestart = true;
+ }
+ };
+
private boolean thereIsYukuAlkitabBackupFiles() {
final File dir = new File(Environment.getExternalStorageDirectory(), "bible");
if (!dir.exists()) return false;
@@ -606,6 +619,8 @@ protected void onDestroy() {
super.onDestroy();
App.getLbm().unregisterReceiver(reloadAttributeMapReceiver);
+
+ App.getLbm().unregisterReceiver(needsRestartReceiver);
}
/**
@@ -968,7 +983,7 @@ private CharSequence referenceFromSelectedVerses(IntArrayList selectedVerses, Bo
/**
* Construct text for copying or sharing (in plain text).
* @param isSplitVersion whether take the verse text from the main or from the split version.
- * @return [0] text for copy/share, [1] text for share url
+ * @return [0] text for copy/share, [1] text to be submitted to the share url service
*/
String[] prepareTextForCopyShare(IntArrayList selectedVerses_1, CharSequence reference, boolean isSplitVersion) {
final StringBuilder res0 = new StringBuilder();
@@ -999,7 +1014,7 @@ String[] prepareTextForCopyShare(IntArrayList selectedVerses_1, CharSequence ref
final String verseTextPlain = U.removeSpecialCodes(verseText);
res0.append(verseTextPlain);
- res1.append(verseTextPlain);
+ res1.append(verseText);
if (i != len - 1) {
res0.append('\n');
@@ -1020,7 +1035,7 @@ String[] prepareTextForCopyShare(IntArrayList selectedVerses_1, CharSequence ref
final String verseTextPlain = U.removeSpecialCodes(verseText);
res0.append(verseTextPlain);
- res1.append(verseTextPlain);
+ res1.append(verseText);
}
}
@@ -1087,6 +1102,14 @@ private void applyPreferences() {
applyPreferences();
getWindow().getDecorView().setKeepScreenOn(Preferences.getBoolean(getString(R.string.pref_keepScreenOn_key), getResources().getBoolean(R.bool.pref_keepScreenOn_default)));
+
+ if (needsRestart) {
+ needsRestart = false;
+
+ final Intent originalIntent = getIntent();
+ finish();
+ startActivity(originalIntent);
+ }
}
@Override public void onBackPressed() {
@@ -1224,34 +1247,57 @@ void setFullScreen(boolean yes) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().hide();
- final ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) root.getLayoutParams();
- lp.topMargin = 0;
- root.setLayoutParams(lp);
-
if (Build.VERSION.SDK_INT >= 19) {
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_IMMERSIVE
);
}
-
- fullScreen = true;
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getSupportActionBar().show();
- final ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) root.getLayoutParams();
+ if (Build.VERSION.SDK_INT >= 19) {
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+ }
+ }
+
+ fullScreen = yes;
+
+ updateToolbarLocation();
+ }
+
+ void updateToolbarLocation() {
+ // 3 kinds of possible layout:
+ // - fullscreen
+ // - not fullscreen, toolbar at bottom
+ // - not fullscreen, toolbar at top
+
+ final FrameLayout.LayoutParams lp_root = (FrameLayout.LayoutParams) root.getLayoutParams();
+
+ if (fullScreen) {
+ lp_root.topMargin = 0;
+ lp_root.bottomMargin = 0;
+ } else {
final TypedValue tv = new TypedValue();
getTheme().resolveAttribute(R.attr.actionBarSize, tv, true);
- lp.topMargin = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics());
- root.setLayoutParams(lp);
+ final int actionBarSize = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics());
+ final FrameLayout.LayoutParams lp_toolbar = (FrameLayout.LayoutParams) toolbar.getLayoutParams();
- if (Build.VERSION.SDK_INT >= 19) {
- decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+ if (Preferences.getBoolean(R.string.pref_bottomToolbarOnText_key, R.bool.pref_bottomToolbarOnText_default)) {
+ lp_toolbar.gravity = Gravity.BOTTOM;
+ lp_root.topMargin = 0;
+ lp_root.bottomMargin = actionBarSize;
+ } else {
+ lp_toolbar.gravity = Gravity.NO_GRAVITY;
+ lp_root.topMargin = actionBarSize;
+ lp_root.bottomMargin = 0;
}
- fullScreen = false;
+ toolbar.setLayoutParams(lp_toolbar);
}
+
+ root.setLayoutParams(lp_root);
}
@Override
@@ -1593,7 +1639,7 @@ static boolean loadChapterToVersesView(VersesView versesView, Version version, B
int nblock = version.loadPericope(book.bookId, chapter_1, pericope_aris, pericope_blocks, max);
boolean retainSelectedVerses = (!uncheckAllVerses && chapter_1 == current_chapter_1);
- versesView.setDataWithRetainSelectedVerses(retainSelectedVerses, book, chapter_1, pericope_aris, pericope_blocks, nblock, verses);
+ versesView.setDataWithRetainSelectedVerses(retainSelectedVerses, Ari.encode(book.bookId, chapter_1, 0), pericope_aris, pericope_blocks, nblock, verses);
return true;
}
@@ -1702,9 +1748,7 @@ void openBookmarkDialog(final long _id) {
}
@Override
- public void onBookmarkAttributeClick(final Book book, final int chapter_1, final int verse_1) {
- final int ari = Ari.encode(book.bookId, chapter_1, verse_1);
-
+ public void onBookmarkAttributeClick(final int ari) {
final List markers = S.getDb().listMarkersForAriKind(ari, Marker.Kind.bookmark);
if (markers.size() == 1) {
openBookmarkDialog(markers.get(0)._id);
@@ -1727,10 +1771,9 @@ void openNoteDialog(final long _id) {
startActivityForResult(NoteActivity.createEditExistingIntent(_id), REQCODE_edit_note_1);
}
- @Override
- public void onNoteAttributeClick(final Book book, final int chapter_1, final int verse_1) {
- final int ari = Ari.encode(book.bookId, chapter_1, verse_1);
+ @Override
+ public void onNoteAttributeClick(final int ari) {
final List markers = S.getDb().listMarkersForAriKind(ari, Marker.Kind.note);
if (markers.size() == 1) {
openNoteDialog(markers.get(0)._id);
@@ -1843,6 +1886,20 @@ public void onDeleted() {
}
});
}
+
+ @Override
+ public void onHasMapsAttributeClick(final int ari) {
+ try {
+ startActivity(new Intent("palki.maps.action.SHOW_MAPS_DIALOG")
+ .putExtra("ari", ari)
+ );
+ } catch (ActivityNotFoundException e) {
+ new MaterialDialog.Builder(IsiActivity.this)
+ .content(R.string.maps_could_not_open)
+ .positiveText(R.string.ok)
+ .show();
+ }
+ }
};
class VerseInlineLinkSpanFactory implements VerseInlineLinkSpan.Factory {
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/ac/HelpActivity.java b/Alkitab/src/main/java/yuku/alkitab/base/ac/HelpActivity.java
index dc523e0c7..ee5ba5371 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/ac/HelpActivity.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/ac/HelpActivity.java
@@ -3,6 +3,7 @@
import android.annotation.SuppressLint;
import android.content.Intent;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebSettings;
@@ -15,6 +16,7 @@
import yuku.alkitab.base.dialog.VersesDialog;
import yuku.alkitab.base.util.Announce;
import yuku.alkitab.base.util.TargetDecoder;
+import yuku.alkitab.debug.BuildConfig;
import yuku.alkitab.debug.R;
import yuku.alkitab.util.IntArrayList;
import yuku.alkitabintegration.display.Launcher;
@@ -27,7 +29,6 @@ public class HelpActivity extends BaseActivity {
private static final String EXTRA_announcementIds = "announcementIds";
WebView webview;
- long[] announcementIds;
public static Intent createIntent(final String page) {
return createIntent(page, null);
@@ -52,6 +53,12 @@ protected void onCreate(Bundle savedInstanceState) {
webview = V.get(this, R.id.webView);
+ if (BuildConfig.DEBUG) {
+ if (Build.VERSION.SDK_INT >= 19) {
+ WebView.setWebContentsDebuggingEnabled(true);
+ }
+ }
+
final WebSettings webSettings = webview.getSettings();
//noinspection deprecation
webSettings.setSavePassword(false);
@@ -60,6 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
final String page = getIntent().getStringExtra(EXTRA_page);
final String overrideTitle = getIntent().getStringExtra(EXTRA_overrideTitle);
+ final long[] announcementIds = getIntent().getLongArrayExtra(EXTRA_announcementIds);
if (overrideTitle != null) {
setTitle(overrideTitle);
@@ -73,7 +81,11 @@ protected void onCreate(Bundle savedInstanceState) {
}
} else if (announcementIds != null) {
final Locale locale = getResources().getConfiguration().locale;
- webview.loadUrl("https://alkitab-host.appspot.com/announce/view?ids=" + App.getDefaultGson().toJson(announcementIds) + (locale == null ? "" : ("&locale=" + locale.toString())));
+ final String url = "https://alkitab-host.appspot.com/announce/view?ids=" + App.getDefaultGson().toJson(announcementIds) + (locale == null ? "" : ("&locale=" + locale.toString()));
+ if (BuildConfig.DEBUG) {
+ Log.d(TAG, "loading announce view url: " + url);
+ }
+ webview.loadUrl(url);
}
webview.setWebViewClient(new WebViewClient() {
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/ac/ReadingPlanActivity.java b/Alkitab/src/main/java/yuku/alkitab/base/ac/ReadingPlanActivity.java
index 9809f2655..757a44730 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/ac/ReadingPlanActivity.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/ac/ReadingPlanActivity.java
@@ -189,9 +189,8 @@ private void showCalendar() {
private void showSetStartDateDialog() {
final Calendar today = GregorianCalendar.getInstance();
today.setTimeInMillis(readingPlan.info.startTime);
- today.add(Calendar.DATE, dayNumber);
- DatePickerDialog.OnDateSetListener dateSetListener = (view, year, monthOfYear, dayOfMonth) -> {
+ final DatePickerDialog.OnDateSetListener dateSetListener = (view, year, monthOfYear, dayOfMonth) -> {
final Calendar newDate = new GregorianCalendar(year, monthOfYear, dayOfMonth, 2, 0, 0); // plus 2 hours to prevent DST-related problems
if (readingPlan == null) {
return;
@@ -200,8 +199,9 @@ private void showSetStartDateDialog() {
final long startTime = newDate.getTimeInMillis();
readingPlan.info.startTime = startTime;
S.getDb().updateReadingPlanStartDate(readingPlan.info.id, startTime);
- dayNumber = 0; // show the first one
changeDay(0);
+ loadDayNumber();
+ updateButtonStatus();
};
new DatePickerDialog(ReadingPlanActivity.this, dateSetListener, today.get(Calendar.YEAR), today.get(Calendar.MONTH), today.get(Calendar.DAY_OF_MONTH)).show();
@@ -390,14 +390,14 @@ private void loadDayNumber() {
Calendar startCalendar = GregorianCalendar.getInstance();
startCalendar.setTimeInMillis(readingPlan.info.startTime);
- todayNumber = calculateDaysDiff(startCalendar, GregorianCalendar.getInstance());
- if (todayNumber >= readingPlan.info.duration) {
- todayNumber = readingPlan.info.duration - 1;
- } else if (todayNumber < 0) {
- todayNumber = 0;
+ int tn = calculateDaysDiff(startCalendar, GregorianCalendar.getInstance());
+ if (tn >= readingPlan.info.duration) {
+ tn = readingPlan.info.duration - 1;
+ } else if (tn < 0) {
+ tn = 0;
}
- dayNumber = todayNumber;
+ dayNumber = todayNumber = tn;
}
private int calculateDaysDiff(Calendar startCalendar, Calendar endCalendar) {
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/ac/SettingsActivity.java b/Alkitab/src/main/java/yuku/alkitab/base/ac/SettingsActivity.java
index ff9db3e18..2052b8388 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/ac/SettingsActivity.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/ac/SettingsActivity.java
@@ -13,6 +13,7 @@
import com.afollestad.materialdialogs.AlertDialogWrapper;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.App;
+import yuku.alkitab.base.IsiActivity;
import yuku.alkitab.base.ac.base.BasePreferenceActivity;
import yuku.alkitab.base.config.AppConfig;
import yuku.alkitab.base.sync.SyncSettingsActivity;
@@ -93,6 +94,16 @@ public void onCreate(final Bundle savedInstanceState) {
});
autoDisplayListPreference(pref_language);
+
+ final CheckBoxPreference pref_bottomToolbarOnText = (CheckBoxPreference) findPreference(getString(R.string.pref_bottomToolbarOnText_key));
+ pref_bottomToolbarOnText.setOnPreferenceChangeListener((preference, newValue) -> {
+ final Handler handler = new Handler();
+
+ // do this after this method returns true
+ handler.post(() -> App.getLbm().sendBroadcast(new Intent(IsiActivity.ACTION_NEEDS_RESTART)));
+ return true;
+ });
+
final Preference pref_selectedVerseBgColor = findPreference(getString(R.string.pref_selectedVerseBgColor_key));
pref_selectedVerseBgColor.setOnPreferenceChangeListener((preference, newValue) -> {
VerseItem.invalidateSelectedVersePaints();
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/dialog/VersesDialog.java b/Alkitab/src/main/java/yuku/alkitab/base/dialog/VersesDialog.java
index a2e4a3ca8..a8054345c 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/dialog/VersesDialog.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/dialog/VersesDialog.java
@@ -16,7 +16,6 @@
import yuku.alkitab.base.widget.VersesView;
import yuku.alkitab.base.widget.VersesView.VerseSelectionMode;
import yuku.alkitab.debug.R;
-import yuku.alkitab.model.Book;
import yuku.alkitab.model.SingleChapterVerses;
import yuku.alkitab.model.Version;
import yuku.alkitab.util.Ari;
@@ -170,10 +169,8 @@ public String getVerseNumberText(int verse_0) {
}
final int firstAri = ariRanges.get(0);
- final Book book = sourceVersion.getBook(Ari.toBook(firstAri));
- final int chapter_1 = Ari.toChapter(firstAri);
- versesView.setData(book, chapter_1, new Verses(), null, null, 0);
+ versesView.setData(Ari.toBookChapter(firstAri), new Verses(), null, null, 0);
}
} else {
// read each version and display it. First version must be the sourceVersion.
@@ -254,10 +251,7 @@ public String getVerseNumberText(int verse_0) {
}
}
- final Book book = sourceVersion.getBook(Ari.toBook(ari));
- final int chapter_1 = Ari.toChapter(ari);
-
- versesView.setData(book, chapter_1, new Verses(), null, null, 0);
+ versesView.setData(Ari.toBookChapter(ari), new Verses(), null, null, 0);
}
return res;
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/dialog/XrefDialog.java b/Alkitab/src/main/java/yuku/alkitab/base/dialog/XrefDialog.java
index 868d466af..7b61c9bbc 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/dialog/XrefDialog.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/dialog/XrefDialog.java
@@ -13,30 +13,31 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
+import com.afollestad.materialdialogs.MaterialDialog;
import yuku.afw.D;
import yuku.afw.V;
-import yuku.alkitab.debug.R;
import yuku.alkitab.base.S;
import yuku.alkitab.base.dialog.base.BaseDialog;
-import yuku.alkitab.util.Ari;
-import yuku.alkitab.model.Book;
-import yuku.alkitab.model.SingleChapterVerses;
-import yuku.alkitab.model.Version;
-import yuku.alkitab.model.XrefEntry;
import yuku.alkitab.base.util.Appearances;
-import yuku.alkitab.util.IntArrayList;
import yuku.alkitab.base.util.TargetDecoder;
import yuku.alkitab.base.widget.VerseRenderer;
import yuku.alkitab.base.widget.VersesView;
import yuku.alkitab.base.widget.VersesView.VerseSelectionMode;
+import yuku.alkitab.debug.R;
+import yuku.alkitab.model.SingleChapterVerses;
+import yuku.alkitab.model.Version;
+import yuku.alkitab.model.XrefEntry;
+import yuku.alkitab.util.Ari;
+import yuku.alkitab.util.IntArrayList;
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
public class XrefDialog extends BaseDialog {
public static final String TAG = XrefDialog.class.getSimpleName();
- private static final String EXTRA_arif = "arif"; //$NON-NLS-1$
+ private static final String EXTRA_arif = "arif";
public interface XrefDialogListener {
void onVerseSelected(XrefDialog dialog, int arif_source, int ari_target);
@@ -87,7 +88,7 @@ public static XrefDialog newInstance(int arif) {
}
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View res = inflater.inflate(R.layout.dialog_xref, null);
+ View res = inflater.inflate(R.layout.dialog_xref, container, false);
tXrefText = V.get(res, R.id.tXrefText);
versesView = V.get(res, R.id.versesView);
@@ -97,11 +98,28 @@ public static XrefDialog newInstance(int arif) {
versesView.setVerseSelectionMode(VerseSelectionMode.singleClick);
versesView.setSelectedVersesListener(versesView_selectedVerses);
tXrefText.setMovementMethod(LinkMovementMethod.getInstance());
- renderXrefText();
-
+
+ if (xrefEntry != null) {
+ renderXrefText();
+ } else {
+ new MaterialDialog.Builder(getActivity())
+ .content(String.format(Locale.US, "Error: xref at arif 0x%08x couldn't be loaded", arif_source))
+ .positiveText(R.string.ok)
+ .show();
+ }
+
return res;
}
-
+
+ @Override
+ public void onActivityCreated(final Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ if (xrefEntry == null) {
+ dismiss();
+ }
+ }
+
void renderXrefText() {
final SpannableStringBuilder sb = new SpannableStringBuilder();
sb.append(VerseRenderer.XREF_MARK);
@@ -169,7 +187,12 @@ void showVerses(int linkPos, String encodedTarget) {
class Verses extends SingleChapterVerses {
@Override public String getVerse(int verse_0) {
- return displayedVerseTexts.get(verse_0);
+ final String res = displayedVerseTexts.get(verse_0);
+ // prevent crash if the target xref is not available
+ if (res == null) {
+ return getString(R.string.generic_verse_not_available_in_this_version);
+ }
+ return res;
}
@Override public int getVerseCount() {
@@ -182,10 +205,8 @@ class Verses extends SingleChapterVerses {
}
int firstAri = displayedRealAris.get(0);
- Book book = sourceVersion.getBook(Ari.toBook(firstAri));
- int chapter_1 = Ari.toChapter(firstAri);
-
- versesView.setData(book, chapter_1, new Verses(), null, null, 0);
+
+ versesView.setData(Ari.toBookChapter(firstAri), new Verses(), null, null, 0);
}
renderXrefText();
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/sync/Gcm.java b/Alkitab/src/main/java/yuku/alkitab/base/sync/Gcm.java
index d841560cc..439f00c26 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/sync/Gcm.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/sync/Gcm.java
@@ -1,9 +1,10 @@
package yuku.alkitab.base.sync;
+import android.os.Build;
import android.support.annotation.Nullable;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
-import com.google.android.gms.common.GooglePlayServicesUtil;
+import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.gcm.GoogleCloudMessaging;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.App;
@@ -30,10 +31,12 @@ public interface Listener {
private static final ConcurrentLinkedQueue listeners = new ConcurrentLinkedQueue<>();
private static boolean checkPlayServices() {
- final int statusCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(App.context);
+ final GoogleApiAvailability gaa = GoogleApiAvailability.getInstance();
+
+ final int statusCode = gaa.isGooglePlayServicesAvailable(App.context);
if (statusCode != ConnectionResult.SUCCESS) {
- if (GooglePlayServicesUtil.isUserRecoverableError(statusCode)) {
- GooglePlayServicesUtil.showErrorNotification(statusCode, App.context);
+ if (gaa.isUserResolvableError(statusCode) && thisIsPlayDevice()) {
+ gaa.showErrorNotification(App.context, statusCode);
} else {
Log.i(TAG, "This device is not supported.");
}
@@ -42,6 +45,22 @@ private static boolean checkPlayServices() {
return true;
}
+ private static boolean thisIsPlayDevice() {
+ if ("Amazon".equals(Build.MANUFACTURER) && Build.MODEL != null && (Build.MODEL.startsWith("KF") || Build.MODEL.startsWith("Kindle"))) {
+ return false;
+ }
+
+ if ("qnx".equals(System.getProperty("os.name"))) {
+ return false;
+ }
+
+ if ("Genymotion".equals(Build.MANUFACTURER)) {
+ return false;
+ }
+
+ return true;
+ }
+
/**
* @param listener to be called if a new registration id is obtained in the background
* @return a registration id that is currently stored if any, null otherwise.
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/widget/AttributeView.java b/Alkitab/src/main/java/yuku/alkitab/base/widget/AttributeView.java
index 326234116..d5b8482cf 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/widget/AttributeView.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/widget/AttributeView.java
@@ -13,7 +13,6 @@
import android.view.View;
import yuku.alkitab.base.App;
import yuku.alkitab.debug.R;
-import yuku.alkitab.model.Book;
public class AttributeView extends View {
@@ -24,6 +23,7 @@ public class AttributeView extends View {
static Bitmap bookmarkBitmap = null;
static Bitmap noteBitmap = null;
static Bitmap[] progressMarkBitmap = new Bitmap[PROGRESS_MARK_TOTAL_COUNT];
+ static Bitmap hasMapsBitmap = null;
static Paint alphaPaint = new Paint();
static Paint attributeCountPaintBookmark = new Paint();
static Paint attributeCountPaintNote;
@@ -41,11 +41,10 @@ public class AttributeView extends View {
int bookmark_count;
int note_count;
int progress_mark_bits;
+ boolean has_maps;
private VersesView.AttributeListener attributeListener;
- private Book book;
- private int chapter_1;
- private int verse_1;
+ private int ari;
private static SparseArray progressMarkAnimationStartTimes = new SparseArray<>();
private int drawOffsetLeft;
@@ -64,7 +63,7 @@ private void init() {
float density = getResources().getDisplayMetrics().density;
drawOffsetLeft = Math.round(1 * density);
- attributeCountPaintNote.setShadowLayer(density*4, 0, 0, 0xffffffff);
+ attributeCountPaintNote.setShadowLayer(density * 4, 0, 0, 0xffffffff);
}
public int getBookmarkCount() {
@@ -97,6 +96,16 @@ public void setProgressMarkBits(final int progress_mark_bits) {
invalidate();
}
+ public boolean getHasMaps() {
+ return has_maps;
+ }
+
+ public void setHasMaps(final boolean has_maps) {
+ this.has_maps = has_maps;
+ requestLayout();
+ invalidate();
+ }
+
public boolean isShowingSomething() {
return bookmark_count > 0 || note_count > 0 || ((progress_mark_bits & PROGRESS_MARK_BIT_MASK) != 0);
}
@@ -122,6 +131,13 @@ Bitmap getProgressMarkBitmapByPresetId(int preset_id) {
return progressMarkBitmap[preset_id];
}
+ Bitmap getHasMapsBitmap() {
+ if (hasMapsBitmap == null) {
+ hasMapsBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_attr_has_maps);
+ }
+ return hasMapsBitmap;
+ }
+
@Override
protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
int totalHeight = 0;
@@ -151,6 +167,13 @@ protected void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec
}
}
}
+ if (has_maps) {
+ final Bitmap hasMapsBitmap = getHasMapsBitmap();
+ totalHeight += hasMapsBitmap.getHeight();
+ if (totalWidth < hasMapsBitmap.getWidth()) {
+ totalWidth = hasMapsBitmap.getWidth();
+ }
+ }
setMeasuredDimension(totalWidth, totalHeight);
}
@@ -202,6 +225,12 @@ protected void onDraw(final Canvas canvas) {
}
}
}
+ if (has_maps) {
+ final Bitmap hasMapsBitmap = getHasMapsBitmap();
+ canvas.drawBitmap(hasMapsBitmap, drawOffsetLeft, totalHeight, null);
+ //noinspection UnusedAssignment
+ totalHeight += hasMapsBitmap.getHeight();
+ }
}
@Override
@@ -213,7 +242,7 @@ public boolean onTouchEvent(final MotionEvent event) {
final Bitmap bookmarkBitmap = getBookmarkBitmap();
totalHeight += bookmarkBitmap.getHeight();
if (totalHeight > y) {
- attributeListener.onBookmarkAttributeClick(book, chapter_1, verse_1);
+ attributeListener.onBookmarkAttributeClick(ari);
return true;
}
}
@@ -221,7 +250,7 @@ public boolean onTouchEvent(final MotionEvent event) {
final Bitmap noteBitmap = getNoteBitmap();
totalHeight += noteBitmap.getHeight();
if (totalHeight > y) {
- attributeListener.onNoteAttributeClick(book, chapter_1, verse_1);
+ attributeListener.onNoteAttributeClick(ari);
return true;
}
}
@@ -237,17 +266,23 @@ public boolean onTouchEvent(final MotionEvent event) {
}
}
}
+ if (has_maps) {
+ final Bitmap hasMapsBitmap = getHasMapsBitmap();
+ totalHeight += hasMapsBitmap.getHeight();
+ if (totalHeight > y) {
+ attributeListener.onHasMapsAttributeClick(ari);
+ return true;
+ }
+ }
} else if (MotionEventCompat.getActionMasked(event) == MotionEvent.ACTION_DOWN) {
return true;
}
return false;
}
- public void setAttributeListener(VersesView.AttributeListener attributeListener, Book book, int chapter_1, int verse_1) {
+ public void setAttributeListener(VersesView.AttributeListener attributeListener, int ari) {
this.attributeListener = attributeListener;
- this.book = book;
- this.chapter_1 = chapter_1;
- this.verse_1 = verse_1;
+ this.ari = ari;
}
public static void startAnimationForProgressMark(final int preset_id) {
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/widget/GotoButton.java b/Alkitab/src/main/java/yuku/alkitab/base/widget/GotoButton.java
index 4b0818a21..b5dcd409e 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/widget/GotoButton.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/widget/GotoButton.java
@@ -1,10 +1,12 @@
package yuku.alkitab.base.widget;
import android.content.Context;
+import android.content.res.Configuration;
import android.support.v4.view.MotionEventCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.Button;
+import yuku.alkitab.debug.R;
public class GotoButton extends Button {
public static final String TAG = GotoButton.class.getSimpleName();
@@ -18,6 +20,7 @@ public interface FloaterDragListener {
int[] screenLocation = {0, 0};
boolean inFloaterDrag;
boolean inLongClicked;
+ int untouchableSideWidth = Integer.MIN_VALUE;
FloaterDragListener floaterDragListener;
public GotoButton(final Context context) {
@@ -32,6 +35,13 @@ public GotoButton(final Context context, final AttributeSet attrs, final int def
super(context, attrs, defStyle);
}
+ @Override
+ protected void onConfigurationChanged(final Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+
+ untouchableSideWidth = Integer.MIN_VALUE;
+ }
+
@Override
public boolean onTouchEvent(final MotionEvent event) {
final int action = MotionEventCompat.getActionMasked(event);
@@ -39,6 +49,14 @@ public boolean onTouchEvent(final MotionEvent event) {
float x = event.getX();
float y = event.getY();
+ if (untouchableSideWidth == Integer.MIN_VALUE) {
+ untouchableSideWidth = getResources().getDimensionPixelSize(R.dimen.nav_prevnext_width) - getResources().getDimensionPixelSize(R.dimen.nav_goto_side_margin);
+ }
+
+ if (x >= 0 && x < untouchableSideWidth || x < getWidth() && x >= getWidth() - untouchableSideWidth) {
+ return false;
+ }
+
getLocationOnScreen(screenLocation);
float screenX = x + screenLocation[0];
float screenY = y + screenLocation[1];
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/widget/SingleViewVerseAdapter.java b/Alkitab/src/main/java/yuku/alkitab/base/widget/SingleViewVerseAdapter.java
index 58f7f6f97..721b79972 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/widget/SingleViewVerseAdapter.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/widget/SingleViewVerseAdapter.java
@@ -63,7 +63,7 @@ public SingleViewVerseAdapter(Context context) {
res = (VerseItem) convertView;
}
- final int ari = Ari.encode(book_.bookId, chapter_1_, verse_1);
+ final int ari = Ari.encodeWithBc(ari_bc_, verse_1);
final String text = verses_.getVerse(id);
final String verseNumberText = verses_.getVerseNumberText(id);
final boolean dontPutSpacingBefore = (position > 0 && itemPointer_[position - 1] < 0) || position == 0;
@@ -81,7 +81,8 @@ public SingleViewVerseAdapter(Context context) {
attributeView.setBookmarkCount(bookmarkCountMap_ == null ? 0 : bookmarkCountMap_[id]);
attributeView.setNoteCount(noteCountMap_ == null ? 0 : noteCountMap_[id]);
attributeView.setProgressMarkBits(progressMarkBitsMap_ == null ? 0 : progressMarkBitsMap_[id]);
- attributeView.setAttributeListener(attributeListener_, book_, chapter_1_, verse_1);
+ attributeView.setHasMaps(hasMapsMap_ != null && hasMapsMap_[id]);
+ attributeView.setAttributeListener(attributeListener_, ari);
res.setCollapsed(text.length() == 0 && !attributeView.isShowingSomething());
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseAdapter.java b/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseAdapter.java
index 27b15505f..e9fbdf655 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseAdapter.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseAdapter.java
@@ -1,13 +1,15 @@
package yuku.alkitab.base.widget;
+import android.content.ContentResolver;
import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.widget.BaseAdapter;
+import yuku.alkitab.base.App;
import yuku.alkitab.base.S;
-import yuku.alkitab.base.storage.InternalDb;
import yuku.alkitab.base.util.Highlights;
-import yuku.alkitab.model.Book;
import yuku.alkitab.model.PericopeBlock;
import yuku.alkitab.model.ProgressMark;
import yuku.alkitab.model.SingleChapterVerses;
@@ -25,8 +27,7 @@ public abstract class VerseAdapter extends BaseAdapter {
final float density_;
// # field setData
- Book book_;
- int chapter_1_;
+ int ari_bc_;
SingleChapterVerses verses_;
PericopeBlock[] pericopeBlocks_;
@@ -43,6 +44,7 @@ public abstract class VerseAdapter extends BaseAdapter {
int[] noteCountMap_;
Highlights.Info[] highlightInfoMap_;
int[] progressMarkBitsMap_;
+ boolean[] hasMapsMap_;
LayoutInflater inflater_;
VersesView owner_;
@@ -52,9 +54,8 @@ public VerseAdapter(Context context) {
inflater_ = LayoutInflater.from(context);
}
- /* non-public */ synchronized void setData(Book book, int chapter_1, SingleChapterVerses verses, int[] pericopeAris, PericopeBlock[] pericopeBlocks, int nblock) {
- book_ = book;
- chapter_1_ = chapter_1;
+ /* non-public */ synchronized void setData(int ariBc, SingleChapterVerses verses, int[] pericopeAris, PericopeBlock[] pericopeBlocks, int nblock) {
+ ari_bc_ = ariBc;
verses_ = verses;
pericopeBlocks_ = pericopeBlocks;
itemPointer_ = makeItemPointer(verses_.getVerseCount(), pericopeAris, pericopeBlocks, nblock);
@@ -63,8 +64,7 @@ public VerseAdapter(Context context) {
}
/* non-public */ synchronized void setDataEmpty() {
- book_ = null;
- chapter_1_ = 0;
+ ari_bc_ = 0;
verses_ = null;
pericopeBlocks_ = null;
itemPointer_ = null;
@@ -74,15 +74,15 @@ public VerseAdapter(Context context) {
public synchronized void reloadAttributeMap() {
// book_ can be empty when the selected (book, chapter) is not available in this version
- if (book_ == null) return;
+ if (ari_bc_ == 0) return;
- // 1/2: Attributes
+ // 1/3: Bookmarks/Notes/Highlights
final int[] bookmarkCountMap;
final int[] noteCountMap;
final Highlights.Info[] highlightColorMap;
final int verseCount = verses_.getVerseCount();
- final int ariBc = Ari.encode(book_.bookId, chapter_1_, 0x00);
+ final int ariBc = ari_bc_;
if (S.getDb().countMarkersForBookChapter(ariBc) > 0) {
bookmarkCountMap = new int[verseCount];
noteCountMap = new int[verseCount];
@@ -98,7 +98,7 @@ public synchronized void reloadAttributeMap() {
final int ariMin = ariBc & 0x00ffff00;
final int ariMax = ariBc | 0x000000ff;
- // 2/2: Progress marks
+ // 2/3: Progress marks
int[] progressMarkBitsMap = null;
for (final ProgressMark progressMark: S.getDb().listAllProgressMarks()) {
final int ari = progressMark.ari;
@@ -112,17 +112,50 @@ public synchronized void reloadAttributeMap() {
int mapOffset = Ari.toVerse(ari) - 1;
if (mapOffset >= progressMarkBitsMap.length) {
- Log.e(InternalDb.TAG, "mapOffset out of bounds: " + mapOffset + " happened on ari 0x" + Integer.toHexString(ari));
+ Log.e(TAG, "(for progressMarkBitsMap:) mapOffset out of bounds: " + mapOffset + " happened on ari 0x" + Integer.toHexString(ari));
} else {
progressMarkBitsMap[mapOffset] |= 1 << (progressMark.preset_id + AttributeView.PROGRESS_MARK_BITS_START);
}
}
+ // 3/3: Location indicators
+ // Look up for maps locations.
+ // If the app is installed, query its content provider to see which verses has locations on the map.
+ boolean[] hasMapsMap = null;
+ {
+ final ContentResolver cr = App.context.getContentResolver();
+ final Uri uri = Uri.parse("content://palki.maps/exists?ari=" + ariBc);
+ try (Cursor c = cr.query(uri, null, null, null, null)) {
+ if (c != null) {
+ final int col_aris = c.getColumnIndexOrThrow("aris");
+
+ if (c.moveToNext()) {
+ final String aris_json = c.getString(col_aris);
+ final int[] aris = App.getDefaultGson().fromJson(aris_json, int[].class);
+
+ if (aris != null) {
+ hasMapsMap = new boolean[verseCount];
+
+ for (final int ari : aris) {
+ int mapOffset = Ari.toVerse(ari) - 1;
+ if (mapOffset >= hasMapsMap.length) {
+ Log.e(TAG, "(for hasMapsMap:) mapOffset out of bounds: " + mapOffset + " happened on ari 0x" + Integer.toHexString(ari));
+ } else {
+ hasMapsMap[mapOffset] = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
// Finish calculating
bookmarkCountMap_ = bookmarkCountMap;
noteCountMap_ = noteCountMap;
highlightInfoMap_ = highlightColorMap;
progressMarkBitsMap_ = progressMarkBitsMap;
+ hasMapsMap_ = hasMapsMap;
notifyDataSetChanged();
}
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseRenderer.java b/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseRenderer.java
index 17dc18b79..5ac5ae350 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseRenderer.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/widget/VerseRenderer.java
@@ -2,6 +2,8 @@
import android.graphics.Paint.FontMetricsInt;
import android.graphics.Typeface;
+import android.os.Handler;
+import android.os.Looper;
import android.support.annotation.Nullable;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
@@ -12,7 +14,9 @@
import android.text.style.MetricAffectingSpan;
import android.text.style.StyleSpan;
import android.widget.TextView;
+import android.widget.Toast;
import yuku.afw.storage.Preferences;
+import yuku.alkitab.base.App;
import yuku.alkitab.base.S;
import yuku.alkitab.base.U;
import yuku.alkitab.base.util.Appearances;
@@ -317,21 +321,48 @@ static void processSpecialTag(final SpannableStringBuilder sb, final StringBuild
if (tag.length() >= 2) {
// Footnote
if (tag.charAt(0) == 'f') {
- final int field = Integer.parseInt(tag.substring(1));
- appendSuperscriptNumber(sb, field);
- if (inlineLinkSpanFactory != null) {
- sb.setSpan(inlineLinkSpanFactory.create(VerseInlineLinkSpan.Type.footnote, ari << 8 | field), sb_len, sb.length(), 0);
+ try {
+ final int field = Integer.parseInt(tag.substring(1));
+ if (field < 1 || field > 255) {
+ throw new NumberFormatException();
+ }
+ appendSuperscriptNumber(sb, field);
+ if (inlineLinkSpanFactory != null) {
+ sb.setSpan(inlineLinkSpanFactory.create(VerseInlineLinkSpan.Type.footnote, ari << 8 | field), sb_len, sb.length(), 0);
+ }
+ } catch (NumberFormatException e) {
+ reportInvalidSpecialTag("Invalid footnote tag at ari 0x" + Integer.toHexString(ari) + ": " + tag);
}
} else if (tag.charAt(0) == 'x') {
- sb.append(XREF_MARK); // star mark
- final int field = Integer.parseInt(tag.substring(1));
- if (inlineLinkSpanFactory != null) {
- sb.setSpan(inlineLinkSpanFactory.create(VerseInlineLinkSpan.Type.xref, ari << 8 | field), sb_len, sb.length(), 0);
+ try {
+ final int field = Integer.parseInt(tag.substring(1));
+ if (field < 1 || field > 255) {
+ throw new NumberFormatException();
+ }
+ sb.append(XREF_MARK); // star mark
+ if (inlineLinkSpanFactory != null) {
+ sb.setSpan(inlineLinkSpanFactory.create(VerseInlineLinkSpan.Type.xref, ari << 8 | field), sb_len, sb.length(), 0);
+ }
+ } catch (NumberFormatException e) {
+ reportInvalidSpecialTag("Invalid xref tag at ari 0x" + Integer.toHexString(ari) + ": " + tag);
}
}
}
}
+ static Toast invalidSpecialTagToast;
+
+ static void reportInvalidSpecialTag(final String msg) {
+ new Handler(Looper.getMainLooper()).post(() -> {
+ if (invalidSpecialTagToast == null) {
+ invalidSpecialTagToast = Toast.makeText(App.context, msg, Toast.LENGTH_SHORT);
+ } else {
+ invalidSpecialTagToast.setText(msg);
+ }
+ invalidSpecialTagToast.show();
+ });
+ }
+
public static void appendSuperscriptNumber(final SpannableStringBuilder sb, final int field) {
if (field >= 0 && field < 10) {
sb.append(superscriptDigits[field]);
diff --git a/Alkitab/src/main/java/yuku/alkitab/base/widget/VersesView.java b/Alkitab/src/main/java/yuku/alkitab/base/widget/VersesView.java
index 4e0613ce2..3b7ef5908 100644
--- a/Alkitab/src/main/java/yuku/alkitab/base/widget/VersesView.java
+++ b/Alkitab/src/main/java/yuku/alkitab/base/widget/VersesView.java
@@ -17,7 +17,6 @@
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.U;
import yuku.alkitab.debug.R;
-import yuku.alkitab.model.Book;
import yuku.alkitab.model.PericopeBlock;
import yuku.alkitab.model.SingleChapterVerses;
import yuku.alkitab.util.IntArrayList;
@@ -69,9 +68,10 @@ public interface SelectedVersesListener {
}
public interface AttributeListener {
- void onBookmarkAttributeClick(Book book, int chapter_1, int verse_1);
- void onNoteAttributeClick(Book book, int chapter_1, int verse_1);
+ void onBookmarkAttributeClick(int ari);
+ void onNoteAttributeClick(int ari);
void onProgressMarkAttributeClick(int preset_id);
+ void onHasMapsAttributeClick(int ari);
}
public interface OnVerseScrollListener {
@@ -125,7 +125,7 @@ public PressResult(final PressKind kind, final int targetVerse_1) {
private String name;
private boolean firstTimeScroll = true;
/**
- * Updated every time {@link #setData(yuku.alkitab.model.Book, int, yuku.alkitab.model.SingleChapterVerses, int[], yuku.alkitab.model.PericopeBlock[], int)}
+ * Updated every time {@link #setData(int, SingleChapterVerses, int[], PericopeBlock[], int)}
* or {@link #setDataEmpty()} is called. Used to track data changes, so delayed scroll, etc can be prevented from happening if the data has changed.
*/
private AtomicInteger dataVersionNumber = new AtomicInteger();
@@ -246,9 +246,9 @@ public int getPositionBasedOnScroll() {
return pos;
}
- public void setData(Book book, int chapter_1, SingleChapterVerses verses, int[] pericopeAris, PericopeBlock[] pericopeBlocks, int nblock) {
+ public void setData(int ariBc, SingleChapterVerses verses, int[] pericopeAris, PericopeBlock[] pericopeBlocks, int nblock) {
dataVersionNumber.incrementAndGet();
- adapter.setData(book, chapter_1, verses, pericopeAris, pericopeBlocks, nblock);
+ adapter.setData(ariBc, verses, pericopeAris, pericopeBlocks, nblock);
stopFling();
}
@@ -465,7 +465,7 @@ private void smoothScrollFixed(final int newPos, final int offset) {
}, smoothScrollDuration + 17);
}
- public void setDataWithRetainSelectedVerses(boolean retainSelectedVerses, Book book, int chapter_1, int[] pericope_aris, PericopeBlock[] pericope_blocks, int nblock, SingleChapterVerses verses) {
+ public void setDataWithRetainSelectedVerses(boolean retainSelectedVerses, int ariBc, int[] pericope_aris, PericopeBlock[] pericope_blocks, int nblock, SingleChapterVerses verses) {
IntArrayList selectedVerses_1 = null;
if (retainSelectedVerses) {
selectedVerses_1 = getSelectedVerses_1();
@@ -473,7 +473,7 @@ public void setDataWithRetainSelectedVerses(boolean retainSelectedVerses, Book b
//# fill adapter with new data. make sure all checked states are reset
uncheckAllVerses(true);
- setData(book, chapter_1, verses, pericope_aris, pericope_blocks, nblock);
+ setData(ariBc, verses, pericope_aris, pericope_blocks, nblock);
reloadAttributeMap();
boolean anySelected = false;
diff --git a/Alkitab/src/main/res/drawable-hdpi/ic_attr_has_maps.png b/Alkitab/src/main/res/drawable-hdpi/ic_attr_has_maps.png
new file mode 100644
index 000000000..956699775
Binary files /dev/null and b/Alkitab/src/main/res/drawable-hdpi/ic_attr_has_maps.png differ
diff --git a/Alkitab/src/main/res/drawable-mdpi/ic_attr_has_maps.png b/Alkitab/src/main/res/drawable-mdpi/ic_attr_has_maps.png
new file mode 100644
index 000000000..8eb996b22
Binary files /dev/null and b/Alkitab/src/main/res/drawable-mdpi/ic_attr_has_maps.png differ
diff --git a/Alkitab/src/main/res/drawable-xhdpi/ic_attr_has_maps.png b/Alkitab/src/main/res/drawable-xhdpi/ic_attr_has_maps.png
new file mode 100644
index 000000000..cc476c6c3
Binary files /dev/null and b/Alkitab/src/main/res/drawable-xhdpi/ic_attr_has_maps.png differ
diff --git a/Alkitab/src/main/res/drawable-xxhdpi/ic_attr_has_maps.png b/Alkitab/src/main/res/drawable-xxhdpi/ic_attr_has_maps.png
new file mode 100644
index 000000000..783bb8810
Binary files /dev/null and b/Alkitab/src/main/res/drawable-xxhdpi/ic_attr_has_maps.png differ
diff --git a/Alkitab/src/main/res/drawable-xxxhdpi/ic_attr_has_maps.png b/Alkitab/src/main/res/drawable-xxxhdpi/ic_attr_has_maps.png
new file mode 100644
index 000000000..5b7a858f3
Binary files /dev/null and b/Alkitab/src/main/res/drawable-xxxhdpi/ic_attr_has_maps.png differ
diff --git a/Alkitab/src/main/res/layout/activity_isi.xml b/Alkitab/src/main/res/layout/activity_isi.xml
index 96fbbe1a6..766729a27 100644
--- a/Alkitab/src/main/res/layout/activity_isi.xml
+++ b/Alkitab/src/main/res/layout/activity_isi.xml
@@ -4,8 +4,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawerLayout"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fitsSystemWindows="true">
+ android:layout_height="match_parent">
-
Den Link zur Seite mit dem geteilten Inhalt an das Ende des kopierten oder geteilten Textes anhängen
Automatisch im Wörterbuch nachschlagen
Bei selektierten Versen automatisch Wörter im Wörterbuch suchen
+ Notiz durch Antippen bearbeiten
+ Option deaktivieren, um beim Anschauen von bestehenden Notizen unabsichtliches Bearbeiten zu verhindern
Bibelübersetzungen mit Copyright aktivieren
Vershintergrund-Farbe festlegen
diff --git a/Alkitab/src/main/res/values-de/strings.xml b/Alkitab/src/main/res/values-de/strings.xml
index 312ac606b..f28c71a61 100644
--- a/Alkitab/src/main/res/values-de/strings.xml
+++ b/Alkitab/src/main/res/values-de/strings.xml
@@ -334,6 +334,7 @@
Herunterladen des ausgewählten Leseplans fehlgeschlagen. Versuchen Sie es mit einer funktionierenden Internetverbindung erneut.
Der heruntergeladene Leseplan ist beschädigt. Versuchen Sie es mit einer funktionierenden Internetverbindung erneut.
Diesen Leseplan haben Sie bereits heruntergeladen.
+ Bis hierhin als gelesen markieren?
"Die Übersetzung, die Sie heruntergeladen haben, kann nur mit speziellen Schriftarten angezeigt werden. Gehen Sie zum Menü \'Textdarstellung\' und wählen Sie eine passende Schriftart. Burmese benötigt Parabaik, ParabaikSans oder Myanmar3. Tamil benötigt Akshar. Telugu benötigt Suranna."
Die heruntergeladene Datei scheint fehlerhaft zu sein.
Nachtmodus
diff --git a/Alkitab/src/main/res/values-in/strings.xml b/Alkitab/src/main/res/values-in/strings.xml
index fbc27eb93..caa07000b 100644
--- a/Alkitab/src/main/res/values-in/strings.xml
+++ b/Alkitab/src/main/res/values-in/strings.xml
@@ -456,6 +456,8 @@
Password sudah diganti.
Beri jarak sekitar teks
Lebih sedikit teks per barisnya agar mudah dibaca
+ Navigasi ayat di bawah
+ Letakkan navigasi ayat di bagian bawah layar Alkitab
Pengingat
Renungan harian
Baca renungan hari ini.
@@ -496,4 +498,5 @@
Unduh
Panduan
Tafsiran
+ Tidak bisa membuka aplikasi Peta Alkitab.
diff --git a/Alkitab/src/main/res/values-ms/pref_colortheme_labels.xml b/Alkitab/src/main/res/values-ms/pref_colortheme_labels.xml
index 52d7389f6..209e2ee95 100644
--- a/Alkitab/src/main/res/values-ms/pref_colortheme_labels.xml
+++ b/Alkitab/src/main/res/values-ms/pref_colortheme_labels.xml
@@ -3,20 +3,20 @@
- Kertas Bersih
- - Lollipop
- - Bubble Gum
+ - Lolipop
+ - Gula Getah
- Sakura
- - Tropic Subur
- - Tasik Moss
- - Abu Panas
+ - Tropika Subur
+ - Tasik Lumut
+ - Abu Hangat
- Oren Manis
- - Padang Pasir kering
- - Wood
+ - Gurun Kering
+ - Kayu
- Coklat
- - Jambu Batu basah
+ - Jambu Batu Basah
- Malam Jelas
- - Malam Berbintang
- - Dark Material
+ - Malam Penuh Bintang
+ - Material Gelap
- Papan Hitam
- Cahaya Lembut
diff --git a/Alkitab/src/main/res/values-ms/pref_labels.xml b/Alkitab/src/main/res/values-ms/pref_labels.xml
index 9025e5d82..79e347307 100644
--- a/Alkitab/src/main/res/values-ms/pref_labels.xml
+++ b/Alkitab/src/main/res/values-ms/pref_labels.xml
@@ -9,11 +9,23 @@ Latar belakang
Nombor nombor ayat
Perkataan Yesus
Penggunaan
+ Menyalin dan berkongsi
Tunjukkan senarai buku mengikut susunan abjad (a-z) dan bukannya asal
Buku mengikut jenis abjad
Skrin peranti tidak akan mematikan apabila membaca Alkitab
Pastikan skrin terbuka
Paparan
Navigasi butang kelantangan
+ Nombor ayat
+ Mulakan setiap ayat dengan nombornya
+ Kependekan versi
+ Sebutkan singkatan versi Bible
+ Perkongsian URL
+ Tambahkan pautan laman perkongsian di akhir teks yang disalin atau dikongsi
+ Carian kamus automatik
+ Mencari perkataan daripada kamus untuk ayat yang dipilih
+ Ketik untuk menyunting nota
+ Nyahsemak untuk mencegah penyuntingan yang disengajakan apabila melihat nota yang telah dibuat
Dayakan versi yang mungkin terhad
+ Latar belakang ayat terpilih
diff --git a/Alkitab/src/main/res/values-ms/pref_volumebuttonnavigation_labels.xml b/Alkitab/src/main/res/values-ms/pref_volumebuttonnavigation_labels.xml
index a6345937a..aa9da0ee5 100644
--- a/Alkitab/src/main/res/values-ms/pref_volumebuttonnavigation_labels.xml
+++ b/Alkitab/src/main/res/values-ms/pref_volumebuttonnavigation_labels.xml
@@ -5,6 +5,6 @@
- "Jangan gunakan untuk mengemudi"
- Navigasi ayat
- Navigasi bab
- - Page up/down
+ - Laman ke atas/bawah
diff --git a/Alkitab/src/main/res/values-ms/strings.xml b/Alkitab/src/main/res/values-ms/strings.xml
index f5c3daef4..2b781348a 100644
--- a/Alkitab/src/main/res/values-ms/strings.xml
+++ b/Alkitab/src/main/res/values-ms/strings.xml
@@ -126,6 +126,7 @@
Muat turun
Kemas kini
Kemas kini tersedia
+ Aplikasi Pengurus Muat Turun tidak didayakan atau tidak tersedia.\n\nDayakannya untuk memuat turun versi Bible.
Butiran
Buang
Edit penanda buku
@@ -151,6 +152,7 @@
Nota
Sorotan
Penanda buku tidak berlabel
+ Isih label mengikut abjad
Tiada nota bertulis lagi.\nKetik pada ayat untuk mula menulis nota.
Tiada menekankan ayat.\nKetik pada ayat-ayat untuk memulakan menonjolkan mereka.
Tiada penanda buku tanpa sebarang label.
@@ -162,6 +164,7 @@
Pemindahan
Fail tidak dijumpai: %s
Membuat dan menghantar sandaran penanda buku, nota, dan sorotan? Anda boleh, sebagai contoh, menghantar fail yang dilampirkan melalui e-mel ke peranti lain, atau hanya untuk tujuan arkib.
+ Lindungi penanda anda dengan penyegerakan
LABEL
Tambah...
Nama label:
@@ -192,6 +195,10 @@
Berani
Perubahan tarikh
Carian
+ 1 ayat dilih
+ %s ayat dipilih
+ Gedung Play Google tidak dipasang.
+ Lalai
Pendail
Langsung
Grid
@@ -205,6 +212,7 @@
Lirik, dan lain-lain. juga
Lagu
SEMUA
+ Muat turun lebih banyak…
Mencari semua buku yang dipasang.
Memuat turun...
Muat turun buku lagu
@@ -212,9 +220,13 @@
Kongsi lagu
Versi %s
Ref.
+ Padam buku lagu
+ Padam kesemua lagu daripada buku lagu ^1?
+ ^1 lagu telah dipadam daripada buku lagu ^2.
Kemaskini buku ^1 kepada versi yang terkini?
Kemaskini
Kemaskini buku lagu
+ Sila kemas kini ^1 kepada versi terkini sebelum meneruskan. Setelah dikemas kini, hantar suntingan anda jika perlu.
Hari sebelumnya
Hari seterusnya
Buka penanda buku
@@ -233,6 +245,12 @@
Kemajuan ketiga
Kemajuan keempat
Kemajuan kelima
+ Satu penanda buku telah dilampirkan pada ayat ini.
+ %s penanda buku telah dilampirkan pada ayat ini.
+ Satu nota telah dilampirkan pada ayat ini.
+ %s nota telah dilampirkan pada ayat ini.
+ %s sedang berada di sini.
+ Senarai tanda
Buka fail YES
Buka fail PDB
Buka fail PDB/YES
@@ -285,6 +303,9 @@
Di sebalik jadual: %s%%
Tiada lagi rancangan membaca tersedia.
"Padam \'%s\'?"
+ Mengubah tarikh mula supaya pembacaan yang belum dibaca adalah hari ini?
+ Mulakan rancangan pembacaan dari awal dengan menandai semua sebagai belum dibaca?
+ Pilih tarikh
Pergi ke belum dibaca dahulu
Hari %1$s: %2$s
Bacaan sebelumnya
@@ -296,17 +317,24 @@
Pergi ke tarikh
Hari seterusnya
Muat turun
+ Segerak semula tarikh
+ Mula semula
Padam
Kemajuan
+ Pergi ke hari ini
+ Tetapkan tarikh mula
Tunjuk butiran
Sembunyikan butiran
Mengenai pelan
+ ^1 (^2 hari)\nID: ^3\n\n^4
%s hari
Memuat turun senarai rancangan membaca...
Gagal untuk memuat turun senarai pelan membaca. Sila cuba lagi dengan sambungan Internet yang berfungsi.
Memuat turun pelan bacaan...
Gagal untuk memuat turun pelan bacaan yang dipilih. Sila cuba lagi dengan sambungan Internet yang berfungsi.
Data pelan bacaan yang dimuat turun adalah rosak. Sila cuba sekali lagi dengan sambungan Internet yang berfungsi.
+ Anda telah mempunyai rancangan pembacaan ini.
+ Tandakan sebagai telah dibaca sehingga tempat ini?
"Versi dimuat turun mungkin perlu dipaparkan dengan fon tertentu. Pergi ke menu \'Teks rupa\' dan pilih fon. Yunani memerlukan font Ubuntu. Burma memerlukan Parabaik, ParabaikSans, atau Myanmar3. Tamil memerlukan Akshar. Telugu memerlukan Suranna."
Fail yang dimuat turun seolah-olah menjadi rosak.
Mod malam
@@ -330,6 +358,7 @@
Salin lagu
Main
Jeda
+ Pembacaan terkini
Perjanjian Lama
Pentateuch
Sejarah
@@ -356,6 +385,112 @@
Dari URL Internet
.ya FAIL URL
URL tidak sah.
+ URL internet hendaklah mempunyai pengakhiran .yes.
+ Sila lakukan beberapa suntingan sebelum menghantar.
+ Rujukan
+ Hantar
+ Hantar pembetulan
+ Sunting
+ Padam
+ Selesai
+ Maaf, kami tidak faham pautan ayat ini.
+ Tidak didaftar masuk
+ Akaun
+ Adakah anda ingin melog keluar? Penanda semasa anda dan data tempatan yang lain tidak akan dipadam.
+ Membuat akaun baru…
+ Melog masuk…
+ Memproses…
+ Gagal melog masuk. Sila cuba lagi nanti.\n\nSebab: %s
+ Gagal membuat akaun baru. Sila cuba lagi nanti.\n\nSebab: %s
+ Akaun anda telah dibuat, tetapi kami gagal menghantar ID pendaftaran GCM. Sila cuba untuk melog masuk (jangan mendaftar sekali lagi).
+ Segerak
+ Tetapan penyegerakan
+ Jenis data
+ Penanda dan label
+ Kemajuan rancangan pembacaan
+ Ayat terkini
+ Tanda
+ Segerak sekarang
+ Lihat log
+ Kali terakhir disegerak %1$s, %2$s (r%3$s)
+ Tidak disegerak lagi
+ Menyegerak sekarang…
+ Log penyegerakan
+ Log masuk atau membuat akaun
+ Pilih agama
+ Kristian
+ Protestan
+ Lutheran
+ Methodist
+ Anglikan
+ Adventist
+ Pentakosta/Karismatik
+ Rom Katolik
+ Mazhab lain
+ Islam
+ Buddha
+ Hindu
+ Agama lain
+ Ateis
+ Agnostik
+ Ubah kata laluan
+ Ubah kata laluan
+ Sila isikan ini.
+ Kata laluan
+ Kata laluan baru
+ Penyegerakan akan melindungi penanda dan data anda yang lain.\nMaklumat lanjut
+ E-mel
+ Terlupa?
+ Pilihan
+ Gabungan gereja
+ Bandar
+ Daftar
+ Log masuk
+ Dengan menekan butang di bawah, anda bersetuju dengan dasar privasi kami.
+ Alamat e-mel tidak sah.
+ Sila masukkan kata laluan yang sama pada dialog pengesahan.
+ Sahkan kata laluan
+ Sila periksa e-mel anda untk arahan selanjutnya.
+ Kata laluan anda telah diubah.
+ Jidar sekitar teks
+ Jadikan teks dalam barisan lebih sempit agar mudah dibaca
+ Peringatan
+ Pemujaan harian
+ Baca pemujaan hari ini sekarang.
+ Tutup
+ Penggera
+ Bunyi
+ Getaran
+ Pesanan peringatan
+ Bunyi lalai
Penterjemah
+ Panduan Pengguna
+ Maklum Balas Versi Beta
versi %s
+ Sumber Bahan
+ Kredit
+ Pengumuman
+ Pengumuman (0)
+ Pengumuman (%s)
+ Gagal memuatkan pengumuman.
+ Tapak Web Rasmi
+ Laman Projek
+ Jangan tanya lagi
+ Bukan sekarang
+ Import penanda lama
+ Pilih fail sandaran v3
+ Adakah anda pasti anda tidak memerlukan data lama untuk diimport?
+ Tidak dapat mencapai fail sandaran.
+ Ya, import daripada yang terbaru (disarankan)
+ Sandaran lain
+ %1$s bertarikh %2$s
+ Pengumuman %s
+ %s pengumuman baru
+ Kamus
+ Buka kamus
+ Tiada takrifan dijumpai untuk perkataan yang dipilih.
+ Muat turun \"Kamus Bible\" untuk mempelajari perkataan dalam Bible!
+ Muat turun
+ Panduan
+ Komen
diff --git a/Alkitab/src/main/res/values/pref_defaults.xml b/Alkitab/src/main/res/values/pref_defaults.xml
index c8cb3562c..8aa77da70 100644
--- a/Alkitab/src/main/res/values/pref_defaults.xml
+++ b/Alkitab/src/main/res/values/pref_defaults.xml
@@ -5,6 +5,7 @@
true
true
+ false
default
diff --git a/Alkitab/src/main/res/values/prefkey.xml b/Alkitab/src/main/res/values/prefkey.xml
index 3ff1eeb95..8f7f259fe 100644
--- a/Alkitab/src/main/res/values/prefkey.xml
+++ b/Alkitab/src/main/res/values/prefkey.xml
@@ -2,6 +2,7 @@
nyalakanTerusLayar
textPadding
+ bottomToolbarOnText
tombolVolumeBuatPindah
diff --git a/Alkitab/src/main/res/values/strings.xml b/Alkitab/src/main/res/values/strings.xml
index fc99a6cdb..8c0b42711 100644
--- a/Alkitab/src/main/res/values/strings.xml
+++ b/Alkitab/src/main/res/values/strings.xml
@@ -490,6 +490,9 @@
Margins around text
Make text in a line narrower to ease reading
+ Bottom verse navigation
+ Put verse navigation toolbar at the bottom on the Bible screen
+
Reminder
Daily devotion
@@ -544,4 +547,8 @@
Commentary
+
+
+ Could not open the Bible Maps app.
+
diff --git a/Alkitab/src/main/res/values/themes.xml b/Alkitab/src/main/res/values/themes.xml
index 17ca0250b..2f686db46 100644
--- a/Alkitab/src/main/res/values/themes.xml
+++ b/Alkitab/src/main/res/values/themes.xml
@@ -20,12 +20,6 @@
- @color/window
-
-
-