Browse Source

提交1.0.2版本,将android support转成androidx支持,并将Maven库存放到个人服务器上

yanyi 5 years ago
parent
commit
733cc9fad1

BIN
.idea/caches/build_file_checksums.ser


+ 0 - 19
.idea/gradle.xml

@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="GradleSettings">
-    <option name="linkedExternalProjectsSettings">
-      <GradleProjectSettings>
-        <option name="distributionType" value="DEFAULT_WRAPPED" />
-        <option name="externalProjectPath" value="$PROJECT_DIR$" />
-        <option name="modules">
-          <set>
-            <option value="$PROJECT_DIR$" />
-            <option value="$PROJECT_DIR$/app" />
-            <option value="$PROJECT_DIR$/datelib" />
-          </set>
-        </option>
-        <option name="resolveModulePerSourceSet" value="false" />
-      </GradleProjectSettings>
-    </option>
-  </component>
-</project>

+ 0 - 36
.idea/inspectionProfiles/Project_Default.xml

@@ -1,36 +0,0 @@
-<component name="InspectionProjectProfileManager">
-  <profile version="1.0">
-    <option name="myName" value="Project Default" />
-    <inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
-      <option name="TOP_LEVEL_CLASS_OPTIONS">
-        <value>
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
-          <option name="REQUIRED_TAGS" value="" />
-        </value>
-      </option>
-      <option name="INNER_CLASS_OPTIONS">
-        <value>
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
-          <option name="REQUIRED_TAGS" value="" />
-        </value>
-      </option>
-      <option name="METHOD_OPTIONS">
-        <value>
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
-          <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
-        </value>
-      </option>
-      <option name="FIELD_OPTIONS">
-        <value>
-          <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
-          <option name="REQUIRED_TAGS" value="" />
-        </value>
-      </option>
-      <option name="IGNORE_DEPRECATED" value="false" />
-      <option name="IGNORE_JAVADOC_PERIOD" value="true" />
-      <option name="IGNORE_DUPLICATED_THROWS" value="false" />
-      <option name="IGNORE_POINT_TO_ITSELF" value="false" />
-      <option name="myAdditionalJavadocTags" value="date,e-mail,overview" />
-    </inspection_tool>
-  </profile>
-</component>

+ 0 - 34
.idea/misc.xml

@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="NullableNotNullManager">
-    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
-    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
-    <option name="myNullables">
-      <value>
-        <list size="5">
-          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
-          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
-          <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
-          <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
-          <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
-        </list>
-      </value>
-    </option>
-    <option name="myNotNulls">
-      <value>
-        <list size="4">
-          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
-          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
-          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
-          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
-        </list>
-      </value>
-    </option>
-  </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
-    <output url="file://$PROJECT_DIR$/build/classes" />
-  </component>
-  <component name="ProjectType">
-    <option name="id" value="Android" />
-  </component>
-</project>

+ 0 - 10
.idea/modules.xml

@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ProjectModuleManager">
-    <modules>
-      <module fileurl="file://$PROJECT_DIR$/DateSelect.iml" filepath="$PROJECT_DIR$/DateSelect.iml" />
-      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
-      <module fileurl="file://$PROJECT_DIR$/datelib/datelib.iml" filepath="$PROJECT_DIR$/datelib/datelib.iml" />
-    </modules>
-  </component>
-</project>

+ 0 - 12
.idea/runConfigurations.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RunConfigurationProducerService">
-    <option name="ignoredProducers">
-      <set>
-        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
-        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
-        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
-      </set>
-    </option>
-  </component>
-</project>

+ 0 - 6
.idea/vcs.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$" vcs="Git" />
-  </component>
-</project>

+ 68 - 49
README.md

@@ -3,60 +3,79 @@
 
 ## 使用方法
 
-#### module 下添加
-
-     compile 'com.yanyi.benyanyi:datelib:1.0.1'
+### 根目录下build.gradle添加Maven地址
+~~~
+repositories {
+        maven {
+            url "http://maven.yanyi.online:8081/nexus/content/repositories/mylove/"
+        }
+    }
+~~~
+### module 下添加
+~~~
+implementation 'com.yanyi.benyanyi:DateSelect:1.0.2'
+~~~
 
