6 months agoUpdate DroidWiki app to latest code base master
Florian []
Update DroidWiki app to latest code base

Change-Id: Iddd0bceab9d6fc9841a5419ae17b65b091fe6e7e

10 months agoChange to article and script path
Florian []
Change to article and script path

Change-Id: Id12b3dd6abf7909175dc031c2c62cf1ec96fdcf5

15 months agoUpdate DroidWiki app to latest Wikipedia app code
Florian []
Update DroidWiki app to latest Wikipedia app code

Also reorganize code and hold copies of DroidWiki's own
resources.

Change-Id: I89654ba5e069d653466738b3e304795c170529f8

19 months agoMerge branch 'master' of ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia into upgrade/upstream upgrade/upstream
Florian Schmidt []
Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia into upgrade/upstream

Conflicts:
app/build.gradle
app/src/main/java/de/droidwiki/WikipediaApp.java
app/src/main/java/de/droidwiki/activity/ThemedActionBarActivity.java
app/src/main/java/de/droidwiki/views/CabSearchView.java
app/src/main/java/org/wikipedia/richtext/RichTextUtil.java
app/src/main/java/org/wikipedia/settings/SettingsActivity.java
app/src/main/java/org/wikipedia/settings/SettingsPreferenceLoader.java
app/src/main/res/layout/dialog_link_preview.xml
app/src/main/res/mipmap-hdpi/launcher.png
app/src/main/res/mipmap-mdpi/launcher.png
app/src/main/res/mipmap-xhdpi/launcher.png
app/src/main/res/mipmap-xxhdpi/launcher.png
app/src/main/res/mipmap-xxxhdpi/launcher.png
app/src/main/res/values-eu/strings.xml

Change-Id: Ia76f13ff8c5a509e432e8025fcaebca3371df8d3

19 months agoMerge "Promote lead image animation to production."
jenkins-bot []
Merge "Promote lead image animation to production."

19 months agoAdd a little more padding at the bottom of link previews.
Dmitry Brant []
Add a little more padding at the bottom of link previews.

...to make sure there's 16dp of space between the images and the
"Continue" button when the preview is pulled up fully.

Change-Id: I86f2828a2f271a8b27906f4798d47941cfab7339

19 months agoHygiene: make inner class static
Stephen Niedzielski []
Hygiene: make inner class static

Convert inner class, CabSearchView.PlainTextInputFilter, to a static
nested class and update comments. No functional changes intended.

Change-Id: Id77751d543f2c7b4483f98d6da04420e1d57ebaa

19 months agoPromote lead image animation to production.
Dmitry Brant []
Promote lead image animation to production.

(facepalm...)
Also, fillAfter is unnecessary for this animation.

Change-Id: I90c90b3b19c5294cf89bdbb8dbc0e80f01d708cd

19 months agoFix translation test
Stephen Niedzielski []
Fix translation test

Fix a bad format specifier.

Change-Id: Ia626f238dc80dc6519e014de769bbfed25d0f298

19 months agoLocalisation updates from https://translatewiki.net.
Translation updater bot []
Localisation updates from https://translatewiki.net.

Change-Id: Ia25af7f77a1ae8de35143230597ad54c151394d3

19 months agoMake separate list item colors for Light/Dark mode.
Dmitry Brant []
Make separate list item colors for Light/Dark mode.

In Dark mode, the default color of page titles was making them invisible
against the dark background.

Also, made the page title be ellipsize=end, since ellipsize=middle was not
working.

Bug: T116098
Bug: T114957
Change-Id: I6a451860d4f9dc857d670a433e4fb70d84be6886

19 months agoMake "continue to article" button overlay link preview (once again)
Michael Holloway []
Make "continue to article" button overlay link preview (once again)

Reverts the link preview to previous behavior in which the "continue to
article" button persists at the bottom of the screen while the link
preview is open.

Bug: T112997
Change-Id: Ib52d6d6cc9435a8d6f1a45996c1c0bd3a6f17843

19 months agoFix "add tab" icon for xxxhdpi.
Dmitry Brant []
Fix "add tab" icon for xxxhdpi.

This icon was not generated correctly by the rsvg tool, and looked weird.
We've observed this behavior before, where certain SVG images would not
render correctly by rsvg. Therefore I'm deleting the SVG file for this
icon, and instead using the pre-generated PNG files provided directly from
the Material icon set.

We should probably do this for other Material icons that we use, as well,
although the others look correctly-generated.

Change-Id: I87972f62f943a379a20928405fddf76408d310bb

19 months agoFix infinite loop in the webview's widen images logic
Daniel Rey []
Fix infinite loop in the webview's widen images logic

In the webview's Javascript code, the images from a page are stretched to
fit in the device's screen. When widening an image, a image URL of greater
resolution can be used instead to fit better with the new computed dimensions.
With this change, we make sure that after this logic takes place, it won't be called
again for the same image, which was provoking an infinite loop causing high
CPU usage.

Bug: T109983
Change-Id: I759297334cb7e0c32dc00cd71b300c9783ebf2af

19 months agoFix character repeating in search box
Stephen Niedzielski []
Fix character repeating in search box

Filtering out rich text from the search box mistakenly always replaced
the current input, often a character, with the entire text field's
string and removed compositional hints provided by some soft keyboards.
This patch replaces the appropriate field subsequence and preserves all
virtual keyboard hints.

Bug: T116091
Change-Id: I7223914005916adf2b97469cb779eb776a934377

19 months agoAdd xxxhdpi icons
Stephen Niedzielski []
Add xxxhdpi icons

Update convert-icons.py to produce xxxhdpi density assets and add them.
These assets increase the dev release apk from 4291780B to 4407296B,
about 113KiB.

Bug: T97239
Change-Id: Ia74610c2339807130bba8700e8e7b55f84778f52

