diff --git a/app/build.gradle b/app/build.gradle index c732d30..c88947a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 15 targetSdkVersion 22 versionCode 4 - versionName "1.1.1" + versionName "1.1.2" } buildTypes { release { diff --git a/app/src/main/java/com/chinaztt/fda/test/AnnotationsTestActivity.java b/app/src/main/java/com/chinaztt/fda/test/AnnotationsTestActivity.java index e27a62a..84a9ff4 100644 --- a/app/src/main/java/com/chinaztt/fda/test/AnnotationsTestActivity.java +++ b/app/src/main/java/com/chinaztt/fda/test/AnnotationsTestActivity.java @@ -7,7 +7,11 @@ import com.chinaztt.fda.ui.R; import com.chinaztt.fda.ui.base.BaseActivity; +import org.androidannotations.annotations.AfterInject; +import org.androidannotations.annotations.AfterViews; +import org.androidannotations.annotations.Click; import org.androidannotations.annotations.EActivity; +import org.androidannotations.annotations.ViewById; /** @@ -19,22 +23,24 @@ * QQ: 781931404 * 公司:江苏中天科技软件技术有限公司 */ - @EActivity(R.layout.dragger_inject_layout) public class AnnotationsTestActivity extends BaseActivity { - private Button btn_show; - private TextView tv_show; + @ViewById + Button btn_show; + @ViewById + TextView tv_show; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dragger_inject_layout); - btn_show=(Button)this.findViewById(R.id.btn_show); - tv_show=(TextView)this.findViewById(R.id.tv_show); - btn_show.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { + } + @Click(R.id.btn_show) + public void btnShowClick(){ + tv_show.setText("按钮被点击了..."); + } - } - }); + @AfterViews + public void setTv_show(){ + tv_show.setText("我已经被注入啦..."); } } diff --git a/app/src/main/res/layout/dragger_inject_layout.xml b/app/src/main/res/layout/dragger_inject_layout.xml index 8ddd125..198b962 100644 --- a/app/src/main/res/layout/dragger_inject_layout.xml +++ b/app/src/main/res/layout/dragger_inject_layout.xml @@ -19,7 +19,7 @@ android:id="@+id/btn_show" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="点击显示数据"/> + android:text="按钮点击"/>