Detect finger leave of image button in android - android

I have an image button, i am trying to record an audio on touch of a button & when user leaves a button i stop recording.I am successfull in doing that.I have a problem when user starts moving its finger within that bounds of imagebutton.I am using on ACTION_MOVE to handle this, i am not getting 100% success , sometimes it detects on leave , sometimes not. Please help. Below is code i am using..
#Override
public boolean onTouch(View v, MotionEvent event) {
switch (v.getId()) {
case R.id.btn_audio :
final int action = event.getAction();
// get the View's Rect relative to its parent
v.getHitRect(rect);
// offset the touch coordinates with the values from rect to obtain meaningful coordinates
final float x = event.getX() + rect.left;
final float y = event.getY() + rect.top;
switch (action) {
case MotionEvent.ACTION_DOWN :
audioBtn.setImageDrawable(getResources().getDrawable(R.drawable.img_audio_pressed));
mHandler.sendEmptyMessage(MSG_START_TIMER);
timer.setVisibility(View.VISIBLE);
playBtn.setVisibility(View.GONE);
break;
case MotionEvent.ACTION_MOVE :
Log.e(TAG, rect.top+","+rect.bottom+","+rect.left+","+rect.right);
Log.e(TAG, (int)x+","+(int)y);
if (!rect.contains((int) x, (int) y)) {
Log.e(TAG, "In action move,outside");
audioBtn.setImageDrawable(getResources().getDrawable(R.drawable.img_audio));
playBtn.setVisibility(View.VISIBLE);
if (stop)
mHandler.sendEmptyMessage(MSG_STOP_TIMER);
} else {
Log.e(TAG, "In action move,inside");
audioBtn.setImageDrawable(getResources().getDrawable(R.drawable.img_audio_pressed));
timer.setVisibility(View.VISIBLE);
playBtn.setVisibility(View.GONE);
}
break;
case MotionEvent.ACTION_UP :
// the user raised his finger, cancel the Runnable
audioBtn.setImageDrawable(getResources().getDrawable(R.drawable.img_audio));
playBtn.setVisibility(View.VISIBLE);
if (stop)
mHandler.sendEmptyMessage(MSG_STOP_TIMER);
break;
}
break;
default :
break;
}
return false;
}
XML ::
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/actvity_background"
android:padding="15dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="#+id/record_review"
style="#style/textview.review"
android:layout_below="#id/rating_app"
android:layout_marginTop="20dp"
android:text="Record a review" />
<LinearLayout
android:id="#+id/record"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/record_review"
android:orientation="horizontal"
android:splitMotionEvents="false"
android:weightSum="2" >
<RelativeLayout
android:id="#+id/audio_record"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" >
<ImageButton
android:id="#+id/btn_audio"
style="#style/imagebutton"
android:layout_centerInParent="true"
android:layout_marginTop="20dp"
android:background="#android:color/transparent"
android:contentDescription="#string/desc_provider_thumb"
android:focusableInTouchMode="true"
android:src="#drawable/img_audio" />
<TextView
android:id="#+id/timer"
style="#style/textview.review"
android:layout_below="#id/btn_audio"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="00:30"
android:visibility="gone" />
<ImageButton
android:id="#+id/btn_play"
style="#style/imagebutton"
android:layout_below="#id/btn_audio"
android:layout_marginLeft="6dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#id/timer"
android:background="#android:color/transparent"
android:contentDescription="#string/desc_provider_thumb"
android:src="#drawable/img_play"
android:visibility="gone" />
<ImageButton
android:id="#+id/btn_pause"
style="#style/imagebutton"
android:layout_below="#id/btn_audio"
android:layout_marginLeft="6dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#id/timer"
android:background="#android:color/transparent"
android:contentDescription="#string/desc_provider_thumb"
android:src="#drawable/img_pause"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/video_record"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" >
<ImageButton
android:id="#+id/btn_video"
style="#style/imagebutton"
android:layout_centerInParent="true"
android:layout_marginTop="20dp"
android:background="#android:color/transparent"
android:contentDescription="#string/desc_provider_thumb"
android:src="#drawable/img_video" />
<RelativeLayout
android:id="#+id/video_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" >
<ImageView
android:id="#+id/thumbnail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="#drawable/img_dumy_home_video_thumbnail" />
<ImageButton
android:id="#+id/play_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="#drawable/img_play" />
</RelativeLayout>
<Button
android:id="#+id/btn_rerecord"
style="#style/button.review"
android:layout_below="#id/video_preview"
android:layout_centerHorizontal="true"
android:layout_marginTop="2dp"
android:text="#string/re_record"
android:visibility="gone" />
</RelativeLayout>
</LinearLayout>
<Button
android:id="#+id/btn_submit_review"
style="#style/button.review"
android:layout_below="#id/record"
android:text="Submit review" />
</RelativeLayout>

