android-viewflow icon indicating copy to clipboard operation
android-viewflow copied to clipboard

setOnItemSelectedListener/setOnItemClickedListener don't work?

Open 13leaf opened this issue 12 years ago • 3 comments

Does viewflow only want hold ViewSwitcher listener? Support onItemSelected/onItemClicked sometimes is uesful. Need that enhancement

13leaf avatar Jun 06 '12 08:06 13leaf

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(); }

gokselguren avatar Jul 18 '12 12:07 gokselguren

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 avatar Jul 22 '12 02:07 13leaf

@13leaf please show your code ,thanks

geckhan avatar Mar 27 '17 09:03 geckhan