Browse Source

提交1.0.1版本,优化一些已知问题

yanyi 6 years ago
parent
commit
08c3977169

+ 2 - 1
README.md

@@ -4,7 +4,7 @@
 
 module 下添加
 
-    compile 'com.yanyi.benyanyi:viewbind:1.0.0'
+    implementation 'com.yanyi.benyanyi:viewbind:1.0.1'
     
 ### 使用方法
 
@@ -32,6 +32,7 @@ module 下添加
     
     
 ### 更新记录
+* 2019/05/29 提交1.0.1版本,优化一些已知细节
 * 2018/12/26 提交1.0.0版本
 
 <br/>

+ 0 - 0
gradlew


+ 1 - 1
viewbind/bintrayUpload.gradle

@@ -7,7 +7,7 @@ def siteUrl = 'https://github.com/BenYanYi/BindViewLib' // 项目主页。
 def gitUrl = 'https://github.com/BenYanYi/BindViewLib.git' // Git仓库的url。
 
 group = "com.yanyi.benyanyi"// 唯一包名,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的com.ansen.http就是这里配置的。
-version = "1.0.0"//项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
+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

+ 1 - 1
viewbind/src/main/java/com/mylove/viewbind/Exceptions.java

@@ -28,6 +28,6 @@ import java.lang.annotation.Target;
 //        ElementType.PACKAGE 作用于包
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)
-public @interface Exceptions {
+@interface Exceptions {
 
 }

+ 1 - 3
viewbind/src/main/java/com/mylove/viewbind/ViewBind.java

@@ -1,7 +1,6 @@
 package com.mylove.viewbind;
 
 import android.app.Activity;
-import android.util.Log;
 import android.view.View;
 
 /**
@@ -14,7 +13,6 @@ public class ViewBind {
 
     public static void bind(Activity activity) {
         bind(new ViewInit(activity), activity);
-        Log.v("测试", "点击0");
     }
 
     public static void bind(View view) {
@@ -28,6 +26,6 @@ public class ViewBind {
     private static void bind(ViewInit inject, Object object) {
         ViewInject.injectFiled(inject, object);
         ViewInject.injectClick(inject, object);
-        ViewInject.injectException(inject, object);
+//        ViewInject.injectException(inject, object);
     }
 }

+ 16 - 14
viewbind/src/main/java/com/mylove/viewbind/ViewInject.java

@@ -1,6 +1,5 @@
 package com.mylove.viewbind;
 
-import android.util.Log;
 import android.view.View;
 
 import java.lang.reflect.Field;
@@ -41,13 +40,12 @@ class ViewInject {
      */
     static void injectClick(ViewInit inject, Object object) {
         Class<?> aClass = object.getClass();
-        Method[] methods = aClass.getMethods();
+        Method[] methods = aClass.getDeclaredMethods();
         for (Method method : methods) {
-            Log.v("测试", "点击1");
             OnClick onClick = method.getAnnotation(OnClick.class);
             if (onClick != null) {
                 int[] values = onClick.value();
-                if (values != null && values.length > 0) {
+                if (values.length > 0) {
                     for (int value : values) {
                         View view = inject.find(value);
                         String netErrorMsg = "";
@@ -65,15 +63,19 @@ class ViewInject {
             }
         }
     }
+//    Mac⁩ ▸ ⁨应用程序⁩ ▸ ⁨Android Studio⁩ ▸ ⁨Contents⁩ ▸ ⁨gradle⁩
+//    #Gradle
+//    export GRADLE_HOME=/Applications/Android\ Studio.app/Contents/gradle/gradle-4.1
+//    export PATH=$PATH:$GRADLE_HOME/bin
 
-    static void injectException(ViewInit inject, Object object) {
-        Class<?> aClass = object.getClass();
-        Method[] methods = aClass.getMethods();
-        for (Method method : methods) {
-            Exceptions exceptions = method.getAnnotation(Exceptions.class);
-            if (exceptions != null) {
-
-            }
-        }
-    }
+//    static void injectException(ViewInit inject, Object object) {
+//        Class<?> aClass = object.getClass();
+//        Method[] methods = aClass.getMethods();
+//        for (Method method : methods) {
+//            Exceptions exceptions = method.getAnnotation(Exceptions.class);
+//            if (exceptions != null) {
+//
+//            }
+//        }
+//    }
 }