Skip to content

Commit

Permalink
+):添加了AndroidAnnotations注解测试实例...
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangqqlmj committed Nov 5, 2015
1 parent ad20848 commit 0f46fb7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 15
targetSdkVersion 22
versionCode 4
versionName "1.1.1"
versionName "1.1.2"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


/**
Expand All @@ -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("我已经被注入啦...");
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/dragger_inject_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:id="@+id/btn_show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="点击显示数据"/>
android:text="按钮点击"/>
<TextView
android:id="@+id/tv_show"
android:layout_margin="5dp"
Expand Down

0 comments on commit 0f46fb7

Please sign in to comment.