[img]https://i.stack.imgur.com/7WGBz.png[/img]

When converted through Android Vector Studio, the xml looks like
[code]<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="580dp" android:height="400dp" android:viewportWidth="580.0" android:viewportHeight="400.0"> <path android:name="someName" android:pathData="M0,30a30,30 0,1 0,60 0a30,30 0,1 0,-60 0z" android:strokeColor="#000" android:fillColor="#fff" android:strokeWidth="1.5"/> <path android:name="someOtherName" android:pathData="M60,100a40,40 0,1 0,80 0a40,40 0,1 0,-80 0z" android:strokeColor="#000" android:fillColor="#000" android:strokeWidth="1.5"/> </vector>[/code] When any of the circles or paths of this vector are clicked, I want to know which layer or circle has been clicked. I could not find any method which will let me know that there are two layers or which layer has been clicked.

From this answer it looks like getting inner elements of a VectorDrawable is not possible. So is there any way I can get to know exactly which circle/layer is clicked?"> [img]https://i.stack.imgur.com/7WGBz.png[/img]

When converted through Android Vector Studio, the xml looks like
[code]<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="580dp" android:height="400dp" android:viewportWidth="580.0" android:viewportHeight="400.0"> <path android:name="someName" android:pathData="M0,30a30,30 0,1 0,60 0a30,30 0,1 0,-60 0z" android:strokeColor="#000" android:fillColor="#fff" android:strokeWidth="1.5"/> <path android:name="someOtherName" android:pathData="M60,100a40,40 0,1 0,80 0a40,40 0,1 0,-80 0z" android:strokeColor="#000" android:fillColor="#000" android:strokeWidth="1.5"/> </vector>[/code] When any of the circles or paths of this vector are clicked, I want to know which layer or circle has been clicked. I could not find any method which will let me know that there are two layers or which layer has been clicked.

From this answer it looks like getting inner elements of a VectorDrawable is not possible. So is there any way I can get to know exactly which circle/layer is clicked?"> [img]https://i.stack.imgur.com/7WGBz.png[/img]

When converted through Android Vector Studio, the xml looks like
[code]<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="580dp" android:height="400dp" android:viewportWidth="580.0" android:viewportHeight="400.0"> <path android:name="someName" android:pathData="M0,30a30,30 0,1 0,60 0a30,30 0,1 0,-60 0z" android:strokeColor="#000" android:fillColor="#fff" android:strokeWidth="1.5"/> <path android:name="someOtherName" android:pathData="M60,100a40,40 0,1 0,80 0a40,40 0,1 0,-80 0z" android:strokeColor="#000" android:fillColor="#000" android:strokeWidth="1.5"/> </vector>[/code] When any of the circles or paths of this vector are clicked, I want to know which layer or circle has been clicked. I could not find any method which will let me know that there are two layers or which layer has been clicked.

From this answer it looks like getting inner elements of a VectorDrawable is not possible. So is there any way I can get to know exactly which circle/layer is clicked?">
I have an SVG file which looks like

[img]https://i.stack.imgur.com/7WGBz.png[/img]

When converted through Android Vector Studio, the xml looks like
[code]<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="580dp" android:height="400dp" android:viewportWidth="580.0" android:viewportHeight="400.0"> <path android:name="someName" android:pathData="M0,30a30,30 0,1 0,60 0a30,30 0,1 0,-60 0z" android:strokeColor="#000" android:fillColor="#fff" android:strokeWidth="1.5"/> <path android:name="someOtherName" android:pathData="M60,100a40,40 0,1 0,80 0a40,40 0,1 0,-80 0z" android:strokeColor="#000" android:fillColor="#000" android:strokeWidth="1.5"/> </vector>[/code] When any of the circles or paths of this vector are clicked, I want to know which layer or circle has been clicked. I could not find any method which will let me know that there are two layers or which layer has been clicked.

From this answer it looks like getting inner elements of a VectorDrawable is not possible. So is there any way I can get to know exactly which circle/layer is clicked?


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir