drawable

Drawable folders for high resolution handhelds

老子叫甜甜 提交于 2019-12-18 06:56:24
问题 I can't figure out how to produce drawables for the new "high-res" handhelds like the Galaxy Nexus, One X, Galaxy S3 etc that have a resolution of 1280x720 or higher. I always try to make as few layout-versions as possible. Preferably just one but at times a layout-long and notlong is necessary. And make the xml smart enough to handle all devices. But that's only possible if the drawable resources are there to supply all the different resolutions and sizes. All has been nice and smooth until

Constrain drawableLeft and drawableRight's height to TextView's height

本秂侑毒 提交于 2019-12-18 05:27:20
问题 I have the following TextView : <TextView android:drawableLeft="@drawable/loading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Updating Rates" /> And the result is this: How do I make the loading circle drawable constrain proportionally so its height matches the height of the text? Also, if possible, I would like to add some spacing between the text and the image. 回答1: To make the loading smaller just make the images smaller. Or use RelativeLayout

Can I use multiple shapes in one Android drawable?

落爺英雄遲暮 提交于 2019-12-18 04:33:12
问题 What I'm trying to do is define a common background for use in a LinearLayout which frequents my application on many of its Activitys. This particular layout is a header that shows on the top of each activity. What I'm trying to do is create a drawable that fills the linearlayout with a gradient and has a horizontal line below the gradient. Does anyone know if this is possible or do I have to do this sort of thing only with nested layouts. My attemptat the drawable xml is <selector xmlns

Drawables not changing after being replaced with others in the folders

不打扰是莪最后的温柔 提交于 2019-12-18 04:12:28
问题 I've created a new theme set for an app of mine, and decided I didn't need the old one anymore. So, I copied my new image files over the old ones, replacing all of them. I did this for all of my drawables folders. I then recreated R.java just in case, and rebuild my application. For some reason, it's picking up the old images and displaying those. Alright, I thought, must be something in the memory / cache. I'll just wipe my emulator image and try again. After doing so, the app still used the

Drawables not changing after being replaced with others in the folders

筅森魡賤 提交于 2019-12-18 04:12:13
问题 I've created a new theme set for an app of mine, and decided I didn't need the old one anymore. So, I copied my new image files over the old ones, replacing all of them. I did this for all of my drawables folders. I then recreated R.java just in case, and rebuild my application. For some reason, it's picking up the old images and displaying those. Alright, I thought, must be something in the memory / cache. I'll just wipe my emulator image and try again. After doing so, the app still used the

How to access res/drawable/“folder”

喜夏-厌秋 提交于 2019-12-18 02:51:34
问题 On my application I have many pictures which I have grouped in folder under res/drawable. But Android dosen't let me access them trough "R". Is there a way to access those folders. This is the Code im using for. ImageView iv = new ImageView(conext); iv.setImageResource(R.drawable.**smiley.666**); I marked the part which I can't access. Thx in Advance safari 回答1: No, Android does not allow subfolders under /res/drawable : Can the Android drawable directory contain subdirectories? You can

How to access res/drawable/“folder”

怎甘沉沦 提交于 2019-12-18 02:51:01
问题 On my application I have many pictures which I have grouped in folder under res/drawable. But Android dosen't let me access them trough "R". Is there a way to access those folders. This is the Code im using for. ImageView iv = new ImageView(conext); iv.setImageResource(R.drawable.**smiley.666**); I marked the part which I can't access. Thx in Advance safari 回答1: No, Android does not allow subfolders under /res/drawable : Can the Android drawable directory contain subdirectories? You can

How to reset AnimationDrawable

 ̄綄美尐妖づ 提交于 2019-12-17 23:15:30
问题 I have to animate a circular count down timer and I'm doing it by animating the background of an ImageView using AnimationDrawable (each image has the according slice of the circle removed). The problem is that the user has the ability to pause this animation, so I have to reload the animation but then a problem appears. I've tried setting the the animation to null, setting the background of the ImageView to null, setting the visibility of the animation, but practically nothing helped,

Android round edges on ring shaped progressbar

眉间皱痕 提交于 2019-12-17 22:36:19
问题 I'm trying to make a circular progress bar on android and it seems pretty straightforward task , but I'm struggling with rounding the edges of the progress and secondary progress. Is there a way to do that without making a custom view ? Using a corners radius ? or nine patch drawable ? For this view (see attachement) I'm using a simple xml file <item android:id="@android:id/progress"> <shape android:useLevel="true" android:innerRadius="@dimen/sixty_dp" android:shape="ring" android:thickness="

Find out if resource is used

白昼怎懂夜的黑 提交于 2019-12-17 22:08:43
问题 I am looking for an efficient way to find out if a resource (mostly a drawable) is used in Java or in an XML file. The problem is, that on my current project the drawables are changed often and now I have some drawables, which might never be used. Is there a tool/way to find those unused drawables without search each filename in the whole project? 回答1: I wrote a tool based on python to solve this problem. As this is not the place to share it directly, I created a project page which is now