19 months agoSearch input field no longer accepts pasted rich text
Daniel Rey []
Search input field no longer accepts pasted rich text

The search input field (both the "search page" and "search in page") no longer shows
styled text when is pasted (for example, the hyperlinks underlined and so on).

Bug: T97962
Change-Id: I43e6084c4b153564086599a442535073f50f07d4

19 months agoMerge "Make separate list item colors for Light/Dark mode."
jenkins-bot []
Merge "Make separate list item colors for Light/Dark mode."

19 months agoMerge "Make "continue to article" button overlay link preview (once again)"
jenkins-bot []
Merge "Make "continue to article" button overlay link preview (once again)"

19 months agoMake separate list item colors for Light/Dark mode.
Dmitry Brant []
Make separate list item colors for Light/Dark mode.

In Dark mode, the default color of page titles was making them invisible
against the dark background.

Also, made the page title be ellipsize=end, since ellipsize=middle was not
working.

Bug: T116098
Bug: T114957
Change-Id: I6a451860d4f9dc857d670a433e4fb70d84be6886

19 months agoMake "continue to article" button overlay link preview (once again)
Michael Holloway []
Make "continue to article" button overlay link preview (once again)

Reverts the link preview to previous behavior in which the "continue to
article" button persists at the bottom of the screen while the link
preview is open.

Bug: T112997
Change-Id: Ib52d6d6cc9435a8d6f1a45996c1c0bd3a6f17843

19 months agoMerge "Fix "add tab" icon for xxxhdpi."
jenkins-bot []
Merge "Fix "add tab" icon for xxxhdpi."

19 months agoMerge "Fix infinite loop in the webview's widen images logic"
jenkins-bot []
Merge "Fix infinite loop in the webview's widen images logic"

19 months agoFix "add tab" icon for xxxhdpi.
Dmitry Brant []
Fix "add tab" icon for xxxhdpi.

This icon was not generated correctly by the rsvg tool, and looked weird.
We've observed this behavior before, where certain SVG images would not
render correctly by rsvg. Therefore I'm deleting the SVG file for this
icon, and instead using the pre-generated PNG files provided directly from
the Material icon set.

We should probably do this for other Material icons that we use, as well,
although the others look correctly-generated.

Change-Id: I87972f62f943a379a20928405fddf76408d310bb

19 months agoFix character repeating in search box
Stephen Niedzielski []
Fix character repeating in search box

Filtering out rich text from the search box mistakenly always replaced
the current input, often a character, with the entire text field's
string and removed compositional hints provided by some soft keyboards.
This patch replaces the appropriate field subsequence and preserves all
virtual keyboard hints.

Bug: T116091
Change-Id: I7223914005916adf2b97469cb779eb776a934377

19 months agoFix infinite loop in the webview's widen images logic
Daniel Rey []
Fix infinite loop in the webview's widen images logic

In the webview's Javascript code, the images from a page are stretched to
fit in the device's screen. When widening an image, a image URL of greater
resolution can be used instead to fit better with the new computed dimensions.
With this change, we make sure that after this logic takes place, it won't be called
again for the same image, which was provoking an infinite loop causing high
CPU usage.

Bug: T109983
Change-Id: I759297334cb7e0c32dc00cd71b300c9783ebf2af

19 months agoRe-Add Google Analytics integration
Florian Schmidt []
Re-Add Google Analytics integration

Omitted in the first stage of rebasing to latest upstream master,
now re-added to the "old" locations.

Change-Id: I01b2e5d60f82e5afda25db38a94f09bf57e0421e

19 months agoUpgrade to latest master of upstream with a complete new rebase
Florian Schmidt []
Upgrade to latest master of upstream with a complete new rebase

Change-Id: I8037a3c1e140e9b34407852ec9f6be93b497b7a8

19 months agoFollow up upgrade from upstream
Florian Schmidt []
Follow up upgrade from upstream

Fix various merge errors, and re-add adjustments to the code we made
earlier.

Change-Id: I46d46c93047ede8407e776dd4183b0118350ab8f

19 months agoMerge "Add xxxhdpi icons"
jenkins-bot []
Merge "Add xxxhdpi icons"

19 months agoMerge "Search input field no longer accepts pasted rich text"
jenkins-bot []
Merge "Search input field no longer accepts pasted rich text"

19 months agoUpgrade Support libraries to v23.1.0
Stephen Niedzielski []
Upgrade Support libraries to v23.1.0

* Upgrade Support libraries to v23.1.0.
* Upgrade compiler and build tools to v23 and v23.0.1 as required by
libraries. Upgrading the target SDK should be a separate card as
additional work is necessary[0] although it is now permitted to
ship[1].
* Upgrade HockeyApp to v3.6.2 which supports API 23.
* Upgrade the Gradle plugin to v1.3.1 which supports useLibrary, needed
by HockeyApp.
* Side effect fix to disable misleading active state when tapping on the
navigation drawer header logo.
* Update JVM JUnit and Android instrumentation test tasks. These seem to
have unexpectedly changed.
* Remove WikipediaApp.getColor() which is now available in API 23 but is
regrettably marked final.
* Update ThemedActionBarActivity to allow for toolbar Activities as
related Window features appears to be unchangeable once set. Also,
move the gallery's full screen request to a theme where it should have
been. Finally, move the ContextThemeWrapper on
LanguagePreferenceDialog to the constructor and update the themes used
as the previous fix does not appear to work.
* Apply a workaround fix for NavigationView bug[2] introduced in the new
Design library.
* Update ProGuard rules to exclude the v7 Support libraries based on
experimentation.
* Update translation tests to exclude a new format string internal to
the Support library. In a future patch, it would be better to figure
out how to prune all library resources from the test.
* Remove FixedViewPager as the original appears to be fixed now.
* Add FloatMath as the original appears to have been removed from the
platform and is required by Mapbox.

