Skip to content

Commit 53e005a

Browse files
author
YOOJIA.CHEN
committed
Merge branch 'develop'
2 parents 2847bbd + 827bf0d commit 53e005a

11 files changed

Lines changed: 265 additions & 114 deletions

File tree

supports/build.gradle

Lines changed: 133 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
buildscript {
22
repositories {
33
jcenter()
4+
mavenCentral()
45
}
56
dependencies {
6-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
7-
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1"
7+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
88
}
99
}
1010

11+
plugins {
12+
id "com.jfrog.bintray" version "1.6"
13+
}
14+
15+
repositories {
16+
jcenter()
17+
}
18+
1119
apply plugin: 'com.android.library'
1220

1321
android {
@@ -31,10 +39,130 @@ repositories {
3139
dependencies {
3240

3341
testCompile 'junit:junit:4.12'
34-
testCompile 'org.mockito:mockito-core:1.10.19'
35-
testCompile 'org.robolectric:robolectric:3.0'
3642

3743
compile 'com.android.support:support-annotations:23.0.1'
3844
}
3945

40-
apply from: 'https://raw.githubusercontent.com/yoojia/Gradles/master/android.gradle'
46+
47+
ext{
48+
projVersion = '2.2'
49+
projArtifactId = 'next-android'
50+
projName = 'NextAndroid'
51+
projDesc = 'NextAndroid: Tools, Widgets, Utils'
52+
projURL = "https://github.com/yoojia/NextAndroid"
53+
projVCS = "https://github.com/yoojia/NextAndroid.git"
54+
}
55+
56+
group 'com.github.yoojia'
57+
version projVersion
58+
project.archivesBaseName = projArtifactId
59+
60+
tasks.withType(JavaCompile) {
61+
options.encoding = 'UTF-8'
62+
}
63+
64+
apply plugin: 'com.github.dcendents.android-maven'
65+
66+
task androidSourcesJar(type: Jar) {
67+
from android.sourceSets.main.java.srcDirs
68+
classifier = 'sources'
69+
}
70+
71+
task javadoc(type: Javadoc) {
72+
source = android.sourceSets.main.java.srcDirs
73+
classpath += configurations.compile
74+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
75+
}
76+
77+
task androidJavadocJar(type: Jar, dependsOn: javadoc) {
78+
classifier = 'javadoc'
79+
from javadoc.destinationDir
80+
}
81+
82+
javadoc {
83+
options{
84+
encoding "UTF-8"
85+
charSet 'UTF-8'
86+
author true
87+
version true
88+
links "http://docs.oracle.com/javase/7/docs/api"
89+
title projName
90+
}
91+
}
92+
93+
artifacts {
94+
archives androidSourcesJar
95+
archives androidJavadocJar
96+
}
97+
98+
install {
99+
repositories.mavenInstaller {
100+
pom.project {
101+
name projName
102+
description projDesc
103+
url projURL
104+
inceptionYear '2016'
105+
106+
packaging 'aar'
107+
groupId 'com.github.yoojia'
108+
artifactId projArtifactId
109+
version projVersion
110+
111+
licenses {
112+
license {
113+
name 'The Apache Software License, Version 2.0'
114+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
115+
distribution 'repo'
116+
}
117+
}
118+
scm {
119+
connection projVCS
120+
url projURL
121+
122+
}
123+
developers {
124+
developer {
125+
id 'yoojia'
126+
name 'Yoojia Chen'
127+
email 'yoojiachen@gmail.com'
128+
url 'https://yoojia.github.io'
129+
}
130+
}
131+
}
132+
}
133+
}
134+
135+
bintray {
136+
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
137+
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
138+
configurations = ['archives']
139+
140+
dryRun = false
141+
publish = true
142+
143+
pkg {
144+
repo = 'maven'
145+
name = projName
146+
userOrg = 'yoojia'
147+
licenses = ['Apache-2.0']
148+
vcsUrl = projVCS
149+
version {
150+
name = projVersion
151+
desc = projDesc
152+
vcsTag = projVersion
153+
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
154+
155+
gpg {
156+
sign = true
157+
}
158+
159+
mavenCentralSync {
160+
sync = project.hasProperty('SONATYPE_USER') && project.hasProperty('SONATYPE_KEY')
161+
user = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : ""
162+
password = project.hasProperty('SONATYPE_PASS') ? project.property('SONATYPE_PASS') : ""
163+
close = '1'
164+
}
165+
}
166+
}
167+
}
168+

supports/gradle.properties

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<manifest package="com.github.yoojia.next.ext"/>
1+
<manifest package="com.github.yoojia.next"/>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package com.github.yoojia.next.system;
2+
3+
import android.app.Activity;
4+
import android.os.Handler;
5+
import android.os.Looper;
6+
import android.support.annotation.StringRes;
7+
import android.view.KeyEvent;
8+
import android.widget.Toast;
9+
10+
import java.util.concurrent.atomic.AtomicBoolean;
11+
12+
/**
13+
* @author YOOJIA.CHEN (yoojia.chen@gmail.com)
14+
* @since 2.1
15+
*/
16+
public class NextDoubleClick {
17+
18+
private final AtomicBoolean mWaitingSecond = new AtomicBoolean(false);
19+
private final Activity mContext;
20+
private final String mMessage;
21+
private final Handler mHandler = new Handler(Looper.getMainLooper());
22+
private final Runnable mResetWaiting = new Runnable() {
23+
@Override
24+
public void run() {
25+
mWaitingSecond.set(false);
26+
}
27+
};
28+
29+
private long mDoubleClickEscape = 2500;
30+
private OnDoubleClickListener mOnDoubleClickListener;
31+
32+
public NextDoubleClick(Activity context, String message) {
33+
mContext = context;
34+
mMessage = message;
35+
}
36+
37+
public NextDoubleClick(Activity context, @StringRes int confirmExitMsgResId) {
38+
this(context, context.getResources().getString(confirmExitMsgResId));
39+
}
40+
41+
/**
42+
* 接入Activity的onKeyDown方法
43+
* @param keyCode keyCode
44+
* @param event event
45+
*/
46+
public boolean onKeyDown(int keyCode, KeyEvent event){
47+
if(keyCode == KeyEvent.KEYCODE_BACK ) {
48+
if ( ! mWaitingSecond.get()) {
49+
mWaitingSecond.set(true);
50+
Toast.makeText(mContext, mMessage, Toast.LENGTH_SHORT).show();
51+
mHandler.postDelayed(mResetWaiting, mDoubleClickEscape);
52+
return true;
53+
}else{
54+
if (mOnDoubleClickListener != null) {
55+
mOnDoubleClickListener.onDoubleClick();
56+
}
57+
return false;
58+
}
59+
}else{
60+
return false; // Not back click
61+
}
62+
}
63+
64+
public void setDoubleClickEscape(long doubleClickEscape) {
65+
mDoubleClickEscape = doubleClickEscape;
66+
}
67+
68+
public void setOnDoubleClickListener(OnDoubleClickListener onDoubleClickListener) {
69+
mOnDoubleClickListener = onDoubleClickListener;
70+
}
71+
72+
public interface OnDoubleClickListener {
73+
void onDoubleClick();
74+
}
75+
}

supports/src/main/java/com/github/yoojia/next/system/NextExit.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

supports/src/main/java/com/github/yoojia/next/widget/NextActionbar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import android.widget.ImageButton;
1010
import android.widget.TextView;
1111

12-
import com.github.yoojia.next.ext.R;
12+
import com.github.yoojia.next.R;
1313

1414
/**
1515
* A simple ActionBar

supports/src/main/java/com/github/yoojia/next/widget/NextIconInputView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import android.widget.EditText;
1010
import android.widget.ImageView;
1111

12-
import com.github.yoojia.next.ext.R;
12+
import com.github.yoojia.next.R;
1313

1414
/**
1515
* @author 陈小锅 (yoojia.chen@gmail.com)

0 commit comments

Comments
 (0)