return true
instead of
return false
in your onTouch method

Instead of v.getHitRect(rect); use getLocationInWindow() which returns screen co-ordinates instead of co-ordinates relative to the parent. Update your onTouch code as follows:
//same here
...
...
int[] location = new int[2];
v.getLocationInWindow(location); // get position on the screen.
rect = new Rect(location[0], location[1], location[0]+v.getWidth(), location[1]+v.getHeight());
final float x = event.getX(); // screen x position
final float y = event.getY(); // screen y position
...
...
//same here

Related

Setting ImageView and TextView at predefined XY coordinates - Xamarin Android

I have a Greeting Card activity where one can place Text and Image at desired locations by moving ImageView and TextView using Touch events. After moving to location I want to save its position and use same for other greetings. But neither view.GetX(), view.GetY() nor view.Left, view.Top is working.
I can capture the XY after moving but when using same XY coordinates on SetX & SetY or Left & Top the view is placed at weird locations.
This is my XML layout and using Touch even I move imgV1, txtName and txtSignature.
<RelativeLayout
android:background="#ffffff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/layoutControl"
android:layout_below="#+id/toolbar1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/pBar"
android:layout_gravity="center_vertical" />
</LinearLayout>
<FrameLayout
android:orientation="vertical"
android:id="#+id/GreetingFrame"
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="#+id/layoutPhoto"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:layout_gravity="bottom|right|center_vertical|center_horizontal|center"
android:id="#+id/imgV1"
android:layout_width="135dp"
android:layout_height="135dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="65dp"
android:scaleType="matrix"/>
</FrameLayout>
<ImageView
android:id="#+id/frameImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="#drawable/digicard"
android:adjustViewBounds="true"
android:layout_alignParentBottom="true"/>
<TextView
android:textSize="18sp"
android:textColor="#000000"
android:layout_gravity="bottom|right|center_vertical|center_horizontal|center"
android:id="#+id/txtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="35dp"
android:layout_marginBottom="55dp"
android:text="Your Name"/>
<TextView
android:textSize="22sp"
android:textStyle="bold"
android:textColor="#ffffff"
android:layout_gravity="bottom|right|center_vertical|center_horizontal|center"
android:id="#+id/txtSignature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="80dp"
android:layout_marginBottom="2dp"
android:text="9999999999"/>
</FrameLayout>
</RelativeLayout>
TextView touch event
private void TxtName_Touch(object s, TouchEventArgs e)
{
TextView v = (TextView)s;
if (e.Event.Action == MotionEventActions.Move)
{
v.SetX(e.Event.RawX - v.Width / 2.0f);
v.SetY(e.Event.RawY - v.Height / 2.0f);
}
}
Any suggestions ?
Modify your code as below ,it works fine on my side .
float dX, dY;
private void TextView_Touch(object sender, Android.Views.View.TouchEventArgs e)
{
TextView view = (TextView)sender;
int X = (int)e.Event.RawX;
int Y = (int)e.Event.RawY;
switch (e.Event.Action)
{
case MotionEventActions.Down:
dX = view.GetX() - X;
dY = view.GetY() - Y;
break;
case MotionEventActions.Move:
view.Animate().X(X + dX).Y(Y + dY).SetDuration(0).Start();
break;
}
}
Refer to https://stackoverflow.com/a/31094315/8187800.

