Skip to content

Commit add8d90

Browse files
committed
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 94d1dbb Merge branch 'release/3.7' into develop 8ff9413 fix AppLogViewerActivity when a log is message is null 7c208db Merge pull request #2264 from wordpress-mobile/issue/2222-theme-preview-title 9eb7273 new BlogUtils.getHostNameFromAccountMap function a80859d Theme live preview no longer changes the activity title 6186933 Photo viewer now uses low quality for the lo-res image 2eb9839 Simplified comments bfa7ecb Switched to quality enum which defaults to medium a2ce056 Added default quality param to photon 5a48a06 html encode log entries in AppLog.toHtml() c8a4d89 fix #103: retain menu drawer scroll position after switching activities c1e0778 Merge branch 'develop' into issue/985-make-sfactory-private fe1d125 fix build files for android studio 1.0 f7a2d48 Merge remote-tracking branch 'origin/develop' into issue/985-make-sfactory-private 72fe2b7 update support lib version for travis 0b03b71 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/material-appcompat 0f5751d Merge branch 'develop' into release/3.4 b68f755 remove unused code (refresh button) cb8321b fix #985: maks sFactory private - force injection in test module faae1d3 Merge branch 'release/3.4' into issue/1982-simperium-concurrency Conflicts: WordPress/src/main/java/org/wordpress/android/models/Note.java a0982d1 Updated build.gradle to specify com.android.support:appcompat-v7:21.0.2 3a0c45e Removed unsuccessful fix for #1982. b967d59 first step at replacing PreferenceActivity by a PreferenceFragment + ActionBarActivity 92d4e15 Merge branch 'develop' into feature/material-appcompat 7c8d5ab Merge branch 'release/3.4' into develop 1e499a6 Merge branch 'hotfix/3.3.1' into release/3.4 7a4a364 Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/material-appcompat 5451df7 update subtrees to use build tools 21.1.1 4024637 rename PullToRefresh to SwipeToRefresh 0d8d414 remove unused viewClass in PTR constructor 2424201 fix circle spinner color style d392885 Return a copy of the JSONObject in getDiffableValue(). 106affa replace Chris Banes' PullToRefresh by the native SwipeToRefresh view 3108a36 Merge remote-tracking branch 'origin/develop' into feature/1961-add-mentions-to-commenting db25827 Merge branch 'develop' into issue/1958-round-avatars 2801610 Merge remote-tracking branch 'origin/develop' into feature/1961-add-mentions-to-commenting 6ac0248 Merge branch 'hotfix/3.3.1' into release/3.4 eb70e6f upgrade to android-gradle 0.14.0 9bc4ba6 Rounds all WPNetworkImageViews with `AVATAR` type. c2fd6c7 Initial commit adding mentions to notification comments 0a3da42 Added image spans directly instead of using Html.fromHtml(). 5b22440 Merge branch 'release/3.2' into develop 1a2a73f fix debug/release build propagation to sub projects d9eac2e Merge branch 'release/3.2' into develop 380ece6 Merge pull request #1861 from wordpress-mobile/feature/notifications-redesign c38f131 Merge pull request #1860 from wordpress-mobile/issue/1821-remove-istablet 4e92eaa Merge branch 'hotfix/3.1.2' into release/3.2 cbc7b24 fix #1821: remove DisplayUtis.isTablet() method 343771a Catch NPE in Bitmap.CreateBitmap and make sure the returned bitmap is not null c44a87a Merge branch 'release/3.2' into feature/notifications-redesign 97c557c Revert "Revert "Merge pull request #1799 from wordpress-mobile/feature/1795-reader-render-attachments"" 1cacaf2 Merge branch 'hotfix/3.1.1' into release/3.2 568782f Merge branch 'hotfix/3.1.1' into develop 96fd180 remove isTablet() check 870944d Merge branch 'release/3.2' into feature/notifications-redesign 3390393 Revert "Merge pull request #1799 from wordpress-mobile/feature/1795-reader-render-attachments" 03bbac0 Merge branch 'develop' into feature/notifications-redesign 8ec2915 Replaced String.format() with string concatenation in ReaderUtils and PhotonUtils after profiler showed String.format() to be hurting performance 1623d65 fix lint error in utils e273dd3 Merge branch 'develop' into feature/notifications-redesign 4bfc641 Removed aggressive `JSONUtil` logging f7f4556 update support-v13 library to version 19.1.0 fafcf67 Merge pull request #1781 from wordpress-mobile/issue/17760-reader-comment-full-images 1868cc5 disable refresh on the attacher 082c13f use the PTR library version 0.9.7 f21f5d3 set network refresh mode as default d262f8d remove unused code 9e592fd add a network mode in PullToRefreshHeaderTransformer to show a different message when network is disabled f85a003 move NetworkUtils to WPUtils subtree d19c080 Updated comment cabb8a7 TextView content is reset to itself to force it to correctly resize using cached image 48e4ed2 More cleanup 2426243 Cleanup WPImageGetter based on code analysis c955d26 Merge pull request #1764 from wordpress-mobile/issue/1713-send-version-code-to-mixpanel 3bc1080 Merge branch 'release/3.1' into develop f75a9e7 increment version number caa9db0 fix #1762: show blog url in the share blog spinner if the blog title is an empty string e1eecbf remove ProfilingUtils.getVersionName calls 075b989 remove unused method from ProfilingUtils b48cbda move BuildUtils to WPUtils subtree, rename BuildUtils to PackageUtils and add getPackageInfo and getVersionCode methods 44bb61e Rewrote the AppLog viewer to use a ListView+adapter 59f0bfa Merge branch 'develop' into issue/1690-track-last-seen-screen 9300d28 remove unused util file ActivityUtils b15cf64 Bump libs/utils version number. 0d89a80 generic way to track last seen activity - requires GET_TASKS permission 391276c Use the unicode version of the Horizontal ellipsis char. Restrict the visibility of some methods to private. c8dc1e8 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. aa5b665 init utils readme 76df52f import libs/utis 449639d set defaultPublishConfig to debug - in case we had source dependencies to this module 5b1f8f1 remove gradle wrapper cd72102 Bump version number 90f9f22 Merge pull request #1 from wordpress-mobile/issue/move-ptr-to-utils c6b0ff9 showToast methods now return a Toast object 3e93210 Move pull to refresh to Utils b302b44 Move ToastUtils to Utils a0e973c document getPrimaryEmail method d68fb87 add getCircularBitmap and getRoundedEdgeBitmap from the main project merge in 80014b7 d2a76e2 avoid build failure when gradle.properties file is missing 5d683f6 use maven plugin to deploy maven artifact 70a91cb bump version number to 1.0.1 575579d gitignore tools/deploy-mvn-artifact.conf 50f2c80 maven deploying script cf85e19 ignore .idea and local.properties 7c6d4f4 add WPImageGetter and fix HtmlUtils b4baff8 remove crashlytics reference from Utils 32e98a9 merge from WordPress-Android@1a74364d0 79b7014 gitignore all build/ directories c9e6b52 Restores query separator period in `JSONUtils`. fddb5a0 Ignoring iml files 4263343 Initial commit of utils classes. 0228ac4 Fix package id name 826c265 Move java source to correct directory a528b8e Initial Project Structure git-subtree-dir: libs/editor git-subtree-split: 86805a0
0 parents  commit add8d90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4190
-0
lines changed

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# generated files
2+
build/
3+
4+
# Local configuration file (sdk path, etc)
5+
local.properties
6+
tools/deploy-mvn-artifact.conf
7+
8+
# Intellij project files
9+
*.iml
10+
*.ipr
11+
*.iws
12+
.idea/
13+
14+
# Gradle
15+
.gradle/
16+
gradle.properties
17+
18+
# Idea
19+
.idea/workspace.xml
20+
*.iml
21+
22+
# OS X
23+
.DS_Store
24+
25+
# dependencies

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# WordPress-Utils-Android
2+
3+
Part of the [WordPress-Android] project.
4+
5+
[WordPress-Android]: https://github.com/wordpress-mobile/WordPress-Android

