Skip to content

Commit

Permalink
Merge pull request #4 from wordpress-mobile/issue/git-subtree-ftw
Browse files Browse the repository at this point in the history
git subtree ftw
  • Loading branch information
roundhill committed Jul 25, 2014
2 parents bb73605 + 7e59502 commit 5d8f6d3
Show file tree
Hide file tree
Showing 93 changed files with 5,752 additions and 28 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ gradle.properties

# OS X
.DS_Store

# dependencies
libs
19 changes: 6 additions & 13 deletions WordPressNetworking/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,14 @@ android {
}
}

wordpress {
utils {
repo 'WordPress-Utils-Android'
subproject 'WordPressUtils'
artifact 'org.wordpress:wordpress-utils:1.0.+'
}
wpcomrest {
repo 'Automattic/android-wordpress-com-rest'
subproject 'WordPressComRest'
artifact 'com.automattic:wordpresscom-rest:1.0.0'
}
}

dependencies {
compile 'com.mcxiaoke.volley:library:1.0.+'

debugCompile project(path:':libs:utils:WordPressUtils')
releaseCompile 'org.wordpress:wordpress-utils:1.0.2'

debugCompile project(path:':libs:wpcomrest:WordPressComRest')
releaseCompile 'com.automattic:wordpresscom-rest:1.0.0'
}

uploadArchives {
Expand Down
12 changes: 0 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +0,0 @@
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.automattic.android:gradle-wordpresslibraries:1.+'
}
}

allprojects {
apply plugin:'wordpress'
}
25 changes: 25 additions & 0 deletions libs/utils/.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
55 changes: 55 additions & 0 deletions libs/utils/WordPressUtils/build.gradle
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"
}
}
}
1 change: 1 addition & 0 deletions libs/utils/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 libs/utils/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,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 5d8f6d3

Please sign in to comment.