[go: nahoru, domu]

Skip to content

Commit

Permalink
Squashed 'libs/utils/' changes from c611f1e..c2484a2
Browse files Browse the repository at this point in the history
c2484a2 bump version to 1.10.0
2f7330c gradle wrapper now uses gradle v2.11
755e012 new MediaUtils function: getImageWidthSettingFromString
9a1e358 Merge commit '961a76c0bc931c3a484640f9fb1e3d6f7877857b' into hotfix/5.4.1
961a76c Squashed 'libs/editor/' changes from fa030e4..10ae495
4d4a62d Merge commit '5da21eda6aa762a51acc7f29263ea5b6e42b3cd2' into release/5.4
5da21ed Squashed 'libs/editor/' changes from 31b66df..fa030e4
89dc10d Clarify comments and parameter names
924cafd fix #4114: remove the URL scheme if it's not http or https during URL sanitization
ce16255 Merge branch 'develop' into feature/gravatar-upload-okhttp
3b37573 Squashed 'libs/editor/' changes from 0b74389..31b66df
4542685 Squashed 'libs/editor/' changes from 8818dd1..0b74389
9907504 Squashed 'libs/editor/' changes from 17887d3..8818dd1
62c0633 Updating gradle plugin to 2.1.0 for Android Studio 2.1.0
ac1a4af Squashed 'libs/editor/' changes from abfcce5..17887d3
d421635 Adds permission utils for calling via fragments
be4aac0 Squashed 'libs/editor/' changes from 72933eb..abfcce5
57027fd Merge commit 'c0f0848c74ef959fa90d150ae3cf93259c3fd08e' into develop
c0f0848 Squashed 'libs/editor/' changes from 7be0b57..72933eb
52910dd Squashed 'libs/editor/' changes from 41a1010..7be0b57
d2f7ed4 Squashed 'libs/editor/' changes from 0f6fba8..41a1010
31b7405 Updating to gradle 2.0
556b07f Updating to rc3
c5b98a8 Squashed 'libs/editor/' changes from a35d654..0f6fba8
dba14e7 Merge pull request #3919 from wordpress-mobile/issue/update-build-tools
ca0ddf7 Merge branch 'release/5.2' into release/5.3
439ac00 Updating the rest of the modules to buildToolsVersion 23.0.3
0ce206f Merge commit '4c9324cf1eee00b66c76e0d5a917c86e1293a845' into develop
4c9324c Squashed 'libs/editor/' changes from f1f6d10..a35d654
290f00a update to android-gradle-2.0.0-rc1
23312dd upgrade to gradle plugin 2.0.0-beta7
c6efe0a Squashed 'libs/editor/' changes from bed2a4e..f1f6d10
9b0b5fa Squashed 'libs/editor/' changes from eb8d070..bed2a4e
2f8ebef update to com.android.tools.build:gradle:2.0.0-beta7
7b3b47e Merge branch 'develop' of github.com:wordpress-mobile/WordPress-Android into develop
2689888 Comment getQuantityString()
6551031 use String.format(getString(format), ...) instead of buggy getString(format, ...)
b2ac4fe replace plurals with a utility method
cf7abc9 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plans-master
8db246f Squashed 'libs/editor/' changes from 2b066be..eb8d070
c34f307 Merge commit '8db246f15ce6f4d2c7f7f7ec51c68b87e9a66c2f' into develop
a299686 Squashed 'libs/editor/' changes from 57802bf..2b066be
259c0cc Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plans-master
9cd77b6 Merge commit 'a03a1465ca3a5e6827a3a4c004b435b1bc0db4ee' into develop
a03a146 Squashed 'libs/editor/' changes from 7f3b589..57802bf
bcba708 Mark the util WPEditText as deprecated
0f6791c Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plans-master
487d833 Updated gradle to 2.0.0-beta6
e6a2785 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plans-master
9ca8561 Merge commit '108ed89ccdc90830463e57ce4ff5ba64ef0acc8f' into feature/visual-editor
108ed89 Squashed 'libs/editor/' changes from 50ddd25..7f3b589
d624527 Merge branch 'develop' into feature/visual-editor
346be68 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plans-master
714085f Merge commit '87b5e7c0a01bceedcbad9abb9a2e71505bbfbf48' into feature/visual-editor
87b5e7c Squashed 'libs/editor/' changes from 4832795..50ddd25
6335e6e Merge branch 'develop' into feature/visual-editor
ad79aef Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plan-details-viewpager
63391ec Merge remote-tracking branch 'origin/develop' into feature/account-settings
cb1661f Upgrade gradle plugin to 2.0.0-beta5
68c6f4c Squashed 'libs/editor/' changes from 69aaa8a..4832795
46aabfc Merge commit '68c6f4cd95baefe3198dca9e8bd7d1ee3732f576' into issue/3610-media-tracking-fixes
a667632 Merge remote-tracking branch 'origin/develop' into feature/account-settings
3194ade Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/Plans-M1-Show-Plans-List
aa8d9d5 Fix media isVideo/isValidImage/... utils method
ebef08f Merge commit '097b51b9618f0fe23146c66b58918651e9c80bbc' into issue/3610-media-tracking-fixes
097b51b Squashed 'libs/editor/' changes from d99856b..69aaa8a
fc52906 Merge commit '0b9c6088555e856e9fc7cdfe3e1e7b835ea4f08d' into develop
c0668eb Merge remote-tracking branch 'origin/develop' into feature/account-settings
da10360 Merge branch 'feature/Plans-M1-Show-Plans-List' of https://github.com/wordpress-mobile/WordPress-Android into feature/3718-show-available-plans
1e0ce6c Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/Plans-M1-Show-Plans-List
b927220 Merge pull request #3742 from wordpress-mobile/issue/update-to-android-gradle-plugin-2.0
7b89b47 update to android gradle plugin beta4
abd8b59 Merge remote-tracking branch 'origin/develop' into feature/account-settings
cdc50b8 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/3718-show-available-plans
4feb531 Reverts a previous unnecessary change that's accidentally committed for StringUtils
2bf5d02 update to android gradle plugin 2.0.0-beta-2 - Instant Run
f7bbc16 moved spinner in CommentsActivity to a more generic FilteredRecyclerView view which can be used in any fragment
5d798e5 Use lowercase locale array to make sure language is pre-selected
4a9c2a3 Our API could use "no" to denote false. Make sure our implementation of `getBool` catches it.
5ce9100 Merge remote-tracking branch 'origin/develop' into feature/account-settings
ab0599a Download available plans for a site. Refactoring!!
0c37b48 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/plans-add-item
e16984b Download global plans from wpcom and parse them. Store the response in AppPrefs for now.
b6449a5 Primary site added to Account Settings (wip)
ac00bae Adding SETTINGS log tag and logging unknown language code error
c0c935f Squashed 'libs/editor/' changes from 6647346..d99856b
26983b7 Merge develop into site-settings-review
faf8169 Merge commit 'a731d835c7f2b60790032ef1ec2f2af403040560' into develop
a0920e0 Merge commit '355e34b84ad8c79589065dafb7cf19b619eb957c' into develop
2a47170 Add utility methods to check if a URL is wpcom. Add utility methods  that check if it's safe to add the Authentication token to the request.
3dc20d0 kill StringUtils.getHost function
0851eb3 s/getDomainFromUri/getHost/
0bca2ec 4.9-rc-2 / 228 version bump
fa39ced fix #3521: use the simplest UnderlineSpan subclass
8b485b6 Merge branch 'develop' into feature/site-settings-review
f413bfd Allow photon to resize GIFs
4d1d85e Merge commit '7c21964c64da28781fbb63fa9ea22509d320bb0f' into develop
4a4c685 Merge branch 'develop' into feature/site-settings-review
5de9f05 Merge commit '2467f23341a72e17460995133a375e63252e88b3' into feature/sync-editor-lib
2467f23 Squashed 'libs/editor/' changes from ce4343d..6647346
8baae1f fix #3372:Resource Leak in SqlUtils.java
3fbefee Merge commit 'ee9a14bc80226f31e589e19d0b7512159c96acb3' into develop
adcda50 Merge commit '090e027e8c0fe0e07e26c1bfedc982c7fa99b124' into develop
ef4143b Moved the check for video to within ImageUtils
41a29ce Merge branch 'develop' into feature/site-settings-review
ec04675 suppress lint on missing permission
8eb155d Updating gradle plugin to 1.5.0 and support/build tools to latest for sub projects
0b0e451 Add log line that could help us in case of errors in the JSON parsing with queryJSON.
f214bff Merge branch 'develop' into feature/site-settings-review
83eb9d1 Better solution: Fix the url within PhotonUtils. Hattip @nbradbury
47d1e59 Revert "Fixes issue where private blog images wouldn't load."
d632cb7 Revert "Killing whitespace."
a60cce7 Killing whitespace.
cc3dd96 Fixes issue where private blog images wouldn't load.
b5937d6 Merge branch 'release/4.7' into feature/site-settings-review
bc7772a Moved permission check and request to PermissionUtils
21634cb Checking media permission when attempting to add media to post
e0721c8 Merge branch 'release/4.6' into issue/3115-runtime-permissions
c3ad1f2 first step for runtime location request
f376b01 Merge branch 'develop' into feature/site-settings-review
bb91e9a Merge branch 'release/4.6' into develop
bb4cb66 Merge branch 'hotfix/4.5.2' into release/4.6 plus bump version for beta release
ba3a532 Merge commit '7b6a9d464896683ba4aef6f4dccc9021641e5d71' into develop
7b6a9d4 Squashed 'libs/editor/' changes from 244a513..ce4343d
13bb8af test queryJSON calls with null params
181cebb Check null query string
68f5328 check null source in JSONUtils.queryJSON()
66d56be Merge branch 'develop' into feature/site-settings-review
a9e602f update ProfilingUtils usage
9eeabd4 Merge branch 'develop' into feature/site-settings-review
2aaf29d Add two new functions to Utils that remove the traling slash in a string, and remove the scheme from URL string.
55037d2 Use homeURL instead of hostName to show the blog address. WordPress can be installed in a sub-directory, and so the host name will be the same for two subdir installations on the same host.
b534e1d URL Utils test fix
bb2d893 Merge branch 'develop' into feature/site-settings-review
47cc553 generic approach to add parameters to a URL
dc193f5 new UrlUtils method: appendPreviewURLParameter
7bf9eb9 Updating build tools to 23.0.1
619e359 Merge branch 'develop' into feature/site-settings-review
58440ae set targetSdkVersion to 23 and clean up lib dependencies
5b825d3 migrate from mavenCentral to jcenter (which is now the default for Android Studio)
6ad7e5c fix lint errors
b7d5983 update to gradle plugin 1.3.1 and gradle 2.6
dd3729c upgrade to gradle 2.5 and gradle plugin 1.3.0
7d3506f Merge branch 'develop' into feature/update-to-gradle-2.4
cfe353e Merge branch 'develop' into feature/update-to-gradle-2.4
33111c4 Squashed 'libs/editor/' changes from e0a8651..244a513
f9336b1 Squashed 'libs/editor/' changes from a59304d..e0a8651
05d9908 Updating ActionBar title. Save button is now Undo.
5f30f53 Squashed 'libs/editor/' changes from 6c35434..a59304d
56693c5 Squashed 'libs/editor/' changes from 4125f05..6c35434
fcf0b6f Merge branch 'hotfix/4.1.1' into release/4.2
a576ec7 Merge pull request #2878 from wordpress-mobile/issue/2860-npe-post-settings-update
0105cee Updating EditTextUtils.getText method instead of creating new one.
3f98bb1 limit text to 524288 characters which is always < 2Mb with UTF-8
734f781 Merge branch 'hotfix/4.1.1' into release/4.2
bf3cd76 fix #2855: delete big comments and truncate new inserted comments
df5f634 Squashed 'libs/editor/' changes from 77cb2fb..4125f05
661dc4f Coding Styles
ac27e0f Make sure the context passed to checkConnection is not null
9eaf958 Squashed 'libs/editor/' changes from aec6410..77cb2fb
fc2bc73 Updated support library and build tools
3ff99e3 update to gradle android plugin 1.2.3
4109f72 update support lib to 22
bb09a7b update to android-gradle plugin 1.1.3 and build tools 22.0.1
2f98d8a Introduce our version of MarkView
2aa392e Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into issue/masterbar-notifs-self-hosted
4434b0f Merge commit '40e798bf739c94adbc7aa9156ded0a5ad28dc462' into develop
8658bd7 Fixed notifications fragment for self-hosted
40e798b Merge pull request #140 from wordpress-mobile/issue/18-format-bar-tablet
0bcd888 Merge branch 'release/4.0' into develop
4ace866 Removing potential race condition with WP image loading threads.
8786fed Returning to the post editor won't crash if Activity was destroyed.
2fe6c3f Merge branch 'develop' into issue/18-format-bar-tablet
8a1bf41 Merge pull request #138 from wordpress-mobile/issue/124-separate-files
559b7d8 Style updates.
9b89d36 Added support for strikethrough tag in EditorFragment
efcde28 Added editor layout for tablets (sw600dp)
5e59531 Added selector for strikethrough button
3bf29a2 Added bigger HTML button drawables for tablet format bar
9239f92 Removed a lot of inline JS/CSS from the main editor html file.
64b83d3 Merge pull request #136 from wordpress-mobile/issue/132-formatbar-keyboard-old-api
2d7c9c4 Moved some WebView config code from EditorFragment to EditorWebViewAbstract
c5882ba Merge remote-tracking branch 'remotes/origin/develop' into issue/132-formatbar-keyboard-old-api
566b8e6 Add more audio formats
0699bb6 Suppressed NewApi lint check for EditorWebView.execJavaScriptFromString
c15b38c Handle audio files in media browser
8d5b424 Added compatibility WebView for API<19 with custom method for executing JS
4478cf3 Merge pull request #133 from wordpress-mobile/issue/10-format-bar-phone
ba3c137 Pulled the EditorWebView layout element into a separate file
b4a21f4 Modified EditorWebView to use WebView.evaluateJavascript on API>=19
ef8b078 Added EditorWebViewAbstract and replaced EditorWebView usage in EditorFragment
50524b9 Moved the format bar's left margin inside the scrollview
0d2a713 Shrank HTML button and tightened its margins
06c212a Merge branch 'release/4.0' into develop
056645f Merge branch 'hotfix/3.9.1' into release/4.0
c2d5a5e Catching other unknown URL exception.
d08c926 Making sure Cursor is closed if exception gets thrown.
ba751a2 Catching unknown URL exceptions.
baa00c8 Removed unnecessary HTML button code
f30f7be Merge branch 'release/4.0' into develop
1b6118d Merge remote-tracking branch 'origin/hotfix/3.9.1' into release/4.0
f144a88 Linked up format bar buttons to ZSSEditor methods
570ae57 Added unit test for Utils.buildMapFromKeyValuePairs
bbba60a Added partial support for the callback-selection-changed JS callback
bb8c537 Added format bar buttons and dividers to editor layout
f1d2319 javadocs
efe7e97 If string is empty return empty string instead of null
6e340ac Renamed format button highlighted underline dimens
315bb50 Relabeled legacy editor color assets
14c3938 Added new format bar icons and selectors
8303e45 Renamed legacy editor button selectors and images
6195fe0 Merge pull request #129 from wordpress-mobile/issue/23-extract-callback-handler
228a563 Qualified Utils static imports in UtilsTest
418d4b3 Some EditorFragment cleanup
db3bd70 Added units tests for Utils
53821d7 Added units tests for JsCallbackHandler
862e533 Added some callback placeholders to JsCallbackReceiver with logging
b746221 Renamed callback classes for clarity
bedf027 Merge branch 'develop' into issue/23-extract-callback-handler
eaa2f17 Merge pull request #21 from wordpress-mobile/feature/test-framework
5346958 Added a lint rule ignoring the 'InvalidPackage' check for Robolectric
83c3108 Added notes and logging for some currently unused JS callbacks
4c2f2d1 Downgrading plugin, tests aren't working with the new tools.
17ec76c Updating robolectric-gradle-plugin and the Android gradle build plugin.
201f7e7 Merge branch 'develop' into feature/test-framework
abcf3e3 Moved some utility methods from EditorFragment to Utils
7f336ea Added a WebView sublcass, EditorWebView, and switched the editor to use that
b7be242 Added handling for the "callback-selection-style" JS callback
e9c6401 Updated onDomLoaded() to enable multiline support for the content field
f1f933b Moved JsCallbackHandler to its own file
5da8d79 Added example format bar with bold button
fc5f50d Merge pull request #22 from wordpress-mobile/feature/14-main-editor
3666662 Cleaned up EditorFragment
9645409 Changed project license from MIT to GPLv2
cfa2fe4 Fixed issue with JavaScript not loading on API<19
32591e0 Switched WebChromeClient onConsoleMessage to use debug log messages instead of error
10b5506 Updated to use build tools 21.1.2
54d20a7 Added title to editor example content
124981c Added travis build status to README
200efb8 Adding Robolectric test framework and JaCoCo code coverage reports.
124d3a9 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/viewpager-main-activity
c47d51e javadocs
152983e Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/viewpager-main-activity
ef0e582 README cleanup
d16a6d5 Set default activity for example application
23fd043 Updated README with build instructions for Windows (fixes assets symlink)
87c8911 Added @SuppressLint for web debugging
a5e31e8 Changed WordPress-Utils-Android dependency to maven artifact
7631e96 If string is empty return empty string instead of null
d8522a9 Updated ViewSiteActivity and WebViewActivity to use support toolbar w/o drawer
b626b4c 1.5.0 version bump
d2cfae7 Merge branch 'develop' into feature/modularize-editor
88f29c5 JS to Java callback proof of concept
d2aa4f3 Updated ZSSRichTextEditor to latest version
ced12ea Auto-load an example HTML file in editor
dd66e62 Updated common editor files and imported editor HTML file from iOS
fd92adf Added support for `WPWebViewClient` to pass the token for image requests.
6a05144 Merge branch 'hotfix/3.8.1' into release/3.9
efa02b7 fix gallery placeholder icon
1d171d8 fix #2437: clear uploading posts state if the PostUploadService is not running during PostList creation
a6b5ecf Tapping a media gallery span opens gallery editor.
912f81a Adding missing override annotation.
58c9ae7 Using isVideo to determine if a file is a video.
1721d30 enable gallery handling
3ca1d97 remove unused code
9c806b5 first step at introducing the new media picker
28ca417 Merge branch 'develop' into feature/modularize-editor
cec9c82 fix #2328: sort blogs with an empty title by their hostname
c431408 Merge branch '1628-mediapicker' into feature/modularize-editor
94e0f77 rename and update editor colors
1b3b384 Merge branch 'develop' into feature/modularize-editor
1398d41 Merge branch 'develop' of github.com:wordpress-mobile/WordPress-Android into feature/modularize-editor
c0c684a comment CustomSwipeRefreshLayout.onTouchEvent
757b720 new CustomSwipeRefreshLayout with a workaround to catch onTouchEvent IllegalArgumentException
c9a7b99 Merge branch 'develop' into feature/modularize-editor
682b62b Merge pull request #2365 from wordpress-mobile/issue/1827-post-stuck-in-uploading-state
6083a1a Merge branch 'develop' into feature/modularize-editor
9f900a9 fix typo in a comment
a9e6e49 delay the refreshing anim by 50ms to workaround https://code.google.com/p/android/issues/detail?id=77712
63dbb16 styling update
eeb819b Merge branch 'release/3.7' into develop
92791b4 Merge branch 'develop' into feature/modularize-editor
f6ef4ce fix local draft style saving by introducing an awful "getSpannedContent()" method :(
c3d9720 fix #2336: check for null text entry, replace them with a string
8f9d5e4 EditLinkActivity is now independent from the EditPostActivity
1d7067e add local draft / remote post example
d33a9be make the legacy editor works in the example project
6f0d297 LegacyEditorFragment now lives in the editor subproject
2b5c737 split MediaUtils in MediaUtils and WordPressMediaUtils - remove references to WordPress.java in MediaUtils
777635b split MediaUtils in MediaUtils and WordPressMediaUtils - remove references to WordPress.java in MediaUtils
56d9289 move WPUnderlineSpan.java and MediaGalleryImageSpan.java to WPUtils
0c60b07 move WPUnderlineSpan.java and MediaGalleryImageSpan.java to WPUtils
11e6f7f use setFeaturedImageSupported instead of using WordPress.getCurrentBlog().isFeaturedImageCapable()
fb3a66d appendMediaFile now able to load local media
59c4bc4 Merge branch 'develop' into feature/modularize-editor
fe48809 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into issue/2306-reader-feed-preview
068e0df reenable appendMedia in LegacyEditorFragment
4f21616 All gravatar requests now default to 404.
d847975 split methods to be usable on MediaFile instead of WPImageSpan
8978cb1 move WPEditImageSpan bitmap loading to the constructor
ef8a893 Added DEFAULT_BLAVATAR constant
956d44c WPNetworkImageView now accepts a default error image resource, also forcing size when showing blavatars in ReaderBlogAdapter
4f27696 Moved fixAvatar routine to GravatarUtils
9955a71 Added DefaultImage enum to GravatarUtils
2eba000 move WPImageSpan and MediaFile to WPUtils - also create a WPEditImageSpan class
8141509 move WPImageSpan and MediaFile to WPUtils - also create a WPEditImageSpan class
839f755 first step to remove getContentEditText/getTitleEditText
aacdb40 Squashed 'libs/editor/' changes from 571b0b7..aec6410
fecaf30 Merge commit 'aacdb402f1832ac0ce6db671c853a5dde0424d3d' into feature/modularize-editor
aec6410 remove libs/utils dependency (use the artifact instead)
5cac05f add getters for Title/Content
406a9d4 move activities from editor/libs to editor/example
4b80ec9 rename EditorFragmentInterface to EditorFragmentAbstract
4b1beca use EditorFragmentInterface and call initContentEditor
30ce072 Removed blogUrl param from showBlogPreview(), added new routines for following/unfollowing blogs & feeds
9cce529 remove extraneous static field
26fc5f7 new EditorFragmentInterface
d328cf6 Merge branch 'develop' into feature/modularize-editor
0bf5a63 move WPEditText to WordPressUtils and reorganize WordPressUtils
ac92a69 move WPEditText to WordPressUtils and reorganize WordPressUtils
c11bb96 fix WordPressEditor example build
9fc7eee First step at extracting the old editor (moving Media related method to the EditPostActivity, they should end up in their own class/lib)
20a9dd9 First step at extracting the old editor (moving Media related method to the EditPostActivity, they should end up in their own class/lib)
8b3bf17 rename editor/analytics projects in build files
e12800b rename editor/editor to editor/WordPressEditor and analytics/analytics to analytics/WordPressAnalytics to avoid confusion in Android Studio
f4ba322 Blavatar defaults to 404
9d58f07 Added blavatars to ManageBlogsActivity
6a4e8c7 use utils artifact instead of sub project
e451f1f move resources from main project to editor
4917b74 Merge commit '1824f636f3b3c7e35f2c03225c2ca36ed18c16c3' into feature/modularize-editor
77a78c9 Squashed 'libs/editor/' changes from 86805a0..571b0b7
571b0b7 add license file
48a14b0 add assets link
9dcfa23 Add 'libs/editor-common/' from commit '9d488d2a1c610380aa9446f8c9fea50d15354a84'
9d488d2 initial commit
cdcc2a8 Initial commit
3b085ce Merge branch 'develop' of github.com:wordpress-mobile/WordPress-Android into develop
d9f758e Merge branch 'release/3.7' into develop
c24cf7f comment addUrlSchemeIfNeeded and why removeLeadingDoubleSlash is used there
fa05a48 Add strip=all to all Photon requests
1b5d1fd add dependency on WordPressUtils and use AppLog instead of Log
add8d90 Squashed 'libs/editor/' changes from fc65662..86805a0
5df2a9b Squashed 'libs/editor/' changes from fc65662..86805a0
86805a0 Add 'libs/utils/' from commit '94d1dbb0f5220525759de83c60cba3e95ce95eff'
cfc3ff0 use title/content params in the editor
9f26eb3 remove useless test in example
83ff559 fix appcompat and support-v4 dependencies
714eeb1 move new editor logic to a fragment
4a2f1ba back to 21.1.1 tools
279f2ee fix appcompat dependency
d3985f0 new travis config
ee42dda fix build for example project
66fb19b rename package name to org.wordpress.android
b61040c rename package name to org.wordpress.android
4edc93f add signing to publish artifact
fc65662 first commit
22fc5ea fix #2293: remove leading double slash in URLs returned by wporg servers
21a72fe Merge branch 'release/3.7' into develop
5fc20b0 fix AppLogViewerActivity when a log is message is null
519a49d Merge pull request #2264 from wordpress-mobile/issue/2222-theme-preview-title
fe5748a new BlogUtils.getHostNameFromAccountMap function
6086bf3 Theme live preview no longer changes the activity title
f5425b4 Photo viewer now uses low quality for the lo-res image
2765036 Simplified comments
e8555a5 Switched to quality enum which defaults to medium
455855b Added default quality param to photon
f0fa639 html encode log entries in AppLog.toHtml()
a844a15 fix #103: retain menu drawer scroll position after switching activities
5a72a14 Merge branch 'develop' into issue/985-make-sfactory-private
847dc52 fix build files for android studio 1.0
3b3a115 Merge remote-tracking branch 'origin/develop' into issue/985-make-sfactory-private
855bf77 update support lib version for travis
04c0532 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/material-appcompat
6e2fc97 Merge branch 'develop' into release/3.4
c8ae9b8 remove unused code (refresh button)
47b079d fix #985: maks sFactory private - force injection in test module
e6eb6dc Merge branch 'release/3.4' into issue/1982-simperium-concurrency Conflicts: 	WordPress/src/main/java/org/wordpress/android/models/Note.java
411df80 Updated build.gradle to specify com.android.support:appcompat-v7:21.0.2
16e27f7 Removed unsuccessful fix for #1982.
57dc2d6 first step at replacing PreferenceActivity by a PreferenceFragment + ActionBarActivity
cc8d417 Merge branch 'develop' into feature/material-appcompat
7078615 Merge branch 'release/3.4' into develop
376d5d8 Merge branch 'hotfix/3.3.1' into release/3.4
2131975 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/material-appcompat
5c7d9c1 update subtrees to use build tools 21.1.1
2eaaf77 rename PullToRefresh to SwipeToRefresh
8191caf remove unused viewClass in PTR constructor
cc60d09 fix circle spinner color style
5a2533c Return a copy of the JSONObject in getDiffableValue().
2bff0f2 replace Chris Banes' PullToRefresh by the native SwipeToRefresh view
039d47e Merge remote-tracking branch 'origin/develop' into feature/1961-add-mentions-to-commenting
a3ef9c1 Merge branch 'develop' into issue/1958-round-avatars
ebdc699 Merge remote-tracking branch 'origin/develop' into feature/1961-add-mentions-to-commenting
c03a923 Merge branch 'hotfix/3.3.1' into release/3.4
e71569b upgrade to android-gradle 0.14.0
a8aa7e5 Rounds all WPNetworkImageViews with `AVATAR` type.
6e90b83 Initial commit adding mentions to notification comments
d4ff1cf Added image spans directly instead of using Html.fromHtml().
afc5a86 Merge branch 'release/3.2' into develop
8b95174 fix debug/release build propagation to sub projects
1b079d0 Merge branch 'release/3.2' into develop
e481b13 Merge pull request #1861 from wordpress-mobile/feature/notifications-redesign
dcc33ea Merge pull request #1860 from wordpress-mobile/issue/1821-remove-istablet
f438748 Merge branch 'hotfix/3.1.2' into release/3.2
a061eb3 fix #1821: remove DisplayUtis.isTablet() method
70242e2 Catch NPE in Bitmap.CreateBitmap and make sure the returned bitmap is not null
012532e Merge branch 'release/3.2' into feature/notifications-redesign
7339f98 Revert "Revert "Merge pull request #1799 from wordpress-mobile/feature/1795-reader-render-attachments""
70fd076 Merge branch 'release/3.2' into develop
907b86c Merge branch 'hotfix/3.1.1' into release/3.2
22532e4 Merge branch 'hotfix/3.1.1' into develop
f2d990a remove isTablet() check
c54c2be Merge branch 'release/3.2' into feature/notifications-redesign
dde165c Revert "Merge pull request #1799 from wordpress-mobile/feature/1795-reader-render-attachments"
de7cb04 Merge branch 'develop' into feature/notifications-redesign
60a3cf7 Replaced String.format() with string concatenation in ReaderUtils and PhotonUtils after profiler showed String.format() to be hurting performance
36ce907 fix lint error in utils
b7c1140 Merge branch 'develop' into feature/notifications-redesign
2e0d872 Removed aggressive `JSONUtil` logging
e5ee549 update support-v13 library to version 19.1.0
c71fdf7 Merge pull request #1781 from wordpress-mobile/issue/17760-reader-comment-full-images
2167d48 disable refresh on the attacher
811be6a use the PTR library version 0.9.7
b59d7a8 set network refresh mode as default
3294c34 remove unused code
4344929 add a network mode in PullToRefreshHeaderTransformer to show a different message when network is disabled
5a6e5cf move NetworkUtils to WPUtils subtree
0277c58 Updated comment
719a637 TextView content is reset to itself to force it to correctly resize using cached image
c8b1eaa More cleanup
8e366fa Cleanup WPImageGetter based on code analysis
f0229fc Merge pull request #1764 from wordpress-mobile/issue/1713-send-version-code-to-mixpanel
8b37df5 Merge branch 'release/3.1' into develop
92677c2 Merge commit '3a77c01015919f187852c63c384d9a2a48421d24' into release/3.1
ca27479 fix #1762: show blog url in the share blog spinner if the blog title is an empty string
b2d1806 remove ProfilingUtils.getVersionName calls
2b0241f remove unused method from ProfilingUtils
f464cdb move BuildUtils to WPUtils subtree, rename BuildUtils to PackageUtils and add getPackageInfo and getVersionCode methods
643365e Merge branch 'develop' into feature/notifications-redesign
10253e0 Rewrote the AppLog viewer to use a ListView+adapter
631fbe9 Merge branch 'develop' into issue/1690-track-last-seen-screen
525e3c3 remove unused util file ActivityUtils
efdb85c Merge branch 'develop' into issue/1684-stuck-notifications
8b2a504 Bump libs/utils version number.
bbbe7d8 Merge pull request #1687 from wordpress-mobile/issue/1685-stats-tooltip-text-size
adbedc9 generic way to track last seen activity - requires GET_TASKS permission
8deae86 Use the unicode version of the Horizontal ellipsis char. Restrict the visibility of some methods to private.
a38b30c Text view that auto adjusts text size to fit within the view.If the text size equals the minimum text size and still does not fit, append with an ellipsis.
41078f6 Merge pull request #1670 from wordpress-mobile/issue/1668-reader-doesnt-auto-update
2346771 Start the simperium buckets in `onResume` of `NotificationsActivity`. Added some helper methods to `SimperiumUtils` to check authorized status of user.
f00f6b5 Merge pull request #1683 from wordpress-mobile/issue/1681-comment-list-crash
02f662f init utils readme
4d7191e import libs/utis
b42ec5a fix #1681: null check
900e14c Fixed bug in ReaderTagTable that caused tbl_tag_updates to always overwrite the existing row when updating a date column
32266a5 Merge branch 'Develop' into 'notifications-redesign'

git-subtree-dir: libs/utils
git-subtree-split: c2484a2
  • Loading branch information
maxme committed Jun 22, 2016
1 parent 0b9c608 commit 937086d
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 44 deletions.
6 changes: 3 additions & 3 deletions WordPressUtils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.1.0'
}
}

