Coder Social home page Coder Social logo

allannotation's Introduction

allannotation

实现安卓activity,fragment的全注解,并且实现了20多种view事件的全注解实现 ,包括事件总线的实现,例子如下

@Bus
@ViewId(R.layout.main_fragment_center)
public class Main_Fragment_Center extends BaseFragment {

	@ViewId(R.id.verify_status)
	private TextView verify_status;

	@ViewId(R.id.score)
	private LinearLayout score;

	@ViewId(R.id.bill)
	private LinearLayout bill;

	@ViewId(R.id.faq)
	private LinearLayout faq;

	@ViewId(R.id.about_us)
	private LinearLayout about_us;

	@ViewId(R.id.check_new)
	private LinearLayout check_new;

	@OnClick(R.id.verify_status)
	private void verify(View v) {
		Intent intent = new Intent();
		intent.setClass(getActivity(), Activity_Verify.class);
		startActivity(intent);
	}

	@OnClick(R.id.score)
	private void score(View v) {
		Intent intent_Score = new Intent();
		intent_Score.setClass(getActivity(), Activity_Score.class);
		startActivity(intent_Score);
	}

	@OnClick(R.id.bill)
	private void bill(View v) {
		Intent intent_Bill = new Intent();
		intent_Bill.setClass(getActivity(), Activity_Bill.class);
		startActivity(intent_Bill);
	}

	@OnClick(R.id.faq)
	private void faq(View v) {
		Intent intent_Faq = new Intent();
		intent_Faq.setClass(getActivity(), Activity_Faq.class);
		startActivity(intent_Faq);
	}	

	@OnClick(R.id.about_us)
	private void about(View v) {
		Intent intent_AboutUs = new Intent();
		intent_AboutUs.setClass(getActivity(), Activity_AboutUs.class);
		startActivity(intent_AboutUs);
	}

	@OnClick(R.id.check_new)
	private void check(View v) {
		Intent intent_CheckNew = new Intent();
		intent_CheckNew.setClass(getActivity(), Activity_CheckNew.class);
		startActivity(intent_CheckNew);
	}

	@Subscribe(Bus2.UI_THREAD)
	public void a(String name) {
	// verify_status.setText(name);
		Log.i("debug", "===========" + Thread.currentThread().getName());
	}
}

allannotation's People

Stargazers

vic avatar

Watchers

James Cloos avatar vic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.