Instagram like counter for android
TextSwitcher.xml
<TextSwitcher
android:id="@+id/likecount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:inAnimation="@anim/slide_in_counter"
android:outAnimation="@anim/slide_down_counter">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123 likes"
android:textColor="@color/white" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white" />
</TextSwitcher>
sample.java
TextSwitcher likecount;
Button share;
likecount=(TextSwitcher) findViewById(R.id.likecount);
share.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
k++;
likecount.setText(""+k);
}
}
});
No comments:
Post a Comment