Displaying text vertically (Japanies characters with ruby annotation) in android app - android

In my android app, I want to display japanies characters verticlaly with ruby annotations. The text and asnnotation comes dynamically from a service. Prestty much something like this ([https://www.w3.org/International/questions/qa-ruby-data/vertical.png][1]). At first glance this seems to be a solved problem. But surprisingly I dont see much material on Internet about this scenario. I am skiming through various topics in android but no luck. Can any one share some resource that I can look into.
I already came across the /n approach, Honestly felt we can solve this little better (not sure though)

In your, Textview use this line
android:rotation="90"
like I set the text verticle.

Related

Display algebraic equations that look as nice as Tex in TextViews in Android Studio?

I spent like a half hour researching and many suggestion are either years oudated/no longer existent, and me being a programming beginner who doesn't know how to do more advanced things than basics like adding text/buttons/etc. and basic programming logic into Android Studio activies, I'm totally lost. Some suggestions mention inserting HTML with JavaScript references but I haven't found a guide that explains how to do it, and those making the suggestions listed some cons, too. E.g. How would I display 5^2 (without the '^' and the '5' in superscript form), '1/2' in neat fraction form, etc., in a TextView or whatever other text component? I searched through the Android developer reference as well but didn't see anything that 'intuitively' stood out to me, for the lack of a better word.
You could achieve this by using WebView and JS. An example of such library for Android is: https://github.com/KaTeX/KaTeX.
I think you can use MathJax for doing that. Please refer to this GitHub repository.
MathJax

How to insert a custom view inline, inside an EditText?

Is anyone knows how to insert CardView-like views into an EditText in ANDROID inline? I did google up for a bit, and just found the library that is specifically for browsing contacts like the one in gmail android app.
I need to use it something like the tag TextBox in stackoverflow, when we are going to post / edit a question.
1 pic worth a thousand words, so here we go:
SNIP FROM SO
SNIP FROM GMAIL ANDROID APP
Maybe something like Chips like this. I have no problem of creating such View myself, the problem is to insert it into an EditText. Thank you.
P.S. My min sdk version is 19
UPDATE: Just saw how this is handled in SO android app. I think it's not bad tho, but still, I prefer inline solution if able.

Styling Custom Dialogs

Is there any way, specifically in android studio, to see what one's custom dialog would look like without actually running the application? It seems that the Design view of layouts account only for entire-screen designs. It also seems that sometimes the way the "dialog" looks in the design view is wildly different than the way they look live.
I would share some of my code, I know you guys love that, but this isn't exactly a coding question, is it?
You can use third party tools and mirrors. I think the closest you can get is by checking this out.
This is hot swapping in general and you get interactive previews but like I said it is the closest you can get. I haven't worked thoroughly with it but I think this should be what you are looking for.

Article reading application - WebView or TextView?

I am trying to create a reader-type application for a particular website, so reading experience is essential. Of course I want to preserve article formatting as author inteded (via basic html tags (p, br, img) - no CSS so far).
The problem is that I am having hell of a time displaying this in a textview the way I want with Html.fromHtml method. And dont even get me started on images, theyre all over the place.
Ive always been taught that webview is a no-no for native experience and its performance sucks, but then I learnt that Google Currents app uses it, and it even allows text justification, which is always nice for reading.
So .. what would you do? Hack that TextView into behaving or stick with WebView? Would it be so bad? Is there a way to figure out what the popular reading apps like The Verge are using?
Thanks!
I wrote the BGR app, among others, and I think you should go web view. I personally think that its a bad choice when people use it for a whole app, or to do the work that an app should be doing, but web views exist for formatting, so use it.

Android: Syntax Highlighting?

I am currently trying to write an application which invloves syntax highlighting codes. (HTML, XML, PHP, JavaScript, CSS and preferably more).
It has been going very well but I have come across a probelm: syntax highlighting. I have written a class for syntax highlighting XML myself, but it is incredibly slow, inefficient and takes so long. I loaded, as a test, a 600 line XML document, and it took two whole minutes to syntax highlight. What do people recommend for Syntax Highlighting on Android? Are there any good libraries? Are there any good algorithms I can use (I don't mind rewriting it from another language), or any standard techniques? What about Regex?
I also have the problem that when I did the 600-line XML test yesterday the EditText widget I was using could not cope with the coloured text and eventually I recieved a ANR error, but that is a different question I will post elsewhere, though if anyone does incidentally have a solution that would be great.
Thanks so much!
You already have a lots of syntax highlighting tools available in Javascript. You may need to do slight modifications. Take a look at this. I use it in my blog everyday.

Categories

Resources