android-viewflow
android-viewflow copied to clipboard
setOnItemSelectedListener/setOnItemClickedListener don't work?
Does viewflow only want hold ViewSwitcher listener? Support onItemSelected/onItemClicked sometimes is uesful. Need that enhancement
Hi, you can implement onClick action by adding your image_item.xml an onClick method.
<ImageView android:id="@+id/imgView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|center_horizontal" android:src="@drawable/android" android:onClick="myFancyMethod" > </ImageView>
And at your Activity, which contains viewflow, define the myFancyMethod
public void myFancyMethod(View v) { Toast.makeText(ctx, "Deneme", 0).show(); }
Thank you,that is one way. But implement onItemClick will make ViewFlow more like AdapterView.(which declare implement that) I really advise to do that.
@13leaf please show your code ,thanks