Android views tate changes resets layout

I have a list with Swipe Actions on it using IOnTouchListener, as dragging occurs I am changing the Left of a LinearLayout to reveal a second LinearLayout behind it. That layout has two buttons, one is hidden. If the user does a "quick" swipe then I move the Left of the top view to a specific value and fire some code. This code changes the invisible button to be visible. When the ViewState of that button changes it makes the top view's Left snap back to 0 instead of staying where I place it. Any idea why it would do this or how to work around it.
The XML looks like... (But will change slightly based on the answer to another question I posted)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="fill_vertical"
android:background="#color/black"
android:id="#+id/Swipe"
>
<LinearLayout
android:id="#+id/LeftContentView"
android:layout_width="175dp"
android:layout_height="match_parent"
android:background="#color/yellow"
android:layout_alignParentLeft="true"
android:orientation="horizontal"
>
<Button
android:id="#+id/ApproveButton"
android:layout_width="0dp"
android:layout_weight=".72"
android:layout_height="match_parent"
android:background="#2796C3"
android:text="Approve"
android:layout_alignParentLeft="true"
/>
<Button
android:id="#+id/ApproveUndoButton"
android:layout_width="0dp"
android:layout_weight=".28"
android:layout_height="match_parent"
android:background="#215681"
android:text="Undo"
android:layout_toRightOf="#id/ApproveButton"
/>
</LinearLayout>
<LinearLayout
android:layout_alignParentRight="true"
android:id="#+id/RightContentView"
android:layout_width="175dp"
android:layout_height="match_parent"
android:background="#color/black"
android:orientation="horizontal"
>
<Button
android:id="#+id/DenyButton"
android:layout_width="0dp"
android:layout_weight=".72"
android:layout_height="match_parent"
android:background="#FF0000"
android:text="Deny"
/>
<Button
android:id="#+id/DenyUndoButton"
android:layout_width="0dp"
android:layout_weight=".28"
android:layout_height="match_parent"
android:background="#860000"
android:text="Undo"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/TopContentView"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#1F1F1F">
<LinearLayout
android:layout_height="fill_parent"
android:layout_width="match_parent" >
<ImageView
android:id="#+id/UnreadImage"
android:layout_height="match_parent"
android:layout_width="7dp"
android:src="#drawable/vertical_blue_bar"
android:background="#2796C3"/>
<LinearLayout
android:id="#+id/ListText"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dip"
android:padding="12dp">
<TextView
android:id="#+id/Text_Line1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/white"
android:textSize="13dip"
/>
<TextView
android:id="#+id/Text_Line2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/white"
android:textSize="13dip"
/>
<TextView
android:id="#+id/Text_Line3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/white"
android:textSize="11dip"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
I am not using Java, I am using Xamarin with C#. Here are the relevant pieces of code...
public bool OnTouch(View v, MotionEvent e)
{
switch (e.Action)
{
case MotionEventActions.Down:
OriginalTouchX = Math.Ceiling(e.RawX);
index = e.ActionIndex;
pointerId = e.GetPointerId(index);
VelocityTracker.AddMovement(e);
break;
case case MotionEventActions.Move:
VelocityTracker.AddMovement(e);
ChangeX(newX);
VelocityTracker.ComputeCurrentVelocity(1);
float velocity = Math.Abs(VelocityTracker.GetXVelocity(pointerId));
if (velocity > SlowDrag && Math.Abs(distanceMoved) > (DragThreshold / 3))
{
QuickApprove();
}
break;
}
}
void QuickApprove()
{
ToggleUndoButton(true, true);
WaitingForUndo = true;
ChangeX(DragThreshold);
this.ApproveTimer.Start(true);
}
private void ToggleUndoButton(bool ShowUndo, bool LeftSide)
{
this.ApproveUndoButton.Visibility = ViewStates.Visible;
this.ApproveButton.Text = "Approving...";
}
private void ChangeX(int newX)
{
int width = this.TopContentView.Right - this.TopContentView.Left;
this.TopContentView.Left = newX;
this.TopContentView.Right = this.TopContentView.Left + width;
}
If in the ToggleUndoButton method I comment out the line
this.ApproveUndoButton.Visibility = ViewStates.Visible;
Everything works fine. The Left of TopContentView changes to be equal to my DragThreshold, the text changes to Approving... the timer starts, It stays this way for 2 seconds, then the code in my timer tick fires and the TopContentView is moved back to a Left of 0. If I leave in the visibility change then the TopContentView is immediately moved back to 0 instead of waiting until the timer is done.

