From 02dda3a0d66606ce6c2baf4ba85c909f5822587f Mon Sep 17 00:00:00 2001 From: andy7076 Date: Sat, 10 Jun 2017 10:11:07 +0800 Subject: [PATCH] commit --- app/build.gradle | 9 +++++---- .../java/com/andy7/myviewdemo/MySpinnerActivity.java | 6 +----- .../com/andy7/myviewdemo/adapter/MySpinnerAdapter.java | 8 ++------ build.gradle | 1 + 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9f1d8aa..03c9540 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,10 +1,12 @@ -apply plugin: 'com.android.application' +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +group='com.github.autotrans' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { - applicationId "com.andy7.myviewdemo" minSdkVersion 19 targetSdkVersion 25 versionCode 1 @@ -26,8 +28,7 @@ dependencies { }) compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support.constraint:constraint-layout:1.0.1' - compile 'com.jakewharton:butterknife:8.6.0' - annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' testCompile 'junit:junit:4.12' compile 'com.android.support:recyclerview-v7:25.0.1' + } diff --git a/app/src/main/java/com/andy7/myviewdemo/MySpinnerActivity.java b/app/src/main/java/com/andy7/myviewdemo/MySpinnerActivity.java index 3359cb2..3945429 100644 --- a/app/src/main/java/com/andy7/myviewdemo/MySpinnerActivity.java +++ b/app/src/main/java/com/andy7/myviewdemo/MySpinnerActivity.java @@ -8,12 +8,8 @@ import java.util.HashMap; -import butterknife.BindView; -import butterknife.ButterKnife; - public class MySpinnerActivity extends AppCompatActivity { - @BindView(R.id.myspinner) MySpinner myspinner; private HashMap hashMap; @@ -24,7 +20,7 @@ public class MySpinnerActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my_spinner); - ButterKnife.bind(this); + myspinner = (MySpinner) findViewById(R.id.myspinner); hashMap = new HashMap<>(); hashMap.put(1, "GREEN"); hashMap.put(2, "RED"); diff --git a/app/src/main/java/com/andy7/myviewdemo/adapter/MySpinnerAdapter.java b/app/src/main/java/com/andy7/myviewdemo/adapter/MySpinnerAdapter.java index d74afff..39774ed 100644 --- a/app/src/main/java/com/andy7/myviewdemo/adapter/MySpinnerAdapter.java +++ b/app/src/main/java/com/andy7/myviewdemo/adapter/MySpinnerAdapter.java @@ -12,9 +12,6 @@ import java.util.List; -import butterknife.BindView; -import butterknife.ButterKnife; - /** * BeforeSaleFragment中的RecyclerAdapters * Created by andy7 on 2017/3/17. @@ -60,14 +57,13 @@ public int getItemCount() { class MyViewHolder extends RecyclerView.ViewHolder { - @BindView(R.id.txt_item_myspinner) TextView txtItemMyspinner; - @BindView(R.id.container_item_myspinner) LinearLayout containerItemMyspinner; public MyViewHolder(View itemView) { super(itemView); - ButterKnife.bind(this, itemView); + txtItemMyspinner = (TextView) itemView.findViewById(R.id.txt_item_myspinner); + containerItemMyspinner = (LinearLayout) itemView.findViewById(R.id.container_item_myspinner); } } diff --git a/build.gradle b/build.gradle index d0aa704..0ecd762 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files