I have two views. One of them (bottom view
) already handling scrolling, pinch-to-zoom, double tap and other actions. The second one (which lays over this one; let's call it top view
) is my custom view. For example I want top view
to handle long press action. The issue is that to achive this I need my top view
to receive ACTION_DOWN
and some ACTION_MOVE
events. So I override onTouch
method and return true
when ACTION_DOWN
received. This causes my bottom view
to not receive any events. According to documentation it's ok but how can I achieve my goal in this way?
Asked
Active
Viewed 100 times
0

Lingviston
- 5,479
- 5
- 35
- 67
1 Answers
0
I used FrameLayout to display text over image.On click of text I showed one text and on click of image I showed another different Toast.It is working fine.Here's my code
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#D6FFD6"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@+id/img"
android:src="@drawable/ic_launcher"
android:scaleType="fitCenter"
android:layout_height="fill_parent"
android:layout_width="fill_parent"/>
<TextView
android:id="@+id/txt"
android:text="learnandroideasily.blogspot.com"
android:textSize="30sp"
android:textStyle="bold"
android:textColor="#003399"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>

Jigar Pandya
- 2,129
- 2
- 17
- 27
-
This is not what I need. You example is rather obvioгs. Your views handle separate actions (click on ImageView and click on TextView) while mine must handle some actions simultaneously. – Lingviston Nov 22 '13 at 10:22
-
I didn't got what exactly you want to do?Please elaborate.thnx – Jigar Pandya Nov 22 '13 at 10:27