Android: Horizontal and vertical scroll for recyclerview

I am trying to implement horizontal and vertical scrolling for a Recycler view at the same time.I have to show a table of 8 columns, so I plan to implement horizontal and vertical scrolling at the same time.
I tried HorizontalScrollView in list row but it is scrolling horizontally in one row.
I also tried the HorizontalScrollView as the parent of recyclerview but its not working
list_row.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:clickable="true"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">
<TextView
android:id="#+id/title"
android:textColor="#color/title"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="aaa"/>
<TextView
android:layout_toRightOf="#+id/title"
android:id="#+id/genre"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:text="bbb"/>
<TextView
android:layout_toRightOf="#+id/genre"
android:id="#+id/year"
android:textColor="#color/year"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginLeft="20dp"
android:layout_height="wrap_content"
android:text="ccc"/>
</RelativeLayout>
Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
can any one please tell me an idea.
The best solution i found so far to have horizontal and vertical scrolling on one view is to put it inside one FrameLayout. Then your view must implement OnTouch (you can do this in your activity to) and you just have to scroll it as the touch pointer moves.
Here is an example :
xml :
<FrameLayout
android:id="#+id/TwoWaysScrollableContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false">
<YourView
android:id="#+id/GridContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false" />
</FrameLayout>
C# (i use xamarin, but Java wouldn't have so many differencies i think)
:
public class MyActivity : Activity
{
private MyView _myView; //Can be GridView, relative layout or wathever
private float _startX, _startY,_prevDx, _prevDy, _dx,_dy;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
_myView = FindViewById<MyView>(Resource.Id.GridContainer);
}
public bool OnTouch(View v, MotionEvent e)
{
switch (e.Action)
{
case MotionEventActions.Down:
{
mode = Mode.DRAG;
startX = e.GetX() - prevDx;
startY = e.GetY() - prevDy;
break;
}
case MotionEventActions.Move:
{
/* you also could add logic to prevent your view from scrolling out of you grid bounds*/
if (mode == Mode.DRAG)
{
dx = startX - e.GetX();
dy = startY - e.GetY();
_myView.ScrollBy((int)(dx), (int)(dy));
startX = e.GetX();
startY = e.GetY();
}
break;
}
case MotionEventActions.Up:
{
mode = Mode.NONE;
prevDx = dx;
prevDy = dy;
break;
}
}
return true;
}
}
I know this doesn't answer your question directly ( i don't know much about recycler view), but i hope it can still help you. I used this for a tile engine and it did the trick very well.

android onTouch event in listview items

