Android TextView text splitting system - android

I'm going to make an app for which I need to know how does android split the text in it's TextView.Because of the splitting the text doesn't go out of the window it retains in side a bound.
The help what I need is like the image
In the image the text didn't overlap with the triangle. So I need a sample code spinnet which will help me to do that. Or idea to how to do it will also help me.

One of the easiest way, I think - split one TextView on several ones (for example - 3, or more if you need precise approximation).

Related

Passlock design in Android

I am stuck in app locker.
Pleas help me to figure out.
Here I use a background image in that there are 9 holes. I need to put images on each hold for password. I try much but each time images are not on the same places on different screens or display devices. Please give me some demo or tutorial. Thank you!
Actually I want to design like the below picture, where the background image is constant with holes, and I want to put on each hole with different pig image. But the problem is I don't know how to design layout for accurate pig position and another important thing is that if the display screen is different, does the layout design work?

How to remove Text from image (.jpg/png) in android

sorry for bad English,
I want to implement the koreakoe song.
and i have 1 video for that.
so i can take each frame from MediaMetadataRetriever class in android.
in Bitmap format. and each bitmap contain one image and some text.
So my question is how to get this text on image and after remove this text from image or highlight each word on current image.
i have no such code that
please give me suggestion.
Please see the below image for example..
Then after
OR
if you some clarification please ask me.
Thanks in advance.
If you see some text in an image, that's not a separate object you can manipulate (i.e.: removing or highlighting a word).
Because that text is not a string. It's part of the bitmap itself.
It's a bunch of colored pixels over a bunch of colored pixels.
Thereafter, you can't easily remove it if not using a graphic editor or some AI techniques.
[EDIT]
A tricky solution would be to COVER the text with something else.
I.e.: a textView with an opaque background. There you will put YOUR text.
This can be easily achieved, by using a RelativeLayout.
I said it's TRICKY. Probably it's not the best visual solution, but it may help you solve the urgency.
[EDIT 2]
Another tricky solution would be to CUT the text potion of the image.
I.e.: you CROP the image at a specified amount of pixels.
Again, I said this is TRICKY, too. Probably it's not the easiest way, but it may result in a better visual rendering, allowing you to use a TRANSPARENT background for your text.
I think you should use an image without text and then lay the text over the image using a TextView. I hope it is then clear how to manipulate the text without changing the image.
As Bob Malooga already stated, there is no easy and flawless way to remove text that is actually part of the bitmap, so you should separate the image from the text.

Android - creating a simplified spotify-like layout

I am developing an Android app and am a bit stuck on how I go about creating the layout I'm after. I said spotify-like (website not app) as I dont want the parallax effect. It's actually closer to http://www.poormet.com/.
What I have tested so far is a RelativeLayout with an ImageView and Listview (with transparent dividers) within it. This layout shows the image in the background between rows which is a step in the right direction. The issue is I'm at a loss as to how to get the images to change smoothly depending on what listrows are on screen.
Also, if I want to replicate the text over the images like poormet example mentioned above, then it seems to me I am going to have to have alternating transparent and not transparent rows.
Am I on the right track or am I approaching this problem the wrong way?
Any guidance will be greatly appreciated!!!
(also, please let me know if what I have described doesn't make sense - more than happy to clarify)

Letter Spacing in EditText for Android

I am trying to have a custom EditText based on the background that i am using for. The Background image has some spaces between the entry areas so i need to have some space between the characters(kerning) to fit them right in. So for example after every character the user enters, i need to put 4 whitespace after that.
I couldn't find any solution for this on the net so far, some people suggested TextWatcher, but i couldn't manage to make it work as i want it too.
Can someone help me about it?
Thanks
I have you considered using a custom font? Some font types are made to stretch out or shrink or have empty spaces. With so many different fonts available online, you can definitely find something. You can also make your own with a software. It might be time consuming if you start the lettering from scratch. I'm not 100% sure if it'll fit exactly to your background, but it's idea that you can consider.
If it doesn't fit, I supposed you can always customized the background to fix your font too. Here's the code for those who might want to use custom fonts in their app too.
Typeface myfont = Typeface.createFromAsset(getAssets(),
"fonts/Blocks2.ttf");
myeditText.setTypeface(myfont);
The font is in the asset folder under another folder called fonts.
This question is related to How to change letter spacing in a Textview?
As shown at this issue: android format edittext to display spaces after every 4 characters a solution might be to insert spaces with Java code...
You need to use TextWatcher to achieve visual purpose spaces.
And use any simply split string by space logic to join it back or loop
through the entire string per character wise and eliminate (char) 32
from the string
As far as i know actual character spacing is not possible, though i'd love to use that myself as well.
Another option might be to use a custom font with the character spacing included.

Android TextView and how to determine the number of visible characters

How can I determine the number of visible characters that a TextView can display. For example if I change the orientation this number may change. If I change the resolution then also the number of visible characters changes.
Thanks in advance
Thank you for your answer.
Currently I am developing a small text based game to become acquainted with the Android API. For that reason I need to know exactly how much characters can be displayed in the visible area of a TextView widget. I saw an example of Paint but wanted to know if there are better solutions.
Ideally, you design your GUI such that it does not matter. For example, you can use android:ellipsize to deal with strings that are too long for the available space.
There are classes in the 2D drawing APIs (e.g., Paint) that seem to be tied into this, but it does not look like much fun.
You can use ellipsize property but there has been a bug that has been filed on the same
http://code.google.com/p/android/issues/detail?id=2254
On the bottom of this page you could find an alternate approach which can draw exactly the number of lines on a given space...

Categories

Resources