Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: how to find position or coordinate of an Imageview inside a relativelayout?

Manoj Kumar:

This is my page layout.


android:layout_width="match_parent"
android:layout_height="match_parent">

android:id="@+id/fullMeetingView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:layout_weight=".1"
android:background="@color/colorPaleGrey2"
android:orientation="vertical">

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp">

android:id="@+id/meeting_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:text="Entrepreneur Meet Up"
android:textColor="@color/blackDark"

android:textSize="20.1sp"
android:textStyle="normal" />

android:id="@+id/time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/meeting_text"
android:layout_centerInParent="true"
android:layout_marginTop="10dip"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:lineSpacingExtra="6sp"
android:text="(11:30AM - 4:00PM)"
android:textColor="@color/bluey_grey_three"
android:textSize="14sp"
android:textStyle="normal" />



android:id="@+id/rlmainLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">

android:id="@+id/framelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">



android:id="@+id/rl_dropView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/round_bg"
android:padding="30dp">

android:id="@+id/imageView"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/ic_drop_cards" />

android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerInParent="true"
android:layout_gravity="center_horizontal|center"
android:fontFamily="sans-serif"
android:gravity="center_horizontal"
android:lineSpacingExtra="10sp"
android:text="Drop Cards Here"
android:textColor="@color/blackDark"
android:textSize="10sp"
android:textStyle="normal" />


android:id="@+id/delete_zone_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal"
android:visibility="visible">

android:id="@+id/deleteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" android:padding="@dimen/margin_20dp"
android:background="@drawable/ic_delete" />









android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layout_weight=".2">

xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
tools:context="com.guna.navigationviewonbothssides.MainActivity">

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:elevation="0dp">


android:layout_width="wrap_content"
android:layout_height="wrap_content">


android:id="@+id/tabLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/menuRight"
android:background="@color/colorWhite"
android:minHeight="?attr/actionBarSize"
app:tabGravity="fill"
app:tabIndicatorColor="@color/colorTurquoiseBlue"
app:tabIndicatorHeight="3dp" />

android:id="@+id/menuRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@color/blackDark"
android:padding="10dp"
android:tint="@color/colorPrimary">

android:layout_width="16dp"
android:layout_height="16dp"
app:srcCompat="@drawable/ic_menu_white_24dp"

/>








android:id="@+id/viewpager_meeting_landscape"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:background="@color/colorWhite" />




android:id="@+id/nav_view"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="end"

android:fitsSystemWindows="true">

android:id="@+id/recyclerview_drawer_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:visibility="visible"
android:scrollbars="vertical" />


android:id="@+id/empty_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:scrollbars="vertical"
android:gravity="center"
android:text="@string/no_meeting_fount"
android:visibility="gone" />





i want to get eject position coordinates so that i can perform some action when i drop listview item

i tried using getLocationInWindow() x and y coordinate but i always get x axis-0 while it not 0 position i have to get eject position or area of delete button so that i can touch list view item view to delete position please suggest me how to find delete image view coordinate or position .



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: how to find position or coordinate of an Imageview inside a relativelayout?

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×