Expand All @@ -29,10 +29,10 @@ android {
publishNonDefault true

compileSdkVersion 23
buildToolsVersion "23.0.2"
buildToolsVersion "23.0.3"

defaultConfig {
versionName "1.9.0"
versionName "1.10.0"
minSdkVersion 14
targetSdkVersion 23
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
public class AppLog {
// T for Tag
public enum T {READER, EDITOR, MEDIA, NUX, API, STATS, UTILS, NOTIFS, DB, POSTS, COMMENTS, THEMES, TESTS, PROFILING,
SIMPERIUM, SUGGESTION, MAIN}
SIMPERIUM, SUGGESTION, MAIN, SETTINGS, PLANS}

public static final String TAG = "WordPress";
public static final int HEADER_LINE_COUNT = 2;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.wordpress.android.util;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

public class BlogUtils {
Expand Down Expand Up @@ -45,4 +47,28 @@ public static String getHomeURLOrHostNameFromAccountMap(Map<String, Object> acco

return homeURL;
}

public static String[] getBlogNamesFromAccountMapList(List<Map<String, Object>> accounts) {
List<String> blogNames = new ArrayList<>();
for (Map<String, Object> account : accounts) {
blogNames.add(getBlogNameOrHomeURLFromAccountMap(account));
}
return blogNames.toArray(new String[blogNames.size()]);
}

public static String[] getHomeURLOrHostNamesFromAccountMapList(List<Map<String, Object>> accounts) {
List<String> urls = new ArrayList<>();
for (Map<String, Object> account : accounts) {
urls.add(getHomeURLOrHostNameFromAccountMap(account));
}
return urls.toArray(new String[urls.size()]);
}

public static String[] getBlogIdsFromAccountMapList(List<Map<String, Object>> accounts) {
List<String> ids = new ArrayList<>();
for (Map<String, Object> account : accounts) {
ids.add(MapUtils.getMapStr(account, "blogId"));
}
return ids.toArray(new String[ids.size()]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ public static boolean getBool(JSONObject json, String name) {
return false;
if (value.equalsIgnoreCase("false"))
return false;
if (value.equalsIgnoreCase("no"))
return false;
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,29 @@
import java.util.TimeZone;

public class MediaUtils {
private static final int DEFAULT_MAX_IMAGE_WIDTH = 1024;

public static boolean isValidImage(String url) {
if (url == null) {
return false;
}

url = url.toLowerCase();
return url.endsWith(".png") || url.endsWith(".jpg") || url.endsWith(".jpeg") || url.endsWith(".gif");
}

public static boolean isDocument(String url) {
if (url == null) {
return false;
}

url = url.toLowerCase();
return url.endsWith(".doc") || url.endsWith(".docx") || url.endsWith(".odt") || url.endsWith(".pdf");
}

public static boolean isPowerpoint(String url) {
if (url == null) {
return false;
}

url = url.toLowerCase();
return url.endsWith(".ppt") || url.endsWith(".pptx") || url.endsWith(".pps") || url.endsWith(".ppsx") ||
url.endsWith(".key");
}
Expand All @@ -58,14 +60,15 @@ public static boolean isSpreadsheet(String url) {
if (url == null) {
return false;
}

url = url.toLowerCase();
return url.endsWith(".xls") || url.endsWith(".xlsx");
}

public static boolean isVideo(String url) {
if (url == null) {
return false;
}
url = url.toLowerCase();
return url.endsWith(".ogv") || url.endsWith(".mp4") || url.endsWith(".m4v") || url.endsWith(".mov") ||
url.endsWith(".wmv") || url.endsWith(".avi") || url.endsWith(".mpg") || url.endsWith(".3gp") ||
url.endsWith(".3g2") || url.contains("video");
Expand All @@ -75,6 +78,7 @@ public static boolean isAudio(String url) {
if (url == null) {
return false;
}
url = url.toLowerCase();
return url.endsWith(".mp3") || url.endsWith(".ogg") || url.endsWith(".wav") || url.endsWith(".wma") ||
url.endsWith(".aiff") || url.endsWith(".aif") || url.endsWith(".aac") || url.endsWith(".m4a");
}
Expand Down Expand Up @@ -112,29 +116,52 @@ public static Uri getLastRecordedVideoUri(Activity activity) {
return Uri.parse(contentUri.toString() + "/" + cursor.getLong(0));
}

// Calculate the minimun width between the blog setting and picture real width
public static int getMinimumImageWidth(Context context, Uri curStream, String imageWidthBlogSettingString) {
int imageWidthBlogSetting = Integer.MAX_VALUE;

if (!imageWidthBlogSettingString.equals("Original Size")) {
try {
imageWidthBlogSetting = Integer.valueOf(imageWidthBlogSettingString);
} catch (NumberFormatException e) {
AppLog.e(T.POSTS, e);
}
/**
* Get image width setting from the image width site setting string. This string can be an int, in this case it's
* the maximum image width defined by the site.
* Examples:
* "1000" will return 1000
* "Original Size" will return Integer.MAX_VALUE
* "Largeur originale" will return Integer.MAX_VALUE
* null will return Integer.MAX_VALUE
* @param imageWidthSiteSettingString Image width site setting string
* @return Integer.MAX_VALUE if image width is not defined or invalid, maximum image width in other cases.
*/
public static int getImageWidthSettingFromString(String imageWidthSiteSettingString) {
if (imageWidthSiteSettingString == null) {
return Integer.MAX_VALUE;
}
try {
return Integer.valueOf(imageWidthSiteSettingString);
} catch (NumberFormatException e) {
return Integer.MAX_VALUE;
}
}

int[] dimensions = ImageUtils.getImageSize(curStream, context);
int imageWidthPictureSetting = dimensions[0] == 0 ? Integer.MAX_VALUE : dimensions[0];
/**
* Calculate and return the maximum allowed image width by comparing the width of the image at its full size with
* the maximum upload width set in the blog settings
* @param imageWidth the image's natural (full) width
* @param imageWidthSiteSettingString the maximum upload width set in the site settings
* @return maximum allowed image width
*/
public static int getMaximumImageWidth(int imageWidth, String imageWidthSiteSettingString) {
int imageWidthBlogSetting = getImageWidthSettingFromString(imageWidthSiteSettingString);
int imageWidthPictureSetting = imageWidth == 0 ? Integer.MAX_VALUE : imageWidth;

if (Math.min(imageWidthPictureSetting, imageWidthBlogSetting) == Integer.MAX_VALUE) {
// Default value in case of errors reading the picture size and the blog settings is set to Original size
return 1024;
// Default value in case of errors reading the picture size or the blog settings is set to Original size
return DEFAULT_MAX_IMAGE_WIDTH;
} else {
return Math.min(imageWidthPictureSetting, imageWidthBlogSetting);
}
}

public static int getMaximumImageWidth(Context context, Uri curStream, String imageWidthBlogSettingString) {
int[] dimensions = ImageUtils.getImageSize(curStream, context);
return getMaximumImageWidth(dimensions[0], imageWidthBlogSettingString);
}

public static boolean isInMediaStore(Uri mediaUri) {
// Check if the image is externally hosted (Picasa/Google Photos for example)
if (mediaUri != null && mediaUri.toString().startsWith("content://media/")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import android.Manifest.permission;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager;
import android.support.v13.app.FragmentCompat;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;

Expand Down Expand Up @@ -30,23 +33,65 @@ private static boolean checkAndRequestPermissions(Activity activity, int request
return true;
}

/**
* Check for permissions, request them if they're not granted.
*
* @return true if permissions are already granted, else request them and return false.
*/
private static boolean checkAndRequestPermissions(Fragment fragment, int requestCode, String[] permissionList) {
List<String> toRequest = new ArrayList<>();
for (String permission : permissionList) {
Context context = fragment.getActivity();
if (context != null && ContextCompat.checkSelfPermission(context, permission) != PackageManager
.PERMISSION_GRANTED) {
toRequest.add(permission);
}
}
if (toRequest.size() > 0) {
String[] requestedPermissions = toRequest.toArray(new String[toRequest.size()]);
FragmentCompat.requestPermissions(fragment, requestedPermissions, requestCode);
return false;
}
return true;
}

public static boolean checkAndRequestCameraAndStoragePermissions(Activity activity, int requestCode) {
return checkAndRequestPermissions(activity, requestCode, new String[]{
permission.WRITE_EXTERNAL_STORAGE,
permission.CAMERA
});
}

public static boolean checkAndRequestCameraAndStoragePermissions(Fragment fragment, int requestCode) {
return checkAndRequestPermissions(fragment, requestCode, new String[]{
permission.WRITE_EXTERNAL_STORAGE,
permission.CAMERA
});
}

public static boolean checkAndRequestStoragePermission(Activity activity, int requestCode) {
return checkAndRequestPermissions(activity, requestCode, new String[]{
permission.WRITE_EXTERNAL_STORAGE
});
}

public static boolean checkAndRequestStoragePermission(Fragment fragment, int requestCode) {
return checkAndRequestPermissions(fragment, requestCode, new String[]{
permission.WRITE_EXTERNAL_STORAGE
});
}

public static boolean checkLocationPermissions(Activity activity, int requestCode) {
return checkAndRequestPermissions(activity, requestCode, new String[]{
permission.ACCESS_FINE_LOCATION,
permission.ACCESS_COARSE_LOCATION
});
}

public static boolean checkLocationPermissions(Fragment fragment, int requestCode) {
return checkAndRequestPermissions(fragment, requestCode, new String[]{
permission.ACCESS_FINE_LOCATION,
permission.ACCESS_COARSE_LOCATION
});
}
}
Loading

0 comments on commit 937086d

Please sign in to comment.