Tested on the following devices:
- AOSP API 23 Nexus 5 emulator
- AOSP API 15 Nexus One emulator

[0] https://www.mediawiki.org/wiki/Notes_from_Google_I/O_15#Action_Items
[1] https://developer.android.com/preview/api-overview.html
[2] https://code.google.com/p/android/issues/detail?id=190226

Bug: T107890
Bug: T112310
Change-Id: Id6b73497eb6b15466cb3acc62567f48c09a358b3

19 months agoSearch input field no longer accepts pasted rich text
Daniel Rey []
Search input field no longer accepts pasted rich text

The search input field (both the "search page" and "search in page") no longer shows
styled text when is pasted (for example, the hyperlinks underlined and so on).

Bug: T97962
Change-Id: I43e6084c4b153564086599a442535073f50f07d4

19 months agoMove the app launcher icons to the mipmap-{density} folder structure
Daniel Rey []
Move the app launcher icons to the mipmap-{density} folder structure

The new convention to store the launcher icon of an android app is to use
the res/mipmap-{...} folders (for example, res/mipmap-xhdpi/launcher.png,
res/mipmap-xxhdpi/launcher.png, and so on). The images in those directories
won't be erased by the most common APK optimization tools (those tools usually
generate a different APK for each display density, and so they remove all the
images under res/drawable-{...} with a density different than the specified).
Since launcher icons can be displayed at a different density than the
device density, it's best practice to put them into the mipmap directories.

Bug: T97239
Change-Id: Iac1bff9e808a41a6b82eb6d97968365c2842a3f0

19 months agoMerge branch 'master' of ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
Florian Schmidt []
Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia

