android-drawable

How to create drawable folder in res?

孤街浪徒 提交于 2020-07-10 12:15:20
问题 I am trying to create drawable-hdpi drawable-xxhdpi drawable-ldpi folders for different screens but unable to create as it says the folders already exist but i can't see them also when trying to create drawable-xxhdpi folder on click nothing happens no folder's are create Screenshots below Can't see any drawable-xhdpi folder although it says it exist Here on clicking OK nothing happens no folder is created 回答1: Yes it already exist. you have to change the project structure Click on top left

how to change visiblity (visible, invisible or gone ) of setEndIconDrawable in TextInputLayout android?

痴心易碎 提交于 2020-07-10 03:13:05
问题 I am trying to make invisible or visibility gone of endIconDrawable which is the edit icon in the picture above for FirstName field only and want to keep visibile edit icon rest of the fields but unable to do? How can i do this? <com.google.android.material.textfield.TextInputLayout android:id="@+id/tilFirstName" android:layout_width="match_parent" android:layout_height="@dimen/_64dp" app:endIconDrawable="@drawable/icon_edit" app:endIconMode="custom"> <com.google.android.material.textfield

how to change visiblity (visible, invisible or gone ) of setEndIconDrawable in TextInputLayout android?

断了今生、忘了曾经 提交于 2020-07-10 03:12:42
问题 I am trying to make invisible or visibility gone of endIconDrawable which is the edit icon in the picture above for FirstName field only and want to keep visibile edit icon rest of the fields but unable to do? How can i do this? <com.google.android.material.textfield.TextInputLayout android:id="@+id/tilFirstName" android:layout_width="match_parent" android:layout_height="@dimen/_64dp" app:endIconDrawable="@drawable/icon_edit" app:endIconMode="custom"> <com.google.android.material.textfield

Resource entry is already defined

蹲街弑〆低调 提交于 2020-06-27 10:30:16
问题 I'm trying to add a splash.png image but when I compile it says this: Error:error: Resource entry splash is already defined. res\drawable-hdpi-v4\splash.jpg:0: Originally defined here. Error:error: Resource entry splash is already defined. res\drawable-xhdpi-v4\splash.jpg:0: Originally defined here. Error:error: Resource entry splash is already defined. res\drawable-xxhdpi-v4\splash.jpg:0: Originally defined here. Error:Execution failed for task ':app:processDebugResources'. > com.android.ide

Android drawable-hdpi-night folder

风流意气都作罢 提交于 2020-06-25 08:58:27
问题 Please help, I am playing with small example of day-night mode in Android. So far so good. I have 2 images (of multiple size) that I am displaying depending on the phone mode (day/night), unfortunately I can't get it how, to name the folders that contain the images (in different resolution) in order to have a separate distinction. For the proper moment, the picture below contains the last try: and the error: Also I would like to have this structure into separate landscape/portrait folders us

Android Espresso match BitmapDrawables with different tint

耗尽温柔 提交于 2020-05-14 18:36:06
问题 Is there some way to compare two Bitmaps which are wrapped by the BitmapDrawable . The comparison should not fail if the sizes doesn't match, but it should match pixels and the color of the Bitmap I am not sure how the native part of Android draws the Bitmap , because sameAs returns true even though the tint color is different. If the size is different, I can create scaled Bitmap from the other and the compare these to. In my source code I use DrawableCompat.setTint with the ImageViews

How to make a drawable Shape programmatically (Android)

柔情痞子 提交于 2020-04-08 14:42:30
问题 i'm making a custom TextView (Java class) and i'm having trouble "to translate" the line (on "original TextView" xml) android:background="@drawable/myDrawableShape" to a java void to change the color of the "myDrawableShape" myDrawableShape.xml <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#ffafafaf" /> <corners android:radius="15dp" /> I'll get the color to set from a String, the void to change the color programmatically could be (for example) void

How to make a drawable Shape programmatically (Android)

给你一囗甜甜゛ 提交于 2020-04-08 14:42:07
问题 i'm making a custom TextView (Java class) and i'm having trouble "to translate" the line (on "original TextView" xml) android:background="@drawable/myDrawableShape" to a java void to change the color of the "myDrawableShape" myDrawableShape.xml <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#ffafafaf" /> <corners android:radius="15dp" /> I'll get the color to set from a String, the void to change the color programmatically could be (for example) void

Does BadgeDrawable not work for views within a FrameLayout such as buttons, images, textviews etc.?

我们两清 提交于 2020-03-24 11:10:52
问题 I have this function in my main activity which doesn't display a badge: private fun setFindShiftBadge(state: HomeState) { val findShiftsBadge = BadgeDrawable.create(this) home_framelayout.foreground = findShiftsBadge findShiftsBadge.badgeGravity = BadgeDrawable.TOP_END findShiftsBadge.backgroundColor = resources.getColor(R.color.colorWhite) findShiftsBadge.badgeTextColor = resources.getColor(R.color.colorPrimary) findShiftsBadge.number = state.availableShifts.size } In the same activity, I

Diamond shape xml background for android view

杀马特。学长 韩版系。学妹 提交于 2020-03-18 10:10:14
问题 Hi anyone please suggest me how to create android xml drawable like below image? Now I am using below code <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <rotate android:fromDegrees="45" android:pivotX="-40%" android:pivotY="87%" android:toDegrees="45"> <shape android:shape="rectangle"> <stroke android:width="10dp" android:color="@color/colorAccent" /> <solid android:color="@color/colorAccent" /> </shape> </rotate> </item>