Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
YOOJIA.CHEN committed Apr 26, 2016
2 parents 2847bbd + 827bf0d commit 53e005a
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 114 deletions.
138 changes: 133 additions & 5 deletions supports/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}

plugins {
id "com.jfrog.bintray" version "1.6"
}

repositories {
jcenter()
}

apply plugin: 'com.android.library'

android {
Expand All @@ -31,10 +39,130 @@ repositories {
dependencies {

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.robolectric:robolectric:3.0'

compile 'com.android.support:support-annotations:23.0.1'
}

apply from: 'https://raw.githubusercontent.com/yoojia/Gradles/master/android.gradle'

ext{
projVersion = '2.2'
projArtifactId = 'next-android'
projName = 'NextAndroid'
projDesc = 'NextAndroid: Tools, Widgets, Utils'
projURL = "https://github.com/yoojia/NextAndroid"
projVCS = "https://github.com/yoojia/NextAndroid.git"
}

group 'com.github.yoojia'
version projVersion
project.archivesBaseName = projArtifactId

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

apply plugin: 'com.github.dcendents.android-maven'

task androidSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += configurations.compile
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

javadoc {
options{
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
title projName
}
}

artifacts {
archives androidSourcesJar
archives androidJavadocJar
}

install {
repositories.mavenInstaller {
pom.project {
name projName
description projDesc
url projURL
inceptionYear '2016'

packaging 'aar'
groupId 'com.github.yoojia'
artifactId projArtifactId
version projVersion

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
connection projVCS
url projURL

}
developers {
developer {
id 'yoojia'
name 'Yoojia Chen'
email '[email protected]'
url 'https://yoojia.github.io'
}
}
}
}
}

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
configurations = ['archives']

dryRun = false
publish = true

pkg {
repo = 'maven'
name = projName
userOrg = 'yoojia'
licenses = ['Apache-2.0']
vcsUrl = projVCS
version {
name = projVersion
desc = projDesc
vcsTag = projVersion
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']

gpg {
sign = true
}

mavenCentralSync {
sync = project.hasProperty('SONATYPE_USER') && project.hasProperty('SONATYPE_KEY')
user = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : ""
password = project.hasProperty('SONATYPE_PASS') ? project.property('SONATYPE_PASS') : ""
close = '1'
}
}
}
}

23 changes: 0 additions & 23 deletions supports/gradle.properties

This file was deleted.

2 changes: 1 addition & 1 deletion supports/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.github.yoojia.next.ext"/>
<manifest package="com.github.yoojia.next"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.github.yoojia.next.system;

import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.StringRes;
import android.view.KeyEvent;
import android.widget.Toast;

import java.util.concurrent.atomic.AtomicBoolean;

/**
* @author YOOJIA.CHEN ([email protected])
* @since 2.1
*/
public class NextDoubleClick {

private final AtomicBoolean mWaitingSecond = new AtomicBoolean(false);
private final Activity mContext;
private final String mMessage;
private final Handler mHandler = new Handler(Looper.getMainLooper());
private final Runnable mResetWaiting = new Runnable() {
@Override
public void run() {
mWaitingSecond.set(false);
}
};

private long mDoubleClickEscape = 2500;
private OnDoubleClickListener mOnDoubleClickListener;

public NextDoubleClick(Activity context, String message) {
mContext = context;
mMessage = message;
}

public NextDoubleClick(Activity context, @StringRes int confirmExitMsgResId) {
this(context, context.getResources().getString(confirmExitMsgResId));
}

/**
* 接入Activity的onKeyDown方法
* @param keyCode keyCode
* @param event event
*/
public boolean onKeyDown(int keyCode, KeyEvent event){
if(keyCode == KeyEvent.KEYCODE_BACK ) {
if ( ! mWaitingSecond.get()) {
mWaitingSecond.set(true);
Toast.makeText(mContext, mMessage, Toast.LENGTH_SHORT).show();
mHandler.postDelayed(mResetWaiting, mDoubleClickEscape);
return true;
}else{
if (mOnDoubleClickListener != null) {
mOnDoubleClickListener.onDoubleClick();
}
return false;
}
}else{
return false; // Not back click
}
}

public void setDoubleClickEscape(long doubleClickEscape) {
mDoubleClickEscape = doubleClickEscape;
}

public void setOnDoubleClickListener(OnDoubleClickListener onDoubleClickListener) {
mOnDoubleClickListener = onDoubleClickListener;
}

public interface OnDoubleClickListener {
void onDoubleClick();
}
}
53 changes: 0 additions & 53 deletions supports/src/main/java/com/github/yoojia/next/system/NextExit.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import android.widget.ImageButton;
import android.widget.TextView;

import com.github.yoojia.next.ext.R;
import com.github.yoojia.next.R;

/**
* A simple ActionBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import android.widget.EditText;
import android.widget.ImageView;

import com.github.yoojia.next.ext.R;
import com.github.yoojia.next.R;

/**
* @author 陈小锅 ([email protected])
Expand Down
Loading

0 comments on commit 53e005a

Please sign in to comment.