Conflicts:
app/build.gradle
app/proguard-rules.pro
app/src/androidTest/java/de/droidwiki/test/FetchUserContribsTaskTest.java
app/src/main/AndroidManifest.xml
app/src/main/assets/bundle.js
app/src/main/assets/preview.js
app/src/main/java/de/droidwiki/Utils.java
app/src/main/java/de/droidwiki/ViewAnimations.java
app/src/main/java/de/droidwiki/WikipediaApp.java
app/src/main/java/de/droidwiki/alphaupdater/AlphaUpdateChecker.java
app/src/main/java/de/droidwiki/analytics/LinkPreviewFunnel.java
app/src/main/java/de/droidwiki/concurrency/AsyncTask.java
app/src/main/java/de/droidwiki/concurrency/SaneAsyncTask.java
app/src/main/java/de/droidwiki/data/TabUnmarshaller.java
app/src/main/java/de/droidwiki/editing/EditPreviewFragment.java
app/src/main/java/de/droidwiki/editing/EditSectionActivity.java
app/src/main/java/de/droidwiki/editing/summaries/EditSummaryHandler.java
app/src/main/java/de/droidwiki/history/HistoryFragment.java
app/src/main/java/de/droidwiki/interlanguage/AppLanguageLookUpTable.java
app/src/main/java/de/droidwiki/interlanguage/AppLanguageState.java
app/src/main/java/de/droidwiki/interlanguage/LangLinksActivity.java
app/src/main/java/de/droidwiki/nearby/NearbyFragment.java
app/src/main/java/de/droidwiki/page/DisambigListAdapter.java
app/src/main/java/de/droidwiki/page/JsonPageLoadStrategy.java
app/src/main/java/de/droidwiki/page/NavDrawerHelper.java
app/src/main/java/de/droidwiki/page/Page.java
app/src/main/java/de/droidwiki/page/PageActivity.java
app/src/main/java/de/droidwiki/page/PageFragment.java
app/src/main/java/de/droidwiki/page/ToCHandler.java
app/src/main/java/de/droidwiki/page/bottomcontent/BottomContentHandler.java
app/src/main/java/de/droidwiki/page/gallery/GalleryActivity.java
app/src/main/java/de/droidwiki/page/gallery/GalleryItemFragment.java
app/src/main/java/de/droidwiki/page/leadimages/ImageViewWithFace.java
app/src/main/java/de/droidwiki/page/leadimages/LeadImagesHandler.java
app/src/main/java/de/droidwiki/page/linkpreview/LinkPreviewContents.java
app/src/main/java/de/droidwiki/page/linkpreview/LinkPreviewDialog.java
app/src/main/java/de/droidwiki/page/linkpreview/SwipeableBottomDialog.java
app/src/main/java/de/droidwiki/page/snippet/ShareHandler.java
app/src/main/java/de/droidwiki/page/tabs/TabsProvider.java
app/src/main/java/de/droidwiki/pagehistory/PageHistoryItem.java
app/src/main/java/de/droidwiki/pagehistory/usercontributions/FetchUserContribsTask.java
app/src/main/java/de/droidwiki/pagehistory/usercontributions/UserContribsActivity.java
app/src/main/java/de/droidwiki/random/RandomHandler.java
app/src/main/java/de/droidwiki/savedpages/SavedPagePersistenceHelper.java
app/src/main/java/de/droidwiki/savedpages/SavedPagesFragment.java
app/src/main/java/de/droidwiki/search/SearchArticlesFragment.java
app/src/main/java/de/droidwiki/search/SearchBarHideHandler.java
app/src/main/java/de/droidwiki/search/SearchResultsFragment.java
app/src/main/java/de/droidwiki/settings/DeveloperSettingsActivityGB.java
app/src/main/java/de/droidwiki/settings/DeveloperSettingsPreferenceLoader.java
app/src/main/java/de/droidwiki/settings/LegacyPreferenceActivity.java
app/src/main/java/de/droidwiki/settings/PreferenceHostCompat.java
app/src/main/java/de/droidwiki/settings/SettingsActivityGB.java
app/src/main/java/de/droidwiki/settings/SettingsFragment.java
app/src/main/java/de/droidwiki/settings/SettingsPreferenceLoader.java
app/src/main/java/de/droidwiki/theme/ThemeChooserDialog.java
app/src/main/java/de/droidwiki/util/L10nUtils.java
app/src/main/java/de/droidwiki/util/ShareUtils.java
app/src/main/java/de/droidwiki/views/CabSearchView.java
app/src/main/java/de/droidwiki/views/PasswordTextInput.java
app/src/main/java/de/droidwiki/views/PlainPasteEditText.java
app/src/main/java/de/droidwiki/wikidata/GetDescriptionsTask.java
app/src/main/java/org/wikipedia/server/PageLeadProperties.java
app/src/main/java/org/wikipedia/server/PageServiceFactory.java
app/src/main/java/org/wikipedia/server/mwapi/MwPageLead.java
app/src/main/java/org/wikipedia/server/mwapi/MwPageService.java
app/src/main/java/org/wikipedia/server/restbase/RbPageLead.java
app/src/main/java/org/wikipedia/server/restbase/RbPageService.java
app/src/main/java/org/wikipedia/settings/LanguagePreferenceDialog.java
app/src/main/java/org/wikipedia/settings/Prefs.java
app/src/main/java/org/wikipedia/settings/SettingsActivity.java
app/src/main/res/layout/activity_langlinks.xml
app/src/main/res/layout/activity_page.xml
app/src/main/res/layout/dialog_preference_languages.xml
app/src/main/res/layout/fragment_page.xml
app/src/main/res/layout/inflate_header_nav_drawer.xml
app/src/main/res/menu/menu_nav_drawer.xml
app/src/main/res/values-af/strings.xml
app/src/main/res/values-ak/strings.xml
app/src/main/res/values-ar/strings.xml
app/src/main/res/values-as/strings.xml
app/src/main/res/values-bn/strings.xml
app/src/main/res/values-br/strings.xml
app/src/main/res/values-ca/strings.xml
app/src/main/res/values-cs/strings.xml
app/src/main/res/values-cu/strings.xml
app/src/main/res/values-da/strings.xml
app/src/main/res/values-de/strings.xml
app/src/main/res/values-el/strings.xml
app/src/main/res/values-eo/strings.xml
app/src/main/res/values-es/strings.xml
app/src/main/res/values-et/strings.xml
app/src/main/res/values-eu/strings.xml
app/src/main/res/values-fa/strings.xml
app/src/main/res/values-fi/strings.xml
app/src/main/res/values-fo/strings.xml
app/src/main/res/values-fr/strings.xml
app/src/main/res/values-gl/strings.xml
app/src/main/res/values-gu/strings.xml
app/src/main/res/values-hu/strings.xml
app/src/main/res/values-ia/strings.xml
app/src/main/res/values-in/strings.xml
app/src/main/res/values-it/strings.xml
app/src/main/res/values-iw/strings.xml
app/src/main/res/values-ja/strings.xml
app/src/main/res/values-ji/strings.xml
app/src/main/res/values-ko/strings.xml
app/src/main/res/values-kw/strings.xml
app/src/main/res/values-ky/strings.xml
app/src/main/res/values-lb/strings.xml
app/src/main/res/values-lt/strings.xml
app/src/main/res/values-mk/strings.xml
app/src/main/res/values-ml/strings.xml
app/src/main/res/values-mn/strings.xml
app/src/main/res/values-mr/strings.xml
app/src/main/res/values-ms/strings.xml
app/src/main/res/values-nb/strings.xml
app/src/main/res/values-nl/strings.xml
app/src/main/res/values-pa/strings.xml
app/src/main/res/values-pl/strings.xml
app/src/main/res/values-ps/strings.xml
app/src/main/res/values-pt-rBR/strings.xml
app/src/main/res/values-pt/strings.xml
app/src/main/res/values-qq/strings.xml
app/src/main/res/values-ro/strings.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values-sk/strings.xml
app/src/main/res/values-sr/strings.xml
app/src/main/res/values-sv/strings.xml
app/src/main/res/values-sw/strings.xml
app/src/main/res/values-ta/strings.xml
app/src/main/res/values-te/strings.xml
app/src/main/res/values-th/strings.xml
app/src/main/res/values-tl/strings.xml
app/src/main/res/values-tr/strings.xml
app/src/main/res/values-uk/strings.xml
app/src/main/res/values-vi/strings.xml
app/src/main/res/values-zh-rTW/strings.xml
app/src/main/res/values-zh/strings.xml
app/src/main/res/values/credits.xml
app/src/main/res/values/dev_settings_strings.xml
app/src/main/res/values/preference_keys.xml
app/src/main/res/values/strings-no-translate.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/developer_preferences.xml
app/src/main/res/xml/preferences.xml
www/Gruntfile.js
www/js/sections.js
www/js/transforms.js
www/js/transforms/collapseTables.js
www/js/transforms/relocateFirstParagraph.js
www/js/transforms/setNonGbDivWidth.js

Change-Id: Id87166e163d5bbebe912454821a23a8a5d8b28d1

19 months agoRevert "Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia"
Florian Schmidt []
Revert "Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia"

This reverts commit 219bc248b74873730fbac00ec13bfe2bd3d860f6, reversing
changes made to 4d1d77c9213857745d261b07ec617894e51ccea5.

19 months agoAdd xxxhdpi icons
Stephen Niedzielski []
Add xxxhdpi icons

Update convert-icons.py to produce xxxhdpi density assets and add them.
These assets increase the dev release apk from 4291780B to 4407296B,
about 113KiB.