I've searched around and has read this thread and this thread and so, but nothing helped me .
I have a listview that contains custom layouts. the layout has a custom seekbar. I've used the seekbar out of the listview and it works very well but when uses in list view the onTouch event does not called correctly and runs only when I'm start touching it.
this is a part of my code in getView:
newSimpleDim.layTouch1.setOnTouchListener(new OnTouchListener() {
#Override
public boolean onTouch(View v, MotionEvent event) {
int x = (int) event.getX();
int y = (int) event.getY();
if (y < 0)
y = 0;
if (y > dimHeight)
y = dimHeight;
G.log("Event : " + event.getAction());
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
setHeight(newSimpleDim.layGray1, y);
setHeight(newSimpleDim.layGreen1, dimHeight - y);
setPadding(newSimpleDim.imgGreen1, -y);
newSimpleDim.txtlbl1.setText("" + (100 - ((int) ((y / (double) dimHeight) * 100))));
break;
}
return true;
}
});
and this is list item layout :
<LinearLayout
android:id="#+id/dimmerOne"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/layTouch1"
android:layout_width="wrap_content"
android:layout_height="202dp"
android:orientation="vertical" >
<LinearLayout
android:id="#+id/layGray1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dp"
android:orientation="vertical" >
<ImageView
android:id="#+id/imgGray1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="matrix"
android:src="#drawable/lay_component_dimmer_slider_off" />
</LinearLayout>
<LinearLayout
android:id="#+id/layGreen1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:id="#+id/imgGreen1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:src="#drawable/lay_component_dimmer_slider_on" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/txtlbl1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="TextView"
android:typeface="monospace" />
</LinearLayout>
This problem seems similar to the one I was facing, I am has checkbox and on itemClickListener was not working, did the following to make itemClickListener work,
Added the following properties to the checkbox,
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
and ItemClickListner started working.
for you if onTouch is not getting invoked for the seek bar then add the above code to the layout.
For detailed example for checkbox clickable in listview you can go through the link, and you can apply the same concept to make your onTouch wor
http://knowledge-cess.com/android-itemclicklistner-with-checkbox-or-radiobutton/
Hope it helps Cheers!!

SlidingDrawer with RadioButtons as Handle

I have a custom draggable SlidingDrawer using RadioButtons as its Handle. In order to enable the touch events on the RadioButtons I call return super.onInterceptTouchEvent(event); instead of return true on the onInterceptTouchEvent method. But somehow every time I want to drag my SlidingDrawer I can't drag it up by touching exactly on the RadioButtons, I have to move my finger up a little bit to drag the SlidingDrawer up.
Is there any way to make the SlidingDrawer exactly draggable by touching its RadioButtons without losing the TouchEvent on the RadioButtons itself?
Here's my touch method:
public boolean onInterceptTouchEvent(MotionEvent event) {
if (mLocked) {
//return false;
}
final int action = event.getAction();
float x = event.getX();
float y = event.getY();
final Rect frame = mFrame;
final View handle = mHandle;
handle.getHitRect(frame);
if (!mTracking && !frame.contains((int) x, (int) y)) {
return false;
}
if (action == MotionEvent.ACTION_DOWN) {
mTracking = true;
WWHApplication.getListActivityIntance().resizeListView(1800);
handle.setPressed(true);
// Must be called before prepareTracking()
prepareContent();
// Must be called after prepareContent()
if (mOnDrawerScrollListener != null) {
mOnDrawerScrollListener.onScrollStarted();
}
if (mVertical) {
final int top = mHandle.getTop();
mTouchDelta = (int) y - top;
prepareTracking(top);
} else {
final int left = mHandle.getLeft();
mTouchDelta = (int) x - left;
prepareTracking(left);
}
mVelocityTracker.addMovement(event);
}
//return true;
return super.onInterceptTouchEvent(event);
}
Here's how my handle looks like
<LinearLayout
android:id="#+id/handle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/tab_content_bg_top" />
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/tab_content_bg"
android:fillViewport="true"
android:scrollbars="none" >
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/cb_tab_all"
android:layout_width="46dp"
android:layout_height="45dp"
android:background="#drawable/checkbox_background"
android:button="#drawable/tab_all_selector"
android:onClick="true" />
<RadioButton
android:id="#+id/cb_tab_favorites"
android:layout_width="84dp"
android:layout_height="45dp"
android:background="#drawable/checkbox_background"
android:button="#drawable/tab_favorites_selector"
android:onClick="true" />
<RadioButton
android:id="#+id/cb_tab_historical"
android:layout_width="134dp"
android:layout_height="45dp"
android:background="#drawable/checkbox_background"
android:button="#drawable/tab_historical_selector"
android:onClick="true" />
<RadioButton
android:id="#+id/cb_tab_food"
android:layout_width="116dp"
android:layout_height="45dp"
android:background="#drawable/checkbox_background"
android:button="#drawable/tab_food_selector"
android:onClick="true" />
</RadioGroup>
</HorizontalScrollView>
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#drawable/tab_content_bg_bottom" />
</LinearLayout>

Categories

Resources