drawable

Failing to draw on a Gtk.DrawingArea

ぃ、小莉子 提交于 2019-12-11 08:38:39
问题 I'm not able to draw, i've already read tutorials, i can't find the problem. I simply have a correct UI drawed by Glade. Then i want to draw, for example 50 drawing areas. So i create a Grid with 50 cells; for each cell there is a vertical box (with a drawing area and a label inside each one). But i can't seen anything drawed. class collega_GUI: def __init__(self): try: self.__builder = Gtk.Builder() self.__builder.add_from_file('UI2.glade') self.__Grid = Gtk.Grid() self.__Grid.set_margin

How to store drawable in an array

穿精又带淫゛_ 提交于 2019-12-11 08:35:43
问题 I want to download a bunch of images and would like to store it as drawable in an array. So I tried declaring a drawable array.But it returns me nullPointer exception when I access that array. My question is, how to declare an array type as drawable ? 回答1: an array of drawables would be declared like: int numDrawables = 10; Drawable[] drawableArray = new Drawable[numDrawables]; to fill the array: for(int i = 0; i < numDrawables; i++){ // get a drawable from somewhere Drawable drawable = new

Unable to understand the drawable structure inside res folder

[亡魂溺海] 提交于 2019-12-11 07:36:24
问题 I am newbie as far as android application development is considered. I am little bit confused about drawable folders. In the tutorials available on the android developer site they have mentioned about the drawable folder. But when I create android 2.3.3 application I see three folders drawable-hdpi , drawable-mdpi and drawable-ldpi . I know that this for screen resolutions. If I have an image as a resource I have to create equivalent three images with different sizes and put these images into

Understanding Drawables and Images sizes

拜拜、爱过 提交于 2019-12-11 07:36:22
问题 Firstly I did a lot of search to understand how it work, but I don't find simples tutorials. An exemple, this view: These are my drawables folders: The selected device is: Pixel 5.0 1080 x 1920 (xxhdpi). Immagine in this resolution (1080 x 1920) I set the image view on the top in blue color (Solutis) with 700px of width and 250 px of height, how I have to resize this images for each drawables folders ? I found this informations: LDPI - 0.75x MDPI - Original size // means 1.0x here HDPI - 1.5x

How to make a progress bar use an image to show progress instead of using a color in Android

大兔子大兔子 提交于 2019-12-11 06:59:23
问题 I have a logo image that I would like to use in my progress bar. Each time an image is downloaded, my progress bar creeps up using a blue bar. However, I would prefer that it slowly display my logo image, one bit at a time. I tried: android:progressDrawable="@drawable/logo" but that just set the entire progress bar immediately to my image. I also tried setting it dynamically with: progressBar.setProgressDrawable(getResources()...etc) but this just left me with no view and a black empty space.

Drawables next to buttons?

≡放荡痞女 提交于 2019-12-11 05:31:48
问题 Ive been working on a simple app that has a feature where you can test your knowledge by answering multiple choice questions. After an answer is selected(by the radio button), i want to show either a check mark if the answer is correct, or an "X" if the answer is incorrect, to the right of the selected answer. For some reason, my code works perfectly for the first try, and then doesnt change anything when selecting other answers. heres the code (its part of an adapter - child view) /** *

how to pass an object containing with drawable parameter to another activity through intent using Parcelable Interface In android

谁说胖子不能爱 提交于 2019-12-11 04:15:41
问题 I want to pass an object containing a drawable field using Parcelable Inteface to another Activity. But problem is, in public void writeToParcel(Parcel parcel, int flags) overridden method in class(whose object has to send), I can't have "parcel.writeDrawable" kind of method. So other fields I'm able to pass, but not Drawable. I have added the following methods in my class after implementing Parcelable Interface. public static final Parcelable.Creator<ImageInfo> CREATOR = new Parcelable

Android: animate circular progress drawable

谁都会走 提交于 2019-12-11 02:56:56
问题 I need a drawable that looks like the rotating progress circle. That drawable I want to use for instance in an ImageView inside a GridView etc. So, according to other posts I took the progress_medium_holo.xml from the folder \sdk\platforms\android-xx\data\res\drawable which looks like this. And I also copied the PNG files which are used by this drawable. <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <rotate android:drawable="@drawable/spinner_48_outer_holo"

Vector Drawables in Layer List on Android API 16 and higher

怎甘沉沦 提交于 2019-12-11 02:38:13
问题 I am having some trouble with vectors drawable on older API version in Android. I need to change drawables at runtime each time the activity starts should load the corresponding svg file. This is my layer list : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item > <shape android:shape="oval"> <size android:height="50dp" android:width="50dp"/> <!-- fill color --> <solid android:color="@color/white" /> </shape> </item> <item

Android compare imageView with image

本秂侑毒 提交于 2019-12-11 01:36:07
问题 I want to compare current imageView with image from R.drawable. I guess I tried everything but I can't solve this one. I tried everything form stack overflow. XML: <ImageView android:layout_width="match_parent" android:src="@drawable/red" android:id="@+id/imageview1" android:clickable="true" android:layout_height="match_parent" /> Android: final ImageView test = (ImageView) findViewById(R.id.imageview1); test.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v