[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Grand renaming: the sequel
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/374395 ) Change subject: Grand renaming: the sequel .. Grand renaming: the sequel Update to align with current mocks. Also updates both code and presentation so as not to refer to the comp date as a download date. Bug: T172546 Change-Id: Ib59e20475530112fd5f60610bc75fb8549ccec6f --- M app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java M app/src/main/java/org/wikipedia/page/Page.java M app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java M app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java M app/src/main/res/values-ar/strings.xml M app/src/main/res/values-ast/strings.xml M app/src/main/res/values-ca/strings.xml M app/src/main/res/values-da/strings.xml M app/src/main/res/values-de/strings.xml M app/src/main/res/values-es/strings.xml M app/src/main/res/values-eu/strings.xml M app/src/main/res/values-fa/strings.xml M app/src/main/res/values-fr/strings.xml M app/src/main/res/values-gl/strings.xml M app/src/main/res/values-hi/strings.xml M app/src/main/res/values-in/strings.xml M app/src/main/res/values-iw/strings.xml M app/src/main/res/values-jv/strings.xml M app/src/main/res/values-kab/strings.xml M app/src/main/res/values-ko/strings.xml M app/src/main/res/values-mk/strings.xml M app/src/main/res/values-ms/strings.xml M app/src/main/res/values-nb/strings.xml M app/src/main/res/values-nl/strings.xml M app/src/main/res/values-pt-rBR/strings.xml M app/src/main/res/values-qq/strings.xml M app/src/main/res/values-ru/strings.xml M app/src/main/res/values-sd/strings.xml M app/src/main/res/values-su/strings.xml M app/src/main/res/values-sv/strings.xml M app/src/main/res/values-zh-rTW/strings.xml M app/src/main/res/values-zh/strings.xml M app/src/main/res/values/strings.xml M app/src/main/res/values/strings_no_translate.xml 34 files changed, 42 insertions(+), 65 deletions(-) Approvals: Dbrant: Looks good to me, approved jenkins-bot: Verified diff --git a/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java b/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java index 0df6965..8049ac6 100644 --- a/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java +++ b/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java @@ -72,7 +72,7 @@ @NonNull final DialogInterface.OnClickListener onRemoveClick) { new AlertDialog.Builder(context) .setMessage(R.string.compilation_remove_confirm) -.setPositiveButton(R.string.compilation_remove_confirm_yes, new DialogInterface.OnClickListener() { +.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { remove(compilation); @@ -80,7 +80,7 @@ onRemoveClick.onClick(dialogInterface, i); } }) -.setNegativeButton(R.string.compilation_remove_confirm_no, null) +.setNegativeButton(android.R.string.no, null) .show(); } diff --git a/app/src/main/java/org/wikipedia/page/Page.java b/app/src/main/java/org/wikipedia/page/Page.java index 30836a7..77a11e6 100755 --- a/app/src/main/java/org/wikipedia/page/Page.java +++ b/app/src/main/java/org/wikipedia/page/Page.java @@ -4,9 +4,9 @@ import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; +import org.wikipedia.offline.Compilation; import org.wikipedia.settings.RbSwitch; -import java.util.Date; import java.util.List; /** @@ -20,7 +20,8 @@ @NonNull private final List sections; @NonNull private final PageProperties pageProperties; -@Nullable private Date compilationDownloadDate; +@Nullable private String compName; +@Nullable private long compTimestamp; /** * An indicator what payload version the page content was originally retrieved from. @@ -94,15 +95,20 @@ } public boolean isFromOfflineCompilation() { -return compilationDownloadDate != null; +return compName != null; } -@Nullable public Date getCompilationDownloadDate() { -return compilationDownloadDate; +@Nullable public long getCompilationTimestamp() { +return compTimestamp; } -public void setCompilationDownloadDate(@NonNull Date date) { -this.compilationDownloadDate = date; +@Nullable public String getCompilationName() { +return compName; +} + +public void setCompilation(@NonNull Compilation comp) { +this.compName = comp.name(); +this.compTimestamp = comp.timestamp(); } /** For old PHP API */ diff --git
[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Grand renaming: the sequel
Mholloway has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/374395 ) Change subject: Grand renaming: the sequel .. Grand renaming: the sequel Update to align with current mocks. Also updates both code and presentation so as not to refer to the comp date as a download date. Bug: T172546 Change-Id: Ib59e20475530112fd5f60610bc75fb8549ccec6f --- M app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java M app/src/main/java/org/wikipedia/page/Page.java M app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java M app/src/main/java/org/wikipedia/page/bottomcontent/BottomContentHandler.java M app/src/main/res/values-qq/strings.xml M app/src/main/res/values/strings.xml M app/src/main/res/values/strings_no_translate.xml 7 files changed, 42 insertions(+), 38 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/95/374395/1 diff --git a/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java b/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java index 0df6965..8049ac6 100644 --- a/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java +++ b/app/src/main/java/org/wikipedia/offline/DownloadManagerObserver.java @@ -72,7 +72,7 @@ @NonNull final DialogInterface.OnClickListener onRemoveClick) { new AlertDialog.Builder(context) .setMessage(R.string.compilation_remove_confirm) -.setPositiveButton(R.string.compilation_remove_confirm_yes, new DialogInterface.OnClickListener() { +.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { remove(compilation); @@ -80,7 +80,7 @@ onRemoveClick.onClick(dialogInterface, i); } }) -.setNegativeButton(R.string.compilation_remove_confirm_no, null) +.setNegativeButton(android.R.string.no, null) .show(); } diff --git a/app/src/main/java/org/wikipedia/page/Page.java b/app/src/main/java/org/wikipedia/page/Page.java index 30836a7..77a11e6 100755 --- a/app/src/main/java/org/wikipedia/page/Page.java +++ b/app/src/main/java/org/wikipedia/page/Page.java @@ -4,9 +4,9 @@ import android.support.annotation.Nullable; import android.support.annotation.VisibleForTesting; +import org.wikipedia.offline.Compilation; import org.wikipedia.settings.RbSwitch; -import java.util.Date; import java.util.List; /** @@ -20,7 +20,8 @@ @NonNull private final List sections; @NonNull private final PageProperties pageProperties; -@Nullable private Date compilationDownloadDate; +@Nullable private String compName; +@Nullable private long compTimestamp; /** * An indicator what payload version the page content was originally retrieved from. @@ -94,15 +95,20 @@ } public boolean isFromOfflineCompilation() { -return compilationDownloadDate != null; +return compName != null; } -@Nullable public Date getCompilationDownloadDate() { -return compilationDownloadDate; +@Nullable public long getCompilationTimestamp() { +return compTimestamp; } -public void setCompilationDownloadDate(@NonNull Date date) { -this.compilationDownloadDate = date; +@Nullable public String getCompilationName() { +return compName; +} + +public void setCompilation(@NonNull Compilation comp) { +this.compName = comp.name(); +this.compTimestamp = comp.timestamp(); } /** For old PHP API */ diff --git a/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java b/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java index ae22167..a299b47 100644 --- a/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java +++ b/app/src/main/java/org/wikipedia/page/PageFragmentLoadState.java @@ -58,7 +58,6 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; -import java.util.Date; import java.util.List; import java.util.Locale; import java.util.Map; @@ -480,8 +479,7 @@ sendMarginPayload(); OfflineManager.HtmlResult result = OfflineManager.instance() .getHtmlForTitle(model.getTitle().getDisplayText()); -Date downloadDate = new Date(result.compilation().timestamp()); -page.setCompilationDownloadDate(downloadDate); +page.setCompilation(result.compilation()); JSONObject zimPayload = setLeadSectionMetadata(new JSONObject(), page) .put("zimhtml", result.html()) .put("fromRestBase", false) @@ -499,7 +497,7 @@ //give it our