android-drawable

Click on EditText's drawable right with Espresso

旧巷老猫 提交于 2019-12-21 05:08:48
问题 How could be possible to click on EditText's right drawable (check the screenshot)? I have tried several ways but I always get stuck. public static Matcher<View> withEditTextDrawable(final int resourceId) { return new BoundedMatcher<View, EditText>(EditText.class) { @Override protected boolean matchesSafely(final EditText editText) { // ???? return false; } @Override public void describeTo(Description description) { description.appendText("with drawable from resource id: "); description

Android nine patch - allow only a specific area of a background drawable to stretch

我怕爱的太早我们不能终老 提交于 2019-12-20 15:10:24
问题 How does one go about creating a View that has boundaries with triangular perforations ? I've been using background drawables to achieve this so far. That works when the dimensions of the View are fixed. Now I have a situation where the height of the View is not constant, so I need to have the height variable on the fly. I can't use a background drawable with a fixed height anymore. Here is the original background drawable: And this is what the final View needs to look like: Another way of

Android nine patch - allow only a specific area of a background drawable to stretch

无人久伴 提交于 2019-12-20 15:09:21
问题 How does one go about creating a View that has boundaries with triangular perforations ? I've been using background drawables to achieve this so far. That works when the dimensions of the View are fixed. Now I have a situation where the height of the View is not constant, so I need to have the height variable on the fly. I can't use a background drawable with a fixed height anymore. Here is the original background drawable: And this is what the final View needs to look like: Another way of

Custom shaped Linearlayout with curved side in android

允我心安 提交于 2019-12-20 11:59:09
问题 I am trying to make a custom shaped linearlayout like below I am trying to make only one side curved. Tried with corner radius but it doesn't give the same look as above. Already tried this background shape as below :- <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#3F51B5" /> <padding android:bottom="7dp" android:left="7dp" android:right="7dp" android:top="7dp" /> <corners android

How to remove border only from one side of the element?

无人久伴 提交于 2019-12-20 09:49:43
问题 I have: <stroke android:width="1px" android:color="#A6ACB1"/> I'd like to remove this border from the bottom (for example) of the element. Is it possible? (Eclipse suggests me only: color, width, dashWidth and dashGap). 回答1: As far as I understand it, there isn't an easy way of doing it. but if you use layer-list with an item that has the border and then one that doesn't with an offset from all the sides for which you want a border equal to the border width, you'd achieve that. Let me make

How to create a right facing arrow (chevron) using XML shapes in android? [closed]

夙愿已清 提交于 2019-12-20 08:49:11
问题 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 . How to create a right facing arrow using xml shapes in android like this?? 回答1: I've had a similar problem. Here's how I solved it: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <shape> <solid android:color="@android:color/transparent"/> <size

How to center vector drawable in layer-list without scaling

半世苍凉 提交于 2019-12-20 08:09:59
问题 I am attempting to use a VectorDrawable in a LayerList without scaling the vector. For example: <layer-list> <item android:drawable="@color/grid_item_activated"/> <item android:gravity="center" android:drawable="@drawable/ic_check_white_48dp"/> </layer-list> The drawable ic_check_white_48dp id defined as: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="48dp" android:height="48dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android

Rotating FloatingActionButton

别来无恙 提交于 2019-12-20 06:21:05
问题 I believe most of you all have seen the rotating FloatingActionButton in apps such as Google keep, push bullet and even Google inbox app. I am trying to achieve this rotation by having an animation file that is : <?xml version="1.0" encoding="UTF-8"?> <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromDegrees="0" android:toDegrees="135" android:pivotX="50%" android:pivotY="50%" android:repeatCount="0" android:fillAfter="true" android:fillEnabled="true" android

Progress bar with image in center

人走茶凉 提交于 2019-12-19 19:49:16
问题 Hi guys today i'am trying to do my custom progress bar, for that i created a spinner_inner and a spinner_outer, but my inner size is to large and overlaps the outer. my activity <ProgressBar style="@style/Spinner" android:layout_width="100dp" android:layout_height="100dp" android:indeterminateDrawable="@drawable/loading" /> <TextView android:id="@+id/login_status_message" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android

How to create curved bottom border rectangle in android?

血红的双手。 提交于 2019-12-19 08:09:35
问题 how to create android drawable with perfect curved bottom using xml like this : i have tried this xml, but the result didn't perfect <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#5f9c63"/> <padding android:left="1dp" android:top="1dp" android:right="1dp" android:bottom="1dp" /> <corners android:bottomRightRadius="100dp" android:bottomLeftRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="0dp"/>