Tap Target for rectangular shapes Android - android

I am trying to use the Tap Target View library from GitHub in an android app.
https://github.com/KeepSafe/TapTargetView
I was wondering if anyone knows if we can use this library to highlight a rectangular shape or if it is primarily for targets that can be surrounded by a circle. I like to highlight an entire row in a list view.
Thanks

This library when reviewing the codes you find out there is no arc or circle in this customView and is a Rect...
So how is this circle like? It cause the radius number it gets. so if you know you can change the code very easily and remove or make the radius to 0.
But my question is why? really is going to make a bad mess for rectangular things...

Related

Multicolored android slider

I want to create this type of slider
I don't want the code but the directions. what is the best thing todo this?
is there any similar library project available?
is there any similar view already available natively.
is this more easy to create in jetpack compose UI.
Thank you so much for your help.
Since you refer to the view you want as a "slider", I assume that you are thinking about using something from the Material Design library. My personal experience with the Material Design views are that they primarily enforce the MD guideline and are not very flexible although they may work for you in this case.
is there any similar library project available?
As for libraries, it looks like the other answers point to some that may be capable of what you are looking for.
is there any similar view already available natively.
I suggest that you take a look at using a SeekBar not because I think that it is necessarily better, but I believe that you can get the result you want with a little effort that would not have external dependencies other than the standard libararies.
Here is another answer of mine that explains how to build a SeekBar similar in structure that you are looking for. Your background would be the rounded rectangle with gradient shading. The background colors can be defined as explained here. Your seek bar can be built using a LayerList. The layer list can be defined in XML and modified in code. You can also forgo the layer list and draw that seek bar programmatically or fit everything into one drawable. Which you do will depends on your design constraints.
The thumb can easily be a custom thumb.
You will likely wind up with mostly XML but some code but not much. I would consider placing the code in a custom view that extends from a standard SeekBar.
You can edit the following resources.
https://github.com/divyanshub024/ColorSeekBar
custom scroll able multi color seek bar
I built something similar with Jetpack Compose, instead of using different colors with intervals it creates gradients from colors, but what you ask is a little work on current build and it can display anything as thumb. You can check source code and implement drawing over track section. If it's much work i can add similar features when i'm available.
The easiest way of doing this in Compose Canvas, for View it's a custom View that draws inside onDraw.
You basically draw a line with width and rounded cap or a rounded rectangle and draw border with a stroke around it. Do some interpolation for changing from your value range to pixels on screen and get the current value based on users touch position and interpolate it to range defined.
Let's say your Slider is 1000px wide. And your range is between 0f and 1f, you translate touch on 600px to 0.6 value and vice versa. For different colors you can pass a List<Pair<Color,Float> to divide slider between color based on float based stops.
For drawing lines you set 3 types of heights and use modulus to assign each height in every 1, 5 and 20 value. I have something similar for building Compass with View here
https://github.com/SmartToolFactory/Compose-Colorful-Sliders

Hide/remove/change color of a canvas circle When toched in Android

this is my first question here, so maybe I'll make some mistakes.
I want to create an Android app for touch test, and draw a cross on the screen, however I'm succeeded to draw cross, but now I want to implement test screen login.
What I want to do is that, When user clicks on any circle it should be removed/hidden or change color to transparent.
Any kind of help would be appreciated.
this is the link to my code.
https://github.com/akhlaqshah36/stackoverflow_questions/blob/master/drawCicles
and attached screenshot.
I got the solution by using some formulas of distance and Using Pointer objects.
check the solution here if someone need it.
Solution Link drawing cross in canvas

Text in circle in circular motion

I'm trying to create a textview with a circular background such as shown in the image below. I have 6 other circles like this as well which come from user input.
However I run into problems if there are too many characters, it breaks the boundaries of the circle. I want to make the text go in a circular motion around the circle if the text is more than lets say 10 characters like this.
I've read other people have the same problem and the answers revolved around creating custom views. I am not that experienced with Java yet so if anyone can guide me through this I would really appreciate it.

AchartEngine Android Special Pie Chart

I'm using the AchartEngine libraries to make a pie chart app. But I want to display two dimensional data like this
I can get nice standard pie charts but I know how to do the second dimension. Can anyone please help? The guys on the achartengine-google-support group say it's possible but I was redirected here for tech questions.
Many Thanks
If you take a look at the Budget Pie chart demo it shows you how to highlight a section of your pie chart (https://code.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/BudgetPieChart.java). Take a look at "Project 1" below to see how this looks.
However there is no way to change the radius like you want to in your screenshot above. If you want to achieve this the easiest way would be to extend PieChart and copy over the draw method. In the draw method where it renders highlighted sections (if (seriesRenderer.isHighlighted()) ...) use a different radius instead of translating to an offset.

Red eye removal android

I want to implement red eye removal application on android. Is there any api or built in android method to do this? If no then please tell me how can we detect eyes from image? I know how to remove red color but Im having difficulty in detecting eyes from image.
Use the OpenCV to detect the eyes and then in the circular region where you expect the pupils to be, take the pixel value and set the Red value to, say, 20% of its original value while leaving the Green and Blue channels untouched.
There is also the FaceDetector.findFaces() which works for Bitmaps. However, it will just give you a Rectangle of the Face. But it should be easier to search in that rectangle for red-saturated pixels and desaturate the color as Alexander suggested. But this way you don't necessarly need another library.

Categories

Resources