Skip to content

Commit

Permalink
[add jitpack io,fix #44]
Browse files Browse the repository at this point in the history
Signed-off-by: zyyoona7 <19671746@qq.com>
  • Loading branch information
zyyoona7 committed Dec 25, 2022
1 parent b1bc2d0 commit b46278b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 41 deletions.
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
//bintray release插件
classpath 'com.novoda:bintray-release:0.9.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.android.tools.build:gradle:3.6.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -22,7 +18,6 @@ allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven { url 'https://jitpack.io' }
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
34 changes: 18 additions & 16 deletions picker/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'maven-publish'

android {
compileSdkVersion 28
Expand All @@ -8,7 +8,7 @@ android {
minSdkVersion 16
targetSdkVersion 28
versionCode 12
versionName "1.1.1"
versionName "1.1.2"

}

Expand Down Expand Up @@ -39,17 +39,19 @@ dependencies {
api project(path: ':wheelview')
}

publish {
//bintray.com 用户名/组织名 user/org name
userOrg = 'zyyoona7'
//JCenter上显示的路径 path
groupId = 'com.github.zyyoona7'
//项目名称 project name
artifactId = 'pickerview'
//版本号 version code
publishVersion = '1.1.1'
//项目描述 description
desc = 'A smooth, highly customizable wheel view and picker view, support 3D effects like iOS. '
//项目网址链接 link
website = 'https://github.com/zyyoona7/WheelPicker'
}
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release

// You can then customize attributes of the publication as shown below.
groupId = 'com.github.zyyoona7'
artifactId = 'pickerview'
version = '1.1.2'
}
}
}
}
32 changes: 17 additions & 15 deletions wheelview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'maven-publish'

android {
compileSdkVersion 28
Expand All @@ -8,7 +8,7 @@ android {
minSdkVersion 16
targetSdkVersion 28
versionCode 10
versionName "1.0.9"
versionName "1.1.2"

}

Expand All @@ -26,17 +26,19 @@ dependencies {
compileOnly 'com.android.support:appcompat-v7:28.0.0'
}

publish {
//bintray.com 用户名/组织名 user/org name
userOrg = 'zyyoona7'
//JCenter上显示的路径 path
groupId = 'com.github.zyyoona7'
//项目名称 project name
artifactId = 'wheelview'
//版本号 version code
publishVersion = '1.0.9'
//项目描述 description
desc = 'A smooth, highly customizable wheel view and picker view, support 3D effects like iOS. '
//项目网址链接 link
website = 'https://github.com/zyyoona7/WheelPicker'
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "release".
release(MavenPublication) {
// Applies the component for the release build variant.
from components.release

// You can then customize attributes of the publication as shown below.
groupId = 'com.github.zyyoona7'
artifactId = 'wheelview'
version = '1.1.2'
}
}
}
}
6 changes: 3 additions & 3 deletions wheelview/src/main/java/com/zyyoona7/wheel/WheelView.java
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int realWidth = resolveSizeAndState(width, widthMeasureSpec, 0);
setMeasuredDimension(realWidth,
resolveSizeAndState(height, heightMeasureSpec, 0));
if (mMaxTextWidth > realWidth) {
if (realWidth > 0 && mMaxTextWidth > realWidth) {
mMaxTextWidth = realWidth - getPaddingLeft() - getPaddingRight();
}
}
Expand Down Expand Up @@ -1809,8 +1809,8 @@ public void setSelectedItemPosition(int position, boolean isSmoothScroll, int sm
int itemDistance = calculateItemDistance(position);
if (itemDistance == 0) {
//如果最开始设置了下标为0,则itemDistance==0
if (position!=mSelectedItemPosition) {
mSelectedItemPosition=position;
if (position != mSelectedItemPosition) {
mSelectedItemPosition = position;
//选中条目回调
if (mOnItemSelectedListener != null) {
mOnItemSelectedListener.onItemSelected(this, mDataList.get(mSelectedItemPosition), mSelectedItemPosition);
Expand Down

0 comments on commit b46278b

Please sign in to comment.