drawable

Items inside GridView getting repeated when screen scrolls

前提是你 提交于 2019-11-27 11:09:12
I'm using a GridView to show a set of Categories that user can chose. Each item of the grid is consisted by an ImageView and a TextView, both retrieved from server. When an item is touched, another activity is started. I thought everything was going right, until I've noticed that some itens were getting repeated when I scrolls the screen. Whenever I scroll down trough the grid, and then back, itens change itś position and get duplicated. But even when I touch the messed up itens, the right values are send to the next activity. Looking in LogCat, any repeated request to server occurs. In fact,

error: cannot find symbol variable abc_ic_ab_back_mtrl_am_alpha

谁说我不能喝 提交于 2019-11-27 11:02:53
问题 I added a Fragment to my Android Studio project using New > Fragment > Fragment (Blank) . As a result when I try to run, the project won't compile because it cannot resolve R.drawable.abc_ic_ab_back_mtrl_am_alpha in toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha); Any ideas how to solve this? It looks like I also lost access to android:buttonTint 回答1: The name of the resource was changed in the 23.2.0 support library. Modify abc_ic_ab_back_mtrl_am_alpha to abc_ic_ab_back

Drawable Rotating around its center Android

ε祈祈猫儿з 提交于 2019-11-27 10:51:26
问题 I am getting strange results with the following code: iv = (ImageView) findViewById(R.id.iv); iv.setImageResource(R.drawable.spinner_white_76); Animation a = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, iv.getDrawable() .getIntrinsicWidth() / 2, Animation.RELATIVE_TO_SELF, iv.getDrawable().getIntrinsicHeight() / 2); a.setRepeatCount(-1); a.setDuration(1000); iv.startAnimation(a); Whats the right way to specify the axis point (center of the drawable)? 回答1: Feel stupid! Got it

The colored image turned to have no color and just a grey vector in drawable?

坚强是说给别人听的谎言 提交于 2019-11-27 10:47:30
问题 I have created a new Image Assets in the Drawable cus I need to insert a new image in my app, but every time I create a new image asset, the output turns to be no colour at all. I've attached the pic of it. It's confusing and whenever I import it in my layout, it's just grey all over as you can see in the image. Why is it cus I can't find any ready solutions? Let me know if I'm overlooked. 回答1: I got the answer for my own question which I find it's useful for some who still do not know how to

Why isn't my vector drawable scaling as expected?

痴心易碎 提交于 2019-11-27 10:23:15
I am attempting to use vector drawables in my Android app. From http://developer.android.com/training/material/drawables.html (emphasis mine): In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without losing definition. Using this drawable: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="@color/colorPrimary" android:pathData="M14,20A2,2 0 0,1 12,22A2,2 0 0,1 10,20H14M12,2A1,1 0 0,1 13,3V4.08C15.84,4.56 18,7.03 18

Modifying the color of an android drawable

只谈情不闲聊 提交于 2019-11-27 10:09:34
I would like to be able to use the same drawable to represent both: and as the same drawable, and re-color the drawable based on some programmatic values, so that the end user could re-theme the interface. What is the best way to do this? I have tried (and reused the icons from) this previous S.O. question but I can't represent the change as a simple change of hue, since it also varies in saturation and value.. Is it best to store the icon as all white in the area I want changed? or transparent? or some other solid color? Is there some method that allows you to figure out the matrix based on

What's the correct size icon for drawable-xxhdpi?

不羁的心 提交于 2019-11-27 10:05:55
As we know, the correct sized icon: * drawable-ldpi (120 dpi, Low density screen) - 36px x 36px * drawable-mdpi (160 dpi, Medium density screen) - 48px x 48px * drawable-hdpi (240 dpi, High density screen) - 72px x 72px * drawable-xhdpi (320 dpi, Extra-high density screen) - 96px x 96px On Jelly Bean, drawable-xxhdpi can be supported. So what's the correct size icon? MDPI: 48x48 HDPI: 72x72 XHDPI: 96x96 XXHDPI: 144x144 XXXHDPI: 192x192 to create an icon for different densities, you should follow the 2:3:4:6:8 scaling ratio between the five primary densities (medium, high, x-high, xx-high, and

Shape drawable as background, a line at the bottom

為{幸葍}努か 提交于 2019-11-27 09:24:20
问题 I am using a drawable as a background of a TextView just to have a divider line below the text. A achivied it with this drawable-xml: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape android:shape="rectangle"> <solid android:color="#FFDDDDDD" /> <gradient android:angle="0" android:startColor="#FFAAAAAA" android:endColor="#FFEEEEEE" /> </shape> </item> <item android:bottom="2dp"> <shape android:shape="rectangle">

Using drawable resources

99封情书 提交于 2019-11-27 09:00:06
I have this problem, see the trace stack: E/AndroidRuntime(2410): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: <bitmap> requires a valid src attribute My xml file looks like: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <bitmap android:src="@drawable/btn_1"/> </item> </layer-list> btn_1 is another xml file in drawable resources When i'm using an image(*.png) instead of xml drawable it's ok. Can I use a drawable resource as src to bitmap? Just in case here is my btn_1.xml file. It doesn't work even if btn_1 file have no items.

how to set status bar background as gradient color or a drawable in android

杀马特。学长 韩版系。学妹 提交于 2019-11-27 07:54:10
I want to set status bar background as gradient theme also status bar and action bar color should same gradient drawable, as per documentation we can set color to status bar in API level 21 and above by using <item name="android:statusBarColor">@color/colorPrimary</item> But i am searching something like <item name="android:statusBarDrawable">@drawable/myDrawable</item> I have seen example that use <item name="android:windowTranslucentStatus">false</item> <item name="android:windowTranslucentNavigation">false</item> but in that case status bar and action bar overlap (use fitSystemWindow =true