-* 1.0.1版本
+或者
+~~~
+<dependency>
+  <groupId>com.yanyi.benyanyi</groupId>
+  <artifactId>DateSelect</artifactId>
+  <version>1.0.2</version>
+  <type>aar</type>
+</dependency>
+~~~
+### 1.0.1版本
+#### SelectPeriod添加是否进行时间判断
+~~~
+SelectPeriod(Context context, SelectType selectType, boolean judgmentTime)
+SelectData selectData = new SelectData(this,selectType);
+~~~
+其余与1.0.0版本一样
 
-      SelectPeriod添加是否进行时间判断<br/>
-      SelectPeriod(Context context, SelectType selectType, boolean judgmentTime)
-    
-      SelectData selectData = new SelectData(this,selectType);
-    
-      其余与1.0.0版本一样
-    
-      SelectType 表示需要隐藏的段落
-    
-      /**
-       * 不隐藏,隐藏时,隐藏分
-      */
-      NONE, HOUR, MIN  
-     
-      添加SelectPeriod(时间段选择,结束时间需大于开始时间,且不能大于当前时间)
-      SelectPeriod selectPeriod = new SelectPeriod(mContext);
-      selectPeriod.showAtLocation(view, Gravity.BOTTOM, 0, 0);
-      selectPeriod.setOnDateClickListener(new SelectPeriod.OnDateClickListener() {
-          @Override
-          public void onDateClickListener(String startTime, String endTime) {
+#### SelectType 表示需要隐藏的段落
+* NONE 不隐藏
+* HOUR 隐藏时
+* MIN 隐藏分
+##### 添加SelectPeriod(时间段选择,结束时间需大于开始时间,且不能大于当前时间)
+~~~
+SelectPeriod selectPeriod = new SelectPeriod(mContext);
+selectPeriod.showAtLocation(view, Gravity.BOTTOM, 0, 0);
+selectPeriod.setOnDateClickListener(new SelectPeriod.OnDateClickListener() {
+    @Override
+    public void onDateClickListener(String startTime, String endTime) {
                      
-          }
-      });
-    
-* 1.0.0版本
-##### 带时间的选择器
-    SelectData selectData = new SelectData(this);
-    selectData.showAtLocation(but, Gravity.BOTTOM, 0, 0);
-    selectData.setDateClickListener(new SelectData.OnDateClickListener() {
-        @Override
-        public void onClick(String year, String month, String day, String hour, String minute) {
-            Toast.makeText(MainActivity.this, year + "-" + month + "-" + day + " " + hour + ":" + minute, Toast.LENGTH_SHORT).show();
-        }
-    });
-##### 不带时间的选择器
-    SelectData selectData = new SelectData(this,false);
-    selectData.showAtLocation(but, Gravity.BOTTOM, 0, 0);
-    selectData.setDateClickListener(new SelectData.OnDateClickListener() {
-        @Override
-        public void onClick(String year, String month, String day, String hour, String minute) {
-            Toast.makeText(MainActivity.this, year + "-" + month + "-" + day , Toast.LENGTH_SHORT).show();
-        }
-    });
-
-### 更新记录
+    }
+});
+~~~
+### 1.0.0版本
+#### 带时间的选择器
+~~~
+SelectData selectData = new SelectData(this);
+selectData.showAtLocation(but, Gravity.BOTTOM, 0, 0);
+selectData.setDateClickListener(new SelectData.OnDateClickListener() {
+    @Override
+    public void onClick(String year, String month, String day, String hour, String minute) {
+       Toast.makeText(MainActivity.this, year + "-" + month + "-" + day + " " + hour + ":" + minute, Toast.LENGTH_SHORT).show();
+    }
+});
+~~~
+#### 不带时间的选择器
+~~~
+SelectData selectData = new SelectData(this,false);
+selectData.showAtLocation(but, Gravity.BOTTOM, 0, 0);
+selectData.setDateClickListener(new SelectData.OnDateClickListener() {
+    @Override
+    public void onClick(String year, String month, String day, String hour, String minute) {
+        Toast.makeText(MainActivity.this, year + "-" + month + "-" + day , Toast.LENGTH_SHORT).show();
+    }
+});
+~~~
+## 更新记录
+* 2020-05-18 提交1.0.2版本,将android support转成androidx支持,并将Maven库存放到个人服务器上
 * 2019-06-12 提交1.0.1版本,优化一些已知细节,变更包名,开源库包名进行统一
 * 2018-06-09 提交1.0.0版本
