仿 Twitter 点赞效果 ShineButton。要求 android 4.0 以上版本。
使用:
shineButton = (ShineButton) findViewById(R.id.shine_button); shineButton.init(activity);
或者
ShineButton shineButtonJava = new ShineButton(this); shineButtonJava.setBtnColor(Color.GRAY); shineButtonJava.setBtnFillColor(Color.RED); shineButtonJava.setShapeResource(R.raw.heart); shineButtonJava.setAllowRandomColor(true); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(100, 100); shineButtonJava.setLayoutParams(layoutParams); if (linearLayout != null) { linearLayout.addView(shineButtonJava); }