Create a nice "About" XML Layout using rich text? - android

I intend to make a good "About" section in my application that gives the user some basic information about the developer and the app itself.
I didn't find a rich EditText among the Widgets.
I have searched for other questions similar to mine here and I found something like using a WebView or a TextView and giving them HTML attributes in the code.
Is there any nice and professional way to do my About XML Layout?

use multiple TextViews and position them accordingly.

If you need high control and rich text, use a WebView and load a static HTML file. You can achieve a lot with Spans (bold, itallick, links, etc.) in a simple TextView as well but it is generally more work.

Related

Is it possible to add custom interactive UI elements to EditText?

A bit of context here. I'm an iOS developer with no knowledge on Android development.
I need to know whether it's feasible in Android to embed custom interactive UI elements (in iOS that'd be a UIView) inside of EditText.
A library I found to do this in iOS is: https://github.com/vlas-voloshin/SubviewAttachingTextView
You can see a GIF in that link showcasing the kind of behavior I'm looking for.
Is there built in support, or any third party library I can use to achieve something similar in Android?
in normal way this is not possible in android and we don't have any standard component or any library (that i know) for doing such a thing but we can create something similar to this (for this you should search about custom Views in android !) and also there is other way and easier way to achieve something similar to this is using the container layouts in android like LinearLayout and adding all your component to that container layout in run-time base on your text ! for example in your code you can dive in to your text and find tags like or and create appropriate view for your tag and add it to your container layout and at the end your layout looks like that gif wich is in your question ! and also in android we can show some basic html code in textView

Justifying database texts on android

I'm working on story application pjoject for android. The story text is in the database/db file. I used textView and the text is working good on the application but it's not justified. Is there a way to justify the text from database file, or link to that tutorial?
Setting text in db won't have any styling impact on text itself. You can use third-party lib to justify your text in android.
https://github.com/bluejamesbond/TextJustify-Android
In order to use it, you'll need to use their com.bluejamesbond.text.DocumentView in XML instead of traditional TextView. See the first example of the following link to get an idea about code.
https://github.com/bluejamesbond/TextJustify-Android/wiki/3-%C2%B7-Examples

Simple RichText Editor in Android

i want to create a simple rich text editor in android, just like this application on google play store: https://play.google.com/store/apps/details?id=com.spn.richnotepad&hl=en
and i am very new in android so anyone can provide some idea about it.
Thank You
It's not difficult at all but before you start I highly recommend you to read the guide from Android Developer site:
https://developer.android.com/training/basics/data-storage/index.html
You will learn how to save data which is a very important part of your project.
Then you have to learn all about EditText (allows the user to type text into your app) and TextView (displays text on screen).
http://developer.android.com/guide/topics/ui/controls/text.html
When your app is finished you can add some additional functionality:
Spelling Suggestions
https://developer.android.com/training/keyboard-input/index.html
Text Formatting
http://www.chrisumbel.com/article/android_textview_rich_text_spannablestring
Font Style
http://code.tutsplus.com/tutorials/quick-tip-customize-android-fonts--mobile-1601
Some useful links:
http://developer.android.com/reference/android/widget/EditText.html
http://developer.android.com/reference/android/widget/TextView.html
I also advice you this Notepad Tutorial which will guide you step by step to construct a simple notes list that lets the user add new notes.
http://developer.android.com/training/notepad/index.html
Check out this one https://github.com/chinalwb/Android-Rich-text-Editor, it is still in progress but you may get some pointers from there. Thanks.
Supported styles:
Bold
Italic
Underline
Strikethrough
Numeric list
Bullet list
Align left
Align center
Align right
Insert image
Background color
Hyper link
#
Quote
Foreground color
Emoji icon
Superscript
Subscript
Font size
Video
Image from internet
Dividing line
All styles support save as HTML file
Set init html content and continue editing or displaying
Demo for part of the supported features
Found some quick solutions :
droid-writer
cwac-richedit
Also check following discussions:
Rich Text Box in android
Implementing a rich text editor in Android?

How to show multiple TextView 'inline' layout in Android?

For e.g. I want to show tags to some article (just like we have tags attached with each question on StackOverflow), I would like to show them like this:
Where the tags can be of variable length and they should span across multiple lines if they can't fit in the given width. I tried out LinearLayout and RelativeLayout but they don't seem to be able handle such 'auto' arrangement scenario. What layout or methodology should I use to achieve this effect?
This requirement is known as FlowLayout and I found couple of solutions as open source libraries to achieve this effect:
ApmeM/android-flowlayout
blazsolar/FlowLayout

HTML android in android

I want to develop an editor which can make the text bold, italics and underline and create an equivalent HTML for it. I have somethhing like this in my mind:
When the user clicks on save, I should get HTML data.
For example , if user writes:Hello World
then I should get <!Doctype HTML><body>Hello <b><i>World</i></b></body></html>
What are my options here? are there any previous projects like this or do i have to make this from scratch?
You can use Character Style sub-classes of Android for the styling of your texts. Then use HTML class to get the HTML equivalent of your text. I'm currently developing one and those are the ones I used. You may also check out https://github.com/commonsguy/cwac-richedit for an example on how you could use Character Style for editing. :)

Categories

Resources