Skip to content

Commit

Permalink
Squashed 'libs/editor/' changes from fc65662..86805a0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
maxme committed Feb 4, 2015
0 parents commit add8d90
Show file tree
Hide file tree
Showing 50 changed files with 4,190 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# generated files
build/

# Local configuration file (sdk path, etc)
local.properties
tools/deploy-mvn-artifact.conf

# Intellij project files
*.iml
*.ipr
*.iws
.idea/

# Gradle
.gradle/
gradle.properties

# Idea
.idea/workspace.xml
*.iml

# OS X
.DS_Store

# dependencies
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WordPress-Utils-Android

Part of the [WordPress-Android] project.

[WordPress-Android]: https://github.com/wordpress-mobile/WordPress-Android
1 change: 1 addition & 0 deletions WordPressUtils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# org.wordpress.android.util
51 changes: 51 additions & 0 deletions WordPressUtils/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}

apply plugin: 'com.android.library'
apply plugin: 'maven'

repositories {
mavenCentral()
maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
}

dependencies {
compile 'commons-lang:commons-lang:2.6'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.android.support:support-v13:21.0.+'
}

android {
publishNonDefault true

compileSdkVersion 19
buildToolsVersion "21.1.1"

defaultConfig {
versionName "1.2.0"
minSdkVersion 14
targetSdkVersion 19
}
}

uploadArchives {
repositories {
mavenDeployer {
def repo_url = ""
if (project.hasProperty("repository")) {
repo_url = project.repository
}
repository(url: repo_url)
pom.version = android.defaultConfig.versionName
pom.groupId = "org.wordpress"
pom.artifactId = "wordpress-utils"
}
}
}
1 change: 1 addition & 0 deletions WordPressUtils/gradle.properties-example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repository=file:///Users/max/work/automattic/WordPress-Android-gh-pages/
5 changes: 5 additions & 0 deletions WordPressUtils/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.wordpress.android.util">

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.wordpress.android.util;

import android.app.Activity;
import android.content.Context;
import android.view.inputmethod.InputMethodManager;

public class ActivityUtils {
public static void hideKeyboard(Activity activity) {
if (activity != null && activity.getCurrentFocus() != null) {
InputMethodManager inputManager = (InputMethodManager) activity.getSystemService(
Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
101 changes: 101 additions & 0 deletions WordPressUtils/src/main/java/org/wordpress/android/util/AlertUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Copyright (C) 2011 wordpress.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.wordpress.android.util;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;

public class AlertUtil {
/**
* Show Alert Dialog
* @param context
* @param titleId
* @param messageId
*/
public static void showAlert(Context context, int titleId, int messageId) {
Dialog dlg = new AlertDialog.Builder(context)
.setTitle(titleId)
.setPositiveButton(android.R.string.ok, null)
.setMessage(messageId)
.create();

dlg.show();
}

/**
* Show Alert Dialog
* @param context
* @param titleId
* @param messageId
*/
public static void showAlert(Context context, int titleId, String message) {
Dialog dlg = new AlertDialog.Builder(context)
.setTitle(titleId)
.setPositiveButton(android.R.string.ok, null)
.setMessage(message)
.create();

dlg.show();
}

/**
* Show Alert Dialog
* @param context
* @param titleId
* @param messageId
* @param positiveButtontxt
* @param positiveListener
* @param negativeButtontxt
* @param negativeListener
*/
public static void showAlert(Context context, int titleId, int messageId,
CharSequence positiveButtontxt, DialogInterface.OnClickListener positiveListener,
CharSequence negativeButtontxt, DialogInterface.OnClickListener negativeListener) {
Dialog dlg = new AlertDialog.Builder(context)
.setTitle(titleId)
.setPositiveButton(positiveButtontxt, positiveListener)
.setNegativeButton(negativeButtontxt, negativeListener)
.setMessage(messageId)
.setCancelable(false)
.create();

dlg.show();
}

/**
* Show Alert Dialog
* @param context
* @param titleId
* @param messageId
* @param positiveButtontxt
* @param positiveListener
*/
public static void showAlert(Context context, int titleId, String message,
CharSequence positiveButtontxt, DialogInterface.OnClickListener positiveListener) {
Dialog dlg = new AlertDialog.Builder(context)
.setTitle(titleId)
.setPositiveButton(positiveButtontxt, positiveListener)
.setMessage(message)
.setCancelable(false)
.create();

dlg.show();
}
}

Loading

0 comments on commit add8d90

Please sign in to comment.