Bug: T97239
Change-Id: Ia74610c2339807130bba8700e8e7b55f84778f52

19 months agoMerge "Update license description handling"
jenkins-bot []
Merge "Update license description handling"

19 months agoUpdate license description handling
Michael Holloway []
Update license description handling

-Added a showMessageAsPlainText function to FeedbackUtil to strip HTML
markup from string before displaying to the user

-Show license description in a Snackbar instead of a Toast

-Invert the behavior so that a regular click shows the license description
summary in a snackbar, and a long click fires a chooser to visit the
license info page in an external browser

Bug: T110946
Change-Id: Ic81704892e677af03ef01fd9dabdfd6fa54c329b

19 months agoLocalisation updates from https://translatewiki.net.
Stephen Niedzielski []
Localisation updates from https://translatewiki.net.

Change-Id: Id68f654ce1262850f1b0961b869c4ea23753b828

19 months agoMerge "Tweak list items to adhere to material design"
jenkins-bot []
Merge "Tweak list items to adhere to material design"

19 months agoDon't obfuscate release builds
Stephen Niedzielski []
Don't obfuscate release builds

Disable ProGuard code obfuscation[0] (but not minification). We do not
care about making the apk code unreadable[1].

[0] http://proguard.sourceforge.net/manual/usage.html#obfuscationoptions
[1] https://gerrit.wikimedia.org/r/#/c/227393/

Change-Id: I1e9b9122828c8325fbe34e3b7554d4aa185e29dd

19 months agoTweak list items to adhere to material design
Michael Holloway []
Tweak list items to adhere to material design

As described in...

Bug: T114842
Change-Id: Id8096b8b499a1a5061a7d0348968b34fd20c5f68

19 months agoMerge "Replace ACRA with HockeyApp"
jenkins-bot []
Merge "Replace ACRA with HockeyApp"

19 months agoMerge "Activate progress bar while fetching random article"
jenkins-bot []
Merge "Activate progress bar while fetching random article"

19 months agoReplace ACRA with HockeyApp
Stephen Niedzielski []
Replace ACRA with HockeyApp

* Replace ACRA with HockeyApp v3.5.0. This change was made as ACRA
doesn't offer in itself a freestanding backend or quiet automatic
reporting, and doesn't support Marshmallow yet[0]. However, we will
investigate a self-hosted Acralyzer installation in the future.

HockeyApp doesn't seem to offer custom properties, so these are
bundled as JSON in the report description. Since these properties are
not associated with a crash instance and not preserved across
application death, and crashes may enqueue, it's possible they may be
inaccurate. However, these properties are used in one place presently
and the current implementation _should_ be adequate.

The ProGuard rules were updated for HockeyApp from this document[1]
and a little guesswork.

HockeyApp v3.5.0 seems to be incompatible with Marshmallow just like
ACRA. v3.6.0-b.1 appears to work fine. The upgrade will be made in a
subsequent patch with related changes.

The change in APK size is ~13 KiB. More specifically, the release
application was 3825548 B previously and 3838973 B after, increasing
by 13425 B.

Crash reporting was verified on dev debug, and alpha, beta, and prod
release configurations on API 15:

gradlew clean installDevDebug installAlphaRelease installBetaRelease installProdRelease

Smoke test crash reporting was verified with HockeyApp v3.6.0-b.1 on
Marshamallow (with changes coming in a subsequent patch).

A future patch may replace alpha distribution with HockeyApp.

* Add remote logger to L in the form of logRemoteErrorIfProd(Throwable).
This is meant to coincide with cludge fixes where the error path is
not understood. This is done via a helper Exception,
RemoteLogException, which supplies an accurate stacktrace by forcing
creation at the point of logging. In the event that a build is non-
production, L will throw the Throwable, causing the app to crash. The
thinking was that if it's worth burning user data and engineering
parsing time, it's worth crashing on everything but prod. A new UI was
added to dev settings to test this functionality, save the non-prod
crash bit.

Also replace Exception logging functions with Throwables and fix no
message overloads to print an empty string instead of null for their
messages.

* Rename acra_report_dialog_title and acra_report_dialog_text to
crash_report_dialog_title and crash_report_dialog_text. Remove
acra_report_dialog_comment Strings as in-app feedback was removed:

find -name strings.xml|
xargs -rd\\n sed -ri '/<string name="acra_report_dialog_comment"[^>]*>[^<]*<\/string>/d'

* Extremely light refactoring of PreferenceLoader and related classes to
expose the host Activity, needed by HockeyApp, and a
findPreference(int) overload that accepts a key String resource ID.

* Replace the crash test NullPointerException with a dummy
TestException.

[0] https://github.com/ACRA/acra/issues/287
[1] http://support.hockeyapp.net/kb/client-integration-android/hockeyapp-and-proguard

Bug: T108420
Change-Id: Ia3b687daf5d5273520569ca60b6b04237cf7fd8d

19 months agoMerge "Hygiene: remove unnecessary cruft from JavaScript bridge."
jenkins-bot []
Merge "Hygiene: remove unnecessary cruft from JavaScript bridge."

19 months agoMerge "Hygiene: consolidate no-translate strings"
jenkins-bot []
Merge "Hygiene: consolidate no-translate strings"

19 months agoHygiene: remove unnecessary cruft from JavaScript bridge.
Dmitry Brant []
Hygiene: remove unnecessary cruft from JavaScript bridge.

- Removed API 10-specific file.
- Removed test-specific functions from the main Bundle.

Change-Id: I5213841eb4e26117cb0099434a86f3ac2cd4c383

19 months agoMerge "Replace contextual action bar menu on text select"
jenkins-bot []
Merge "Replace contextual action bar menu on text select"

19 months agoMerge "Hygiene: refactor displayLeadSection()"
jenkins-bot []
Merge "Hygiene: refactor displayLeadSection()"

