android-drawable

how to draw alphabets and draw line on it by finger? [closed]

僤鯓⒐⒋嵵緔 提交于 2019-12-06 05:46:41
问题 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 . I want to create letters and words dynamically on view and also I want to draw line on it by finger. For example I have letters like A as given in picture: I would like to draw like this as given in picture: The problem is that the line is drawn on the whole view. I want to find

Add Color “#e3bb87” to StateListDrawable programmatically

ε祈祈猫儿з 提交于 2019-12-06 04:46:12
The reason I need to do this programmatically is that the text color is downloaded and not pre defined in the xml. I read this Replace selector images programmatically I only need to know from StateListDrawable states = new StateListDrawable(); states.addState(new int[] {android.R.attr.state_pressed}, getResources().getDrawable(R.drawable.pressed)); how turn into states.addState(new int[] {android.R.attr.state_pressed},**theMethodImLookingFor**("#e3bb87")); forget about getResources().getColor(R.color.anycolor) , the color is not defined in xml You can use this: states.addState(new int[]

Clarification on 'private' drawables in android.R.drawable

倖福魔咒の 提交于 2019-12-06 03:29:05
问题 I am making a menu for an app and was pointed to this useful resource which lists all the drawables that are part of the android 2.0 jar. the usage example given is myMenuItem.setIcon(android.R.drawable.ic_menu_save); Unfortunately, the one I want (and most of the list) are not available by default. I get android.R.drawable.ic_menu_login cannot be resolved when I try to set the menu item images: @Override public boolean onCreateOptionsMenu(Menu menu) { // Add two example menu buttons int

Integer array of resource ids returns 0

柔情痞子 提交于 2019-12-06 03:27:43
问题 I have a set of resource ids stored in an array. This is accessed inside the recycler view to populate an image view. The problem is when I access the array, all values returned is 0. // arrays.xml <array name="array_category_icons"> <item>@drawable/autumn</item> <item>@drawable/backpack</item> </array> // inside recycler view adapter int[] myIcons = getActivity().getResources().getIntArray(R.array.array_category_icons); myIcons[i] always returns 0. The drawables are in the hdpi folder only.

Create animation by changing image in ImageView with Timer (or Handler)

独自空忆成欢 提交于 2019-12-06 03:25:07
问题 I want to create an simple animation by changing frames inside an ImageView. I don't want to use AnimationDrawable because i need to receive events when a frame changed or when the animation stoped, to be able to play it backwards, restart it and so on. My problem is that the frames doesn't actually change event though setImageDrawable gets called (on the main thread). So everythings seems to work fine excepts that the frames doesn't change (actually just a frame is drawn, the first one). So

Why drawable color filter is applied in all places?

别说谁变了你拦得住时间么 提交于 2019-12-06 02:46:08
In a section of my app I need my drawable R.drawable.blah to be filtered to white color (originally is red), so I have this method: public final static Drawable getFilteredDrawable(Context context, @DrawableRes int drawable, @ColorRes int color) { Drawable d = ContextCompat.getDrawable(context, drawable); d.setColorFilter(ContextCompat.getColor(context, color), PorterDuff.Mode.SRC_IN); return d; } and I use it this way: DrawableUtil.getFilteredDrawable(this, R.drawable.blah, android.R.color.white); Problem is that now the drawable becomes white in the whole app, even not applying the filter. I

Android: Rounded Corners TextView XML Layout with custom Header

自作多情 提交于 2019-12-06 01:37:02
I would like to create a custom XML layout for my TextView, using rounded corners and a custom header, such as this example. I found this very useful link that creates the following quite similar result. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Bottom 2dp Shadow --> <item> <shape android:shape="rectangle"> <solid android:color="#d8d8d8" /> <corners android:radius="7dp" /> </shape> </item> <!-- White Top color --> <item android:bottom="3px"> <shape android:shape="rectangle"> <solid android:color="#FFFFFF" /> <corners

Color overlay on drawable Android

三世轮回 提交于 2019-12-06 01:28:48
I've been following this tutorial here Medium - Diagonal Cut View to get that diagonal view effect <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/colorPrimary" /> <item> <bitmap android:src="@drawable/bebe" android:gravity="center" android:alpha="0.1" /> </item> <item android:top="260dp" android:bottom="-100dp" android:left="0dp" android:right="-260dp"> <rotate android:fromDegrees="-10" android:pivotX="0%" android:pivotY="100%"> <shape android:shape="rectangle"> <solid android:color="@android:color

OneSignal-Pushnotification small icon not displayed on Android

≡放荡痞女 提交于 2019-12-05 19:40:41
We have a Cordova-App which contains a file 'icon.png' in every drawable-xy folder. We provide push notifications using OneSignal. The notifications are working as expected. Except the small icon. There is only a blank icon on the top bar of my phone, where app-symbols are displayed. I tried using the following snippet: { ... "small_icon" : "@android:drawable/icon.png" .... } I also tried lots and lots of other variations without "android", without "drawable", without slash, with .png and without .png. etc. etc. I found this in the documentation: ( https://documentation.onesignal.com/reference

Has the new Password Visibility Toggle broken existing drawableRight for EditTexts?

♀尐吖头ヾ 提交于 2019-12-05 17:16:08
问题 EDIT I just tried an EditText without a TextInputLayout and it works as expected. So the problem must be with new changes in the TextInputLayout . I have been using a custom EditText class as child of a TextInputLayout for around a month. When the user typed, an x would appear in the drawableRight field. I have successfully displayed images for drawableLeft , drawableTop , and drawableBottom , but setting drawableRight provides me with a blank. Note: Clicking the blank space where the X