WordPressUtils/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# org.wordpress.android.util

WordPressUtils/build.gradle

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
buildscript {
3+
repositories {
4+
mavenCentral()
5+
}
6+
dependencies {
7+
classpath 'com.android.tools.build:gradle:1.0.0'
8+
}
9+
}
10+
11+
apply plugin: 'com.android.library'
12+
apply plugin: 'maven'
13+
14+
repositories {
15+
mavenCentral()
16+
maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
17+
}
18+
19+
dependencies {
20+
compile 'commons-lang:commons-lang:2.6'
21+
compile 'com.mcxiaoke.volley:library:1.0.+'
22+
compile 'com.android.support:support-v13:21.0.+'
23+
}
24+
25+
android {
26+
publishNonDefault true
27+
28+
compileSdkVersion 19
29+
buildToolsVersion "21.1.1"
30+
31+
defaultConfig {
32+
versionName "1.2.0"
33+
minSdkVersion 14
34+
targetSdkVersion 19
35+
}
36+
}
37+
38+
uploadArchives {
39+
repositories {
40+
mavenDeployer {
41+
def repo_url = ""
42+
if (project.hasProperty("repository")) {
43+
repo_url = project.repository
44+
}
45+
repository(url: repo_url)
46+
pom.version = android.defaultConfig.versionName
47+
pom.groupId = "org.wordpress"
48+
pom.artifactId = "wordpress-utils"
49+
}
50+
}
51+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repository=file:///Users/max/work/automattic/WordPress-Android-gh-pages/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="org.wordpress.android.util">
4+
5+
</manifest>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package org.wordpress.android.util;
2+
3+
import android.app.Activity;
4+
import android.content.Context;
5+
import android.view.inputmethod.InputMethodManager;
6+
7+
public class ActivityUtils {
8+
public static void hideKeyboard(Activity activity) {
9+
if (activity != null && activity.getCurrentFocus() != null) {
10+
InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(
11+
Context.INPUT_METHOD_SERVICE);
12+
inputManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(),
13+
InputMethodManager.HIDE_NOT_ALWAYS);
14+
}
15+
}
16+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* Copyright (C) 2011 wordpress.org
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.wordpress.android.util;
18+
19+
import android.app.AlertDialog;
20+
import android.app.Dialog;
21+
import android.content.Context;
22+
import android.content.DialogInterface;
23+
24+
public class AlertUtil {
25+
/**
26+
* Show Alert Dialog
27+
* @param context
28+
* @param titleId
29+
* @param messageId
30+
*/
31+
public static void showAlert(Context context, int titleId, int messageId) {
32+
Dialog dlg = new AlertDialog.Builder(context)
33+
.setTitle(titleId)
34+
.setPositiveButton(android.R.string.ok, null)
35+
.setMessage(messageId)
36+
.create();
37+
38+
dlg.show();
39+
}
40+
41+
/**
42+
* Show Alert Dialog
43+
* @param context
44+
* @param titleId
45+
* @param messageId
46+
*/
47+
public static void showAlert(Context context, int titleId, String message) {
48+
Dialog dlg = new AlertDialog.Builder(context)
49+
.setTitle(titleId)
50+
.setPositiveButton(android.R.string.ok, null)
51+
.setMessage(message)
52+
.create();
53+
54+
dlg.show();
55+
}
56+
57+
/**
58+
* Show Alert Dialog
59+
* @param context
60+
* @param titleId
61+
* @param messageId
62+
* @param positiveButtontxt
63+
* @param positiveListener
64+
* @param negativeButtontxt
65+
* @param negativeListener
66+
*/
67+
public static void showAlert(Context context, int titleId, int messageId,
68+
CharSequence positiveButtontxt, DialogInterface.OnClickListener positiveListener,
69+
CharSequence negativeButtontxt, DialogInterface.OnClickListener negativeListener) {
70+
Dialog dlg = new AlertDialog.Builder(context)
71+
.setTitle(titleId)
72+
.setPositiveButton(positiveButtontxt, positiveListener)
73+
.setNegativeButton(negativeButtontxt, negativeListener)
74+
.setMessage(messageId)
75+
.setCancelable(false)
76+
.create();
77+
78+
dlg.show();
79+
}
80+
81+
/**
82+
* Show Alert Dialog
83+
* @param context
84+
* @param titleId
85+
* @param messageId
86+
* @param positiveButtontxt
87+
* @param positiveListener
88+
*/
89+
public static void showAlert(Context context, int titleId, String message,
90+
CharSequence positiveButtontxt, DialogInterface.OnClickListener positiveListener) {
91+
Dialog dlg = new AlertDialog.Builder(context)
92+
.setTitle(titleId)
93+
.setPositiveButton(positiveButtontxt, positiveListener)
94+
.setMessage(message)
95+
.setCancelable(false)
96+
.create();
97+
98+
dlg.show();
99+
}
100+
}
101+

0 commit comments

Comments
 (0)