19 months agoReplace contextual action bar menu on text select
Stephen Niedzielski []
Replace contextual action bar menu on text select

The contextual action bar menu (CAB) appears differently across devices.
We think it's probably simplest to replace it with our menu every time,
no matter the device, for a consistent experience.

This patch does not address API 23 concerns[0] around the new floaty
CAB nor the text selection bug[1] on API 15.

[0] https://www.mediawiki.org/wiki/Notes_from_Google_I/O_15#Soon
[1] https://phabricator.wikimedia.org/T115516

Bug: T107298
Bug: T109346
Change-Id: Ib0a80cfe80a1baa57a3dfb370f49b442ddefae81

19 months agoNo longer do the spinny-arrow animation on the hamburger icon.
Dmitry Brant []
No longer do the spinny-arrow animation on the hamburger icon.

This is no longer done in Google apps, and will make us more consistent
with their design guidelines.

Bug: T97465
Change-Id: Ie230c74ce8839e341f6b65af7724cee2cbe15b7c

19 months agoActivate progress bar while fetching random article
Michael Holloway []
Activate progress bar while fetching random article

-Added updateProgressBar() method to RandomHandler

-Refactored RandomHandler.setState() (which sets menu item enabled state)
to more descriptive and straightforward setMenuItemEnabled()

-Removed unused items from RandomHandler

Bug: T107791
Change-Id: Ia87b40cf9f07f3d9e605ce28aa18337accb221a1

19 months agoHygiene: consolidate no-translate strings
Stephen Niedzielski []
Hygiene: consolidate no-translate strings

* Rename strings-no-translate.xml to strings_no_translate.xml.
snake_case is used for all other resources.
* Replace app_name.xml and channel.xml with strings_no_translate.xml.
These files came before strings_no_translate.xml and are unworthy of
the distinction.

Change-Id: I23b5fc44e0703aab1b8b0f709f8608e286cbf071

19 months agoMerge "Update icon for use in notifications."
jenkins-bot []
Merge "Update icon for use in notifications."

19 months agoMerge "Fix page thumbnail caching, for real."
jenkins-bot []
Merge "Fix page thumbnail caching, for real."

19 months agoFix page thumbnail caching, for real.
Dmitry Brant []
Fix page thumbnail caching, for real.

The PageTitle object in the "model" variable wasn't being updated
correctly after the PageLead interface constructs the Page.

Bug: T115412
Change-Id: I82b8ce1e1dfaaa1eab3d1b1a26e03c63a87b85a9

19 months agoUpdate icon for use in notifications.
Dmitry Brant []
Update icon for use in notifications.

The icon is now a white square with a transparent W cut out of it, which
is compliant with the visual requirements of notifications under Lollipop
and higher.

Bug: T114890
Change-Id: I191e4690e818c79c16b4c34269ba5048ccc400ff

19 months agoHygiene: refactor displayLeadSection()
Stephen Niedzielski []
Hygiene: refactor displayLeadSection()

JsonPageLoadStrategy.displayLeadSection() was large and cumbersome. This
patch divides the method into several concerned methods. No functional
changes intended.

Change-Id: I58f8f6ab3922d56d6d0f13ea8b9153a7e898caac

19 months agoHygiene: remove unused string resource
Stephen Niedzielski []
Hygiene: remove unused string resource

Remove unused string resource as reported by Android Lint.

Change-Id: I97e02917d75f4ab6833e9c87b253068bb764946a

19 months agoMerge "Revive the session funnel."
jenkins-bot []
Merge "Revive the session funnel."

19 months agoMerge "Prevent lead paragraph shifting from leaving connected content behind"
jenkins-bot []
Merge "Prevent lead paragraph shifting from leaving connected content behind"

19 months agoRevive the session funnel.
Dmitry Brant []
Revive the session funnel.

- Re-enabled the session funnel, to be sampled at 1:100 in production and
1:1 in non-production.
- Updated the funnel to record the number of pages viewed during a
session, categorized by source.
- Added a new source, to represent pages viewed from the disambiguation
list (Similar pages).
- The funnel now also records the average latency of the lead section
request and the rest-of-sections request over the network. It also
records whether the request is done via the MediaWiki API, or the new
content service.
- Added a developer preference to set the length of a session for testing
purposes (default is 30 minutes).

Bug: T111541
Change-Id: I600b00c2868a6922c1a0e02c86826e146a8dc2cb

19 months agoLocalisation updates from https://translatewiki.net.
Translation updater bot []
Localisation updates from https://translatewiki.net.

Change-Id: Ia9edc472fa84a7a1410efecb4645a0b4b05d9371

19 months agoPrevent lead paragraph shifting from leaving connected content behind
Michael Holloway []
Prevent lead paragraph shifting from leaving connected content behind

This patch updates the lead paragraph shifting logic to create a span
consisting of the first qualifying <p> element encountered and any
subsequent non-<p> elements until the next <p> is encountered.

Simply moving the first <p> element up, as we did before, may result in
elements appearing between the first paragraph as designated by
<p></p> tags and other elements (such as an unnumbered list) that may be
intended as part of the first display paragraph.

Bug: T111958
Change-Id: I41f2b16f9b5d8fcac7bef156a3f3726d7bfe36d0

19 months agoMerge "L10npalooza! Make various UI elements consistent with the article language"
jenkins-bot []
Merge "L10npalooza! Make various UI elements consistent with the article language"

19 months agoMerge "Resolve protocol-relative license URLs before passing for external handling"
jenkins-bot []
Merge "Resolve protocol-relative license URLs before passing for external handling"

19 months agoMerge "Add preference to show link previews."
jenkins-bot []
Merge "Add preference to show link previews."

