textview

Android How to change text color according to background image

匆匆过客 提交于 2021-01-23 01:59:32
问题 On Android, I have a header with a background image (Random image according to API). On this header I have texts with some data. My text is every time black but sometimes image is black too. So, we can't see the text. I'm looking for library or snippet for resolve this problem. Thanks. 回答1: You can use the palatte library for this. Please see the following: https://developer.android.com/reference/android/support/v7/graphics/Palette.html https://developer.android.com/training/material/palette

BackgroundColorSpan adjust height or add a padding to it

五迷三道 提交于 2021-01-22 06:53:45
问题 I have an app where I am displaying multiple lines, and multiple paragraphs, of formatted text in a TextView . I am using SpannableStringBuilder for this purpose. One of the things I want to do here is to be able to highlight the text. Now I have tried using BackgroundColorSpan , but in this case, the background on the text covers the complete line-height. I want it to cover only the text instead. There seems to be no apparent way to set a vertical padding or height on this span. Just the

BackgroundColorSpan adjust height or add a padding to it

牧云@^-^@ 提交于 2021-01-22 06:51:29
问题 I have an app where I am displaying multiple lines, and multiple paragraphs, of formatted text in a TextView . I am using SpannableStringBuilder for this purpose. One of the things I want to do here is to be able to highlight the text. Now I have tried using BackgroundColorSpan , but in this case, the background on the text covers the complete line-height. I want it to cover only the text instead. There seems to be no apparent way to set a vertical padding or height on this span. Just the

Android Expandable text view with “View More” Button displaying at center after 3 lines

梦想与她 提交于 2021-01-20 18:29:26
问题 I want to display description in a text view, if the description is more than 3 lines i want to display a View more button that expands the text view with complete description (or a dialog with complete description) I have referred some links 1) How can I implement a collapsible view like the one from Google Play? The above solution has an arrow like image view at end of third line of text view but i want a button displaying below the text view if description crosses 3 lines. 2) Add "View

dynamic size textview nativescript when you are writing a message

风流意气都作罢 提交于 2021-01-05 07:15:47
问题 I make a messagerie service like whatsapp in nativescript with angular2 and i have a issue with the size(height) of the textview when you are writing a message in the android platform. i want the height increase when you add an other line (like whatsapp or facebook, etc). In IOS, it's simple. click on the link dynamic size of a textview in IOS my html template is (just the bottom of the screen) : <StackLayout class="message-box-container"> <GridLayout columns="auto, *, auto" class="message

dynamic size textview nativescript when you are writing a message

风格不统一 提交于 2021-01-05 07:14:16
问题 I make a messagerie service like whatsapp in nativescript with angular2 and i have a issue with the size(height) of the textview when you are writing a message in the android platform. i want the height increase when you add an other line (like whatsapp or facebook, etc). In IOS, it's simple. click on the link dynamic size of a textview in IOS my html template is (just the bottom of the screen) : <StackLayout class="message-box-container"> <GridLayout columns="auto, *, auto" class="message

Autosizing TextViews in RecyclerView causes text size to decrease

我的未来我决定 提交于 2020-12-29 09:21:05
问题 I am trying to use Autosizing TextViews in a RecyclerView, but when I scroll a few times the text gets so small that it's obviously not working properly. Example of my TextView: <android.support.v7.widget.AppCompatTextView android:id="@+id/textview_unit_title" android:layout_width="@dimen/tile_image_size" android:layout_height="wrap_content" android:maxLines="2" android:textSize="@dimen/medium_size" android:textColor="@color/color_text" android:paddingTop="@dimen/padding_title" android:layout

TextView works wrong with breakStrategy=“balanced” and layout_width=“wrap_content”

£可爱£侵袭症+ 提交于 2020-11-30 06:56:48
问题 I have such layout (I've removed some attributes, cause they really doesn't matter, full demo project is here): <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="wrap_content" (* this is important) android:layout_height="wrap_content" android:breakStrategy="balanced" (* this is important) android:text="@string/long_text" /> </LinearLayout> The text long_text is quite long, so it would be

Issue: change border color or box stroke for unfocused TextInputLayout in android

女生的网名这么多〃 提交于 2020-11-30 04:42:22
问题 I have a very specific issue for changing the outline of the textbox for TextInputLayout when it's unfocused. I can't seem to find an attribute to change the color for the border of my "unfocused" text box. Here's a visual example of what I'm trying to do: The color of this (textbox):border is not white. currently its not focused. After I click it, it turns white: I don't know what I need to change, it doesn't seem like there is an attribute to change it. I'm also using material design text

Issue: change border color or box stroke for unfocused TextInputLayout in android

旧街凉风 提交于 2020-11-30 04:39:00
问题 I have a very specific issue for changing the outline of the textbox for TextInputLayout when it's unfocused. I can't seem to find an attribute to change the color for the border of my "unfocused" text box. Here's a visual example of what I'm trying to do: The color of this (textbox):border is not white. currently its not focused. After I click it, it turns white: I don't know what I need to change, it doesn't seem like there is an attribute to change it. I'm also using material design text