I have a vertical linearlayout with three clickableviewviews within a linearlayout. When I rotate linearlayout 90 degrees using simple animation, a problem arises. Image images are correctly rotated, but onclick events for images do not rotate along with linearlayout and remain in their original position until the animation.
Below is my main Java code
westplayer = (LinearLayout) findViewById(R.id.linearLayout_west);
The code above handles part of the animation. The following code follows the animation and is redefined to update the layout positions, but does not work for me.
// Update Layout int top=westplayer.getTop(); int bottom=westplayer.getBottom(); int left=westplayer.getLeft(); int right=westplayer.getRight(); westplayer.layout(left, top , right, bottom );
xml is as follows:
<LinearLayout android:id="@+id/linearLayout_west" android:layout_width="42dp" android:layout_height="250dp" android:layout_alignParentLeft="true" android:layout_below="@+id/linearLayout_north" android:duplicateParentState="false" android:gravity="center" android:orientation="vertical" > <ImageView android:id="@+id/imageViewW1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/spades_14" /> <ImageView android:id="@+id/imageViewW2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/spades_14" android:layout_marginTop="-15dp" /> <ImageView android:id="@+id/imageViewW3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/spades_14" android:layout_marginTop="-15dp" /> </LinearLayout>
I have update layout code from this , and also found another solution that I also tried this and there are still no positive results. I need this for API 10 to work. Any help is much appreciated
source share