19 months agoLocalisation updates from https://translatewiki.net.
Stephen Niedzielski []
Localisation updates from https://translatewiki.net.

Change-Id: Iaf9d75a4e34a80135b1aedd2dd1bde4abc326c80

19 months agoAdd preference to show link previews.
dbrant []
Add preference to show link previews.

- Added a preference.
- Updated the schema to have an additional "action" that represents
clicking links in a disabled state.
https://meta.wikimedia.org/wiki/Schema:MobileWikiAppLinkPreview

Bug: T114495
Change-Id: I625ea7155b2fa0245ded762046219ed9d9e9e40f

19 months agoResolve protocol-relative license URLs before passing for external handling
Michael Holloway []
Resolve protocol-relative license URLs before passing for external handling

A file's license URL field will sometimes contain a protocol-relative
URL pointing to an on-wiki File: page describing the terms of our use,
particularly in the case of copyrighted media presented under terms of
fair use.

This adds a call to NetworkUtils.resolveProtocolRelativeUrl before
passing them to the system so that it knows how to handle them.

Also refactored the external link handler in GalleryActivity to use
NetworkUtils.resolveProtocolRelativeUrl rather than repeating ourselves.

Bug: T110946
Change-Id: Icfe96b39ddd7e80a37d31626e03949e064fe1f0c

19 months agoL10npalooza! Make various UI elements consistent with the article language
Michael Holloway []
L10npalooza! Make various UI elements consistent with the article language

* Localize the 'Read More' section header and TOC entry to match the
article language when setting them on their respective components.

* Localize 'Similar pages', 'Page issues', 'Quick facts' and 'More
information' to the article language before sending them over the
bridge.

* Correctly align page titles and descriptions based on language.

* Correctly align the table of contents based on language.

* Correctly align and localize link preview contents based on language.

* Create new RtlAwareTextView and RtlAwareListView classes to assist in
the above.

* Move L10n utils from Utils to L10nUtils (there may be room for
for additional refactoring in this area in a separate patch; there
seem to be unwarranted assumptions in play about text in native
components matching the default locale for the device).

Bug: T109385
Bug: T111585
Change-Id: I24af0963b3c34fb4a5def426ae1eaec611c2407d

19 months agoMerge "Beta: turn on/off RB service remotely plus fallback"
jenkins-bot []
Merge "Beta: turn on/off RB service remotely plus fallback"

19 months agoMerge "Improve appearance and consistency of language selection interfaces."
jenkins-bot []
Merge "Improve appearance and consistency of language selection interfaces."

19 months agoFix toolbar background
Stephen Niedzielski []
Fix toolbar background

Fix regression in 3e91f1d where the toolbar background was incorrect for
many articles. The fix was to simplify the state of
SearchBarHideHandler.

Bug: T114800

Change-Id: I7c7d0e7718c91a74cc9570fd1ebdb06a768d6625

19 months agoImprove appearance and consistency of language selection interfaces.
Dmitry Brant []
Improve appearance and consistency of language selection interfaces.

- Now using the same list item layout for wiki language selection and
article language selection. Deleted the now-unused layout
"simple_list_item_activated_2", which was using the deprecated
TwoLineListItem anyway.
- Use TextInputLayout for the "search" fields, which looks more Material
and consistent with other places where we have text input.
- In the interlanguage activity, use our generic WikiErrorView, which
encapsulates showing of any errors encountered when fetching article
titles.

Bug: T114844
Change-Id: I3e880463c698e76c1725f52c359cbaf1dacd653e

19 months agoBeta: turn on/off RB service remotely plus fallback
bearND []
Beta: turn on/off RB service remotely plus fallback

You can still manually turn on/off RESTBase usage via developer settings.
The roll-out is initially only for the beta app.
The remote config has a percentage of beta app installs which
get to use our RESTBase endpoints for loading page content automatically.

If there is a significant failure it will fall back to using MW API
for the next 100 page loads.
After that it tries again to use RB until there is another RB failure and so on.

Change-Id: Ic189223ebb47f944e8bb80a6b1ec4d6aa98eaed5

19 months agoMerge "Display notification on image save"
jenkins-bot []
Merge "Display notification on image save"

19 months agoDisplay notification on image save
Michael Holloway []
Display notification on image save

This patch adds a system notification displayed to the user when an
image is saved from the gallery. When the main body of the notification
is clicked, it opens the image in the default image viewing application.
When the 'share' button attached to the notification is clicked, a chooser
is displayed for the user to choose an application for sharing.

The Intent to share the image is sent with the image's filename and a link
to a file page with extended information on the image, including license
information.

Bug: T104529
Change-Id: Iea2f133f21190cc2142186df5ad7722383ad473a

19 months agoMake "use system language" implied
Stephen Niedzielski []
Make "use system language" implied

In the interest of avoiding extra finger work and more sophisticated UI,
remove the system language switch and implicitly enable or disable "use
system language" according to the app language entry selected and
the actual system language.

This change might cause confusion for a very small percentage of use
cases. For example, if the user picks Japanese and that language happens
to be the system language, the app language will be implicitly set to
follow the system language, indicated by the special language key value
of null. If the user then leaves the app and changes the system language
to Russian and reenters the app, they're either pleased to see that the
app language automatically updated to Russian without having to wonder
what "system language" meant in the first place OR they're confused and
reset the app language to Japanese again. Thereafter, they never have to
reset the app language even if they change the system language. The
first step is actually unnecessary to arrive at this dilemma since the
initial language is the system language. Despite this potential
confusion, we believe this change will provide the best experience for
most users.

Additional related changes:
* Always return the English language canonical name in
AppLanguageState.getAppLanguageCanonicalName(). It was a bug to return
a localized form.
* Add StringUtil.equals() for safe comparison of null Strings.
* Add some missing @NonNull / @Nullable annotations.
* Remove unused string resources.
* Remove some unused methods.
* Update some comments.

