Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How do you get textview to be justified ? is it possible to get the solution? I have searched most of the forums but i didn't make it up. please help me out.
UPDATED
We have created a simple class for this. There are currently two methods to achieve what you are looking for. Both require NO WEBVIEW and SUPPORTS SPANNABLES.
LIBRARY: https://github.com/bluejamesbond/TextJustify-Android
SUPPORTS: Android 2.0 to 5.X
SETUP
// Please visit Github for latest setup instructions.
SCREENSHOT
Android doesn't support text justification, sorry. You can use android:gravity attribute to align text to left or right or center etc, but you can't really justify it. The only option I guess is to use a WebView to show text and then use CSS to get the text justified.
<RelativeLayout android:id="#+id/RelativeLayout01"
android:layout_height="wrap_content" android:layout_width="fill_parent">
<TextView android:id="#+id/TextView2" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="I'm TextView- Left" android:layout_alignParentLeft="true">
</TextView>
<TextView android:id="#+id/TextView1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="I'm TextView- Right" android:layout_alignParentRight="true">
</TextView>
</RelativeLayout>
ScreenShot:
Hope this helps. If you have any difficulties write back.- Thanks
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I am fairly new to using android studios.
the below error cropped up while trying to adjust the color
try this
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#color/colorAccent"/>
or this
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ff00"/>
or this
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#android:color/black"/>
You need to use #android:color/black or provide a hexadecimal color code value
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm trying to create a progress bar like the following image.
My requirements are:
1. I want to be able to set a progress value to it programmatically.
2. I want to be able to change the colors of the arc - both the background one (grey) and the foreground one (green).
I looked into libraries but found none that do it in this particular shape and style. I am not proficient enough in creating custom drawables to be able to create this by myself. Any help is appreciated!
In addition to the above answer, you can also use CircleProgress which seems to have something that looks exactly like your use case:
Usage:
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="#+id/arc_progress"
android:background="#214193"
android:layout_marginLeft="50dp"
android:layout_width="100dp"
android:layout_height="100dp"
custom:arc_progress="55"
custom:arc_bottom_text="MEMORY"/>
Also, if you check the license on this library (bottom of their README), it seems like it's very favorable to using it however you wish.
You can use SeekArc. It can do everything you need to get that result.
It would look something like this
<com.triggertrap.seekarc.SeekArc
android:id="#+id/seekArc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="30dp"
seekarc:rotation="180"
seekarc:startAngle="30"
seekarc:sweepAngle="300"
seekarc:arcColor="#color/grey"
seekarc:progressColor="#color/green"
seekarc:touchInside="true" />
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm developing an Android application, this application load video file from android gallery that saved on SD Card.
I need to know how can I add overlays to this video
I need to add title and image on this video like brand images
I can not find an example or tutorial describe how to do this operation
Do I have to use decoding to add overlays? , And if yes how can I do that.
Any example about this...
Provided you're playing the video using a VideoView or similar, you can overlay any View (e.g. TextView, ImageView) using a RelativeLayout.
For example, to show a text on the top right corner of the video:
<RelativeLayout
android:id="#+id/playerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<VideoView
android:id="#+id/videoPlayer"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="#+id/videoText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp"
android:text="#string/player_text" />
</RelativeLayout>
As #rbarriuso said, ffmpeg4Android is able to meet your requirement. There is also a guide to install both library and demo in both Android Studio and Eclipse. Following, there are also the watermark command which may satisfy you.
Hope it can help
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am new in android.
I want to join two EditBox into 1 EditBox.
Anyone can help me here.
Thanks in Advance.
Give background to a linear layout with vertical orientation and add two transparent text box in it.
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background_of_big_edittext"
android:orientation="vertical" >
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_of_your_divider" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent" />
</LinearLayout>
I dont know if you are talking about the UI. But you can take the texts from the edit text by get text method. Why cant you join both the texts to a single string and use the combined string in program?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have the same problem as discussed on Handling click events on a drawable within an EditText, but I use TextView instead of EditText. When I click on the TextView, the method onTouchEvent(MotionEvent event) is called. Is it possible to handle a click only on the icon?
I think the idea is pretty much the same as described here: use the event coordinates and determine if they are within the drawable's bounds. If they are, perform your action. I don't think there are any major differences between TextView and EditText in this respect.
I think that it would be a better idea to use a TextView and an ImageView. Of course, it leads to a more complex layout structure, but I'd prefer two widgets in an XML file rather than too much Java code dealing with the widgets.
<TextView
android:id="#+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="#+id/iv"
android:text="#string/long_text"
android:textSize="22sp" />
<ImageView
android:id="#id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:contentDescription="#string/app_name"
android:src="#drawable/btn_go" />