-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Develop' into 'notifications-redesign'
- Loading branch information
0 parents
commit 063b50c
Showing
45 changed files
with
3,884 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:0.12.+' | ||
} | ||
} | ||
|
||
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.github.castorflex.smoothprogressbar:library:0.4.0' | ||
compile 'org.wordpress:pulltorefresh-main:+@aar' // org.wordpress version includes some fixes | ||
compile 'com.android.support:support-v13:19.0.+' | ||
} | ||
|
||
android { | ||
defaultPublishConfig 'debug' | ||
|
||
compileSdkVersion 19 | ||
buildToolsVersion "19.1.0" | ||
|
||
defaultConfig { | ||
applicationId "org.wordpress.android.util" | ||
versionName "1.0.2" | ||
versionCode 1 | ||
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" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
repository=file:///Users/max/work/automattic/WordPress-Android-gh-pages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
101 changes: 101 additions & 0 deletions
101
WordPressUtils/src/main/java/org/wordpress/android/util/AlertUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
|
Oops, something went wrong.