Bug: T113097
Bug: T112978
Change-Id: Ia86010b30a7a0976ba9f4a8349616ba495bbf287

19 months agoMerge "Enable hardware accelerated rendering for WebView"
jenkins-bot []
Merge "Enable hardware accelerated rendering for WebView"

19 months agoMerge "Fix Exception when sharing a fact"
jenkins-bot []
Merge "Fix Exception when sharing a fact"

19 months agoMerge "Hygiene: clean up color code hex syntax"
jenkins-bot []
Merge "Hygiene: clean up color code hex syntax"

19 months agoMerge "Fix tab overview animations on orientation change"
jenkins-bot []
Merge "Fix tab overview animations on orientation change"

19 months agoEnable hardware accelerated rendering for WebView
Stephen Niedzielski []
Enable hardware accelerated rendering for WebView

Improve animation performance of the WebView by enabling hardware
acceleration[0]. This is not enabled for the app as a whole, as it is an
optimization that may cause rendering issues[1].

[0] https://developer.android.com/reference/android/view/View.html#LAYER_TYPE_HARDWARE
[1] http://developer.android.com/guide/topics/graphics/hardware-accel.html

Bug: T114373
Change-Id: I95f01f2b61ee5a247e8ca27c16b91d9b4e184d8a

19 months agoFix Exception when sharing a fact
Stephen Niedzielski []
Fix Exception when sharing a fact

This patch is a partial revert of 3235488. ImageView may recycle its
Drawable. A reference cannot be held so a deep copy is needed.

Bug: T114658
Change-Id: I0a8802e2c6d9b81a85a4f7bdd7506067c4ab88e2

19 months agoHygiene: clean up color code hex syntax
Stephen Niedzielski []
Hygiene: clean up color code hex syntax

* Remove redundant explicit full alpha values.
* Unify the casing to lowercase:

sed -ri 's%(#[0-9A-F]+)%\L\1%' app/src/main/res/values/colors.xml

* Replace colors with short form where possible.

Change-Id: I6f1a26e640bb4a598b9f12e973de6be0cc875d54

19 months agoDisable link preview invisible spacer highlight
Stephen Niedzielski []
Disable link preview invisible spacer highlight

Link previews use a ListView and some invisible spacer views which
shouldn't be selectable. Prior to this patch, the selector Drawable was
set to @null which seems like it should work. However, on the AOSP API
15 Nexus One emulator, they don't. Opening link previews and pressing
carriage return makes the whole screen orange. This patch just replaces
@null with a completely transparent ColorDrawable.

Change-Id: Ib56926ae0e48f44b2f4f4c4f69503be70c09d870

19 months agoFix tab overview animations on orientation change
Stephen Niedzielski []
Fix tab overview animations on orientation change

* Add TabsProvider.onConfigurationChanged() method like View. Set a
layout listener to recalculate and invalidate animations on
orientation change.
* Add utility function, ViewUtil.setAnimationMatrix().
* TabsProvider refactoring (no functional changes intended):
* Move public interface, TabsProviderListener, to the top of the class
so clients can find it quickly.
* Name tabActionMode != null expression as method, isTabMode().
* Extract methods from AnimationUtils.loadAnimation() calls to
loadPageContentViewAnimation() and loadTabListViewAnimation().
* Extract method, setTabListViewLayoutParams(), from layoutTabList().

Bug: T112975
Change-Id: I0298effec4bfb3ced4ce0a8466c56a2206cd5f09

19 months agoLocalisation updates from https://translatewiki.net.
Stephen Niedzielski []
Localisation updates from https://translatewiki.net.

Change-Id: I81a4839b4c9fe6230ec68cbcf2d309f7ef7390c4

19 months agoRename nav menu "More" item to "Settings"
Michael Holloway []
Rename nav menu "More" item to "Settings"

Bug: T108532
Change-Id: I9f1cc1cd47518a835c4a121ed35e306ed3df0ff1

19 months agoLocalisation updates from https://translatewiki.net.
Stephen Niedzielski []
Localisation updates from https://translatewiki.net.

Change-Id: I1f986d8e45a7104905dea91dc47fe75bfe25b931

19 months agoMerge "Hygiene: remove unused resources"
jenkins-bot []
Merge "Hygiene: remove unused resources"

19 months agoMerge "Update link preview dimensions on rotation"
jenkins-bot []
Merge "Update link preview dimensions on rotation"

19 months agoHygiene: remove unused resources
Stephen Niedzielski []
Hygiene: remove unused resources

Remove unused resources and, where applicable, their originals, as
identified by Android Lint.

Change-Id: Idb393ebd5e01d3e1091fa6722134fb462144c875

19 months agoMerge "Hygiene: remove code for unsupported old devices"
jenkins-bot []
Merge "Hygiene: remove code for unsupported old devices"

19 months agoLocalisation updates from https://translatewiki.net.
Stephen Niedzielski []
Localisation updates from https://translatewiki.net.

Change-Id: Iecdb130611fc1e1104431988a81cdd0f1d95775f

19 months agoHygiene: remove code for unsupported old devices
Stephen Niedzielski []
Hygiene: remove code for unsupported old devices

minSdkVersion was recently advanced to 15 which left a lot of dead code
for legacy devices. This patch removes all code, libraries, and
resources targeting API 14- that are no longer used.
Id6b73497eb6b15466cb3acc62567f48c09a358b3 upgrades library dependencies.

Bug: T112310
Change-Id: Id494b7fa3a11ae14a62503b5645dc7e745ea0cf0

19 months agoMerge "Hygiene: make a couple margins RTL aware"
jenkins-bot []
Merge "Hygiene: make a couple margins RTL aware"