-
+---
 <br/>
 若在使用过程中出现什么问题,可以联系作者<br/>
 作者:演绎<br/>

+ 7 - 7
app/build.gradle

@@ -1,14 +1,14 @@
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 29
     defaultConfig {
         applicationId "com.yanyi.dateselect"
         minSdkVersion 15
-        targetSdkVersion 26
+        targetSdkVersion 29
         versionCode 1
         versionName "1.0"
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
         release {
@@ -20,9 +20,9 @@ android {
 
 dependencies {
     implementation fileTree(include: ['*.jar'], dir: 'libs')
-    implementation 'com.android.support:appcompat-v7:26.1.0'
-    testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'com.android.support.test:runner:1.0.1'
-    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+    implementation 'androidx.appcompat:appcompat:1.1.0'
+    testImplementation 'junit:junit:4.13'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
     implementation project(':datelib')
 }

+ 2 - 2
app/src/androidTest/java/com/yanyi/dateselect/ExampleInstrumentedTest.java

@@ -1,8 +1,8 @@
 package com.yanyi.dateselect;
 
 import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;

+ 2 - 2
app/src/main/java/com/yanyi/dateselect/MainActivity.java

@@ -2,8 +2,8 @@ package com.yanyi.dateselect;
 
 import android.content.Context;
 import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.app.AppCompatActivity;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.View;

+ 15 - 3
build.gradle

@@ -1,15 +1,16 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 
 buildscript {
-    
+
     repositories {
         google()
         jcenter()
+        maven { url 'http://maven.yanyi.online:8081/nexus/content/repositories/mylove/' }
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:3.2.1'
         classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
-        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
+//        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
@@ -21,7 +22,18 @@ allprojects {
         google()
         jcenter()
         maven {
-            url 'https://jitpack.io'
+            url 'http://www.idescout.com/maven/repo/'
+            name 'IDEScout, Inc.'
+        }
+        //解决中文乱码问题
+        tasks.withType(Javadoc) { //兼容中文
+            options.addStringOption('Xdoclint:none', '-quiet')
+            options.addStringOption('encoding', 'UTF-8')
+            options {
+                encoding "UTF-8"
+                charSet 'UTF-8'
+                links "http://docs.oracle.com/javase/7/docs/api"
+            }
         }
     }
 }

+ 15 - 67
datelib/bintrayUpload.gradle

@@ -1,80 +1,28 @@
-// 这里添加下面两行代码。
-apply plugin: 'com.github.dcendents.android-maven'
-apply plugin: 'com.jfrog.bintray'
+apply plugin: 'maven-publish'
+apply plugin: 'maven'
 
-// 定义两个链接,下面会用到。
-def siteUrl = 'http://www.yanyis.space/yanyi/dateselect' // 项目主页。
-def gitUrl = 'http://www.yanyis.space/yanyi/dateselect.git' // Git仓库的url。
+Properties properties = new Properties()
+properties.load(project.rootProject.file('local.properties').newDataInputStream())
+uploadArchives {
+    repositories {
+        mavenDeployer {
+            repository(url: properties.getProperty("POM_URL")) {
+                authentication(userName: properties.getProperty("nexus.user"), password: properties.getProperty("nexus.password"))
+            }
 
-group = "com.yanyi.benyanyi"// 唯一包名,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的com.ansen.http就是这里配置的。
-version = "1.0.1"//项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
-install {
-    repositories.mavenInstaller {
-        // This generates POM.xml with proper parameters
-        pom {
-            project {
-                packaging 'aar'
-                // Add your description here
-                name 'multi-format 1D/2D barcode image processing use zxing.'
-                url siteUrl
-                // Set your license
+            pom.groupId = properties.getProperty("POM_GROUP_ID")
+            pom.artifactId = properties.getProperty("POM_ATRIFACT_ID")
+            pom.version = properties.getProperty("POM_VERSION")
+
+            pom.project {
                 licenses {
                     license {
                         name 'The Apache Software License, Version 2.0'
                         url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                     }
                 }
-                developers {
-                    developer {
-                        id 'benyanyi'     //填写的一些基本信息
-                        name 'benyanyi'
-                        email 'git@yanyi.red'
-                    }
-                }
-                scm {
-                    connection gitUrl
-                    developerConnection gitUrl
-                    url siteUrl
-                }
             }
         }
     }
 }
-task sourcesJar(type: Jar) {
-    from android.sourceSets.main.java.srcDirs
-    classifier = 'sources'
-}
-task javadoc(type: Javadoc) {
-    source = android.sourceSets.main.java.srcDirs
-    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
-}
-task javadocJar(type: Jar, dependsOn: javadoc) {
-    classifier = 'javadoc'
-    from javadoc.destinationDir
-}
-artifacts {
-    archives javadocJar
-    archives sourcesJar
-}
-Properties properties = new Properties()
-properties.load(project.rootProject.file('local.properties').newDataInputStream())
-bintray {
-    user = properties.getProperty("bintray.user")
-    key = properties.getProperty("bintray.apikey")
-    configurations = ['archives']
-    pkg {
-        repo = "DateSelect"
-        name = "DateSelect"   //发布到JCenter上的项目名字
-        websiteUrl = siteUrl
-        vcsUrl = gitUrl
-        licenses = ["Apache-2.0"]
-        publish = true
-    }
-}
-javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
-    options {
-        encoding "UTF-8"
-        charSet 'UTF-8'
-    }
-}
 //gradlew bintrayUpload    terminal中输入

+ 7 - 7
datelib/build.gradle

@@ -1,17 +1,17 @@
 apply plugin: 'com.android.library'
 
 android {
-    compileSdkVersion 26
+    compileSdkVersion 29
 
 
 
     defaultConfig {
         minSdkVersion 15
-        targetSdkVersion 26
+        targetSdkVersion 29
         versionCode 1
         versionName "1.0"
 
-        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 
     }
 
@@ -27,9 +27,9 @@ android {
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
 
-    implementation 'com.android.support:appcompat-v7:26.1.0'
-    testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'com.android.support.test:runner:1.0.1'
-    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
+    implementation 'androidx.appcompat:appcompat:1.1.0'
+    testImplementation 'junit:junit:4.13'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
 }
 apply from: 'bintrayUpload.gradle'

+ 2 - 2
datelib/src/androidTest/java/com/yanyi/datelib/ExampleInstrumentedTest.java

@@ -1,8 +1,8 @@
 package com.yanyi.datelib;
 
 import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
 
 import org.junit.Test;
 import org.junit.runner.RunWith;

+ 0 - 1
datelib/src/main/java/com/benyanyi/datelib/SelectData.java

@@ -14,7 +14,6 @@ import com.benyanyi.datelib.wheelview.AbstractWheelTextAdapter1;
 import com.benyanyi.datelib.wheelview.OnWheelChangedListener;
 import com.benyanyi.datelib.wheelview.OnWheelScrollListener;
 import com.benyanyi.datelib.wheelview.WheelView;
-import com.yanyi.datelib.R;
 
 import org.json.JSONObject;
 

+ 0 - 1
datelib/src/main/java/com/benyanyi/datelib/SelectPeriod.java

@@ -16,7 +16,6 @@ import com.benyanyi.datelib.wheelview.AbstractWheelTextAdapter1;
 import com.benyanyi.datelib.wheelview.OnWheelChangedListener;
 import com.benyanyi.datelib.wheelview.OnWheelScrollListener;
 import com.benyanyi.datelib.wheelview.WheelView;
-import com.yanyi.datelib.R;
 
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;

+ 2 - 2
datelib/src/main/java/com/benyanyi/datelib/wheelview/WheelView.java

@@ -27,7 +27,7 @@ import android.graphics.Paint;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.GradientDrawable;
 import android.graphics.drawable.GradientDrawable.Orientation;
-import android.support.v4.content.ContextCompat;
+import androidx.core.content.ContextCompat;
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.view.View;
@@ -35,7 +35,7 @@ import android.view.ViewGroup.LayoutParams;
 import android.view.animation.Interpolator;
 import android.widget.LinearLayout;
 
-import com.yanyi.datelib.R;
+import com.benyanyi.datelib.R;
 
 import java.util.LinkedList;
 import java.util.List;

+ 2 - 0
gradle.properties

@@ -9,6 +9,8 @@
 
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
+android.enableJetifier=true
+android.useAndroidX=true
 org.gradle.jvmargs=-Xmx1536m
 
 # When configured, Gradle will run in incubating parallel mode.