android-drawable

How to draw a line of circles in android [closed]

时间秒杀一切 提交于 2019-12-01 10:42:39
I wanted to have a drawable resource that features a row of circles, with one of them in solid background similiar to this (refer to the row of circles at the bottom). I wanted to show an animation of it going from left to right, and having a drawable resource is the first step of achieving it. How can I do that. thanks I use a TextView to which five strings (I have 5 steps) all composed with Unicode characters (\u26cb for the empty circle) and (\u26cf for the filled circle). Like this (i stored them in my res/values/arrays.xml file): <!-- Steps --> <string-array name="steps"> <item>\u25cf

How to draw a line of circles in android [closed]

笑着哭i 提交于 2019-12-01 07:40:08
问题 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 last year . I wanted to have a drawable resource that features a row of circles, with one of them in solid background similiar to this (refer to the row of circles at the bottom). I wanted to show an animation of it going from left to right, and having a drawable resource is the first step of

drawable v21, v24? what is it? [duplicate]

社会主义新天地 提交于 2019-12-01 05:54:13
This question already has an answer here: Newer versions of Android Studio and only two drawable directory - drawable and drawable-v21 1 answer When I'm creating drawables some of them goes to v21, v24 folder. Why is this happening? Will they appear in andoid api 15 (android 4)? Do I need to do something? Those drawable folders are actually for providing device compatibility (i.e. to manage different screen densities in android) and different android versions. 来源: https://stackoverflow.com/questions/47093515/drawable-v21-v24-what-is-it

XML drawable having different behavior on 4.3 and 4.1.2

大城市里の小女人 提交于 2019-12-01 04:00:18
I have the folowing drawable, <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="3dp"/> <padding android:left="1dp" android:right="1dp" android:top="1dp" android:bottom="1dp"/> <stroke android:width="1dp" android:color="#e4e4e4"/> </shape> "It supposed" to draw a border when set on background, actually on (Android 4.3 /goole nexus 7) it does , but unfortunately on (Android 4.1.2/ Samsung galaxy tab 10") it just fill all the background with the color If someone can tell me what I'm doing

XML drawable having different behavior on 4.3 and 4.1.2

可紊 提交于 2019-12-01 01:43:06
问题 I have the folowing drawable, <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="3dp"/> <padding android:left="1dp" android:right="1dp" android:top="1dp" android:bottom="1dp"/> <stroke android:width="1dp" android:color="#e4e4e4"/> </shape> "It supposed" to draw a border when set on background, actually on (Android 4.3 /goole nexus 7) it does , but unfortunately on (Android 4.1.2/ Samsung

How proportionally scale any image (of imageview) with width equal to “match_parent”?

不打扰是莪最后的温柔 提交于 2019-12-01 01:36:50
I may have different drawables (large or small) and I always spans the width (match_parent) and increase or decrease the height proportionally. Maintaining the ratio. How is this possible? I tried with: <ImageView android:id="@+id/iv_TEST" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitXY" android:src="@drawable/test" /> The problem is that it increases or decreases the width and it looks bad. ephramd Fixed. To correct this problem you need to do: Custom ImageView Set drawable to "android:src" , from code (

How to open Side bar on icon click in Android?

南笙酒味 提交于 2019-12-01 00:30:29
I have implemented Hamburger bar with App toolbar and both of them are working fine. Following is the snapshot of toolbar and hamburger bar: Hamburger bar I can open this bar by sliding it but I also want to make it open by clicking on drawable icon (right top corner icon). How can i do that? MainActivity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayShowHomeEnabled(true); drawerFragment =

How should we use the mipmap folders added with android 4.4?

只谈情不闲聊 提交于 2019-11-30 21:52:06
I recently installed one more Android SDK to Android Studio, the SDK version 4.4 (API level 19), and after using it with my project, it added a set of mipmap folders in the project's res folder ( res/mipmap ). I neither understand why, or how to use them. I read another question about it here on SO . The answer to it said that: The mipmap folders are for placing your app icons in only. Any other drawable assets you use should be placed in the relevant drawable folders as before. According to this Google blogpost : It’s best practice to place your app icons in mipmap- folders (not the drawable-

Android's gradient drawables: poor quality of screenshots in Eclipse

◇◆丶佛笑我妖孽 提交于 2019-11-30 20:26:57
I'm using drawables like the following one for backgrounds with a gradient: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#ffffff" android:endColor="#cccccc" android:angle="-90" android:dither="true" /> </shape> This results in a banded gradient on the emulator, and when I take a screenshot of the emulator (using Eclipse), the result is even poorer: Why? And how to solve this problem? It is although I'm using android:dither="true" in the drawables' XML and setting this in the

How proportionally scale any image (of imageview) with width equal to “match_parent”?

◇◆丶佛笑我妖孽 提交于 2019-11-30 20:25:19
问题 I may have different drawables (large or small) and I always spans the width (match_parent) and increase or decrease the height proportionally. Maintaining the ratio. How is this possible? I tried with: <ImageView android:id="@+id/iv_TEST" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitXY" android:src="@drawable/test" /> The problem is that it increases or decreases the width and it looks bad. 回答1: Fixed. To