nine-patch

Android studio mipmap and 9-patch drawables

二次信任 提交于 2019-12-06 04:34:06
I am facing strange issue trying to put 9 patch drawables into new android studio mipmap directories. I've put all the images to specified folders, just as I used to do with drawable, but when I try to include it in a project it says Cannot resolve symbol @mipmap/myfile but it definitely "finds" it as you can see at the screenshot. I think it cannot resolve the symbol because the "real" filename has .9, but dots cannot be used in defining drawable. ( I tried, it didn't work :) ) Is someone esle is facing same problem? Currently, I've added the drawables folders and defined everything eclipse

Ninepatch scaling wrong when scrolling after applying a Colorfilter?

依然范特西╮ 提交于 2019-12-06 03:56:29
today i tried to make my listview a bit more dynamic. So i created a white ninepatch-image and added a colorfilter with the .setColorFilter method. That's not the problem. But after applying this, everytime i scroll the Image is scaling wrong (randomly) so lets say my item is 100dp high with some text. After scrolling the item is still 100dp high and all text is shown but the image in the Background only uses 50dp now. Here's my code: here how i set the Colorfilter: orgleftbox = context.getResources().getDrawable(R.drawable.list_bubble); orgleftbox.setColorFilter( 0xff00c0ff, Mode.MULTIPLY );

Change the color of divider in LinearLayout

随声附和 提交于 2019-12-05 22:02:11
问题 May I know how I can change the color of divider in LinearLayout ? <LinearLayout android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal" android:divider="?android:attr/dividerVertical" android:dividerPadding="12dip" android:showDividers="middle" android:background="#ff2d2d2d" > ... </LinearLayout> Do I need to manually copy 9 patch image from Android SDK into my project, and define my own attribute to refer it? 回答1: It looks like android:divider

Ripple effect drawable is distorted when applied over 9patch background

最后都变了- 提交于 2019-12-05 18:34:20
I have a 9 patch drawable which I want to use as a background on a view. I want the view to show a ripple effect that follows the outline of a 9 patch when the view is clicked. Here's my activity, layout, and drawable code. MainActivity.kt: class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val click = findViewById<ConstraintLayout>(R.id.container) click.setOnClickListener { Toast.makeText(this, "Clicked", Toast.LENGTH_SHORT).show() } } } activity_main.xml: <?xml version="1.0"

How to use Nine-patch images correctly

爱⌒轻易说出口 提交于 2019-12-05 15:37:52
I want to create some kind of row image that looks like that but I want it to scale with the screen size and density. So reading this http://developer.android.com/guide/developing/tools/draw9patch.html and this http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch I startet creating a Nine-patch image. But when I import it and use it in my android project it looks like that As you can see the little black line that was drawn with the draw 9 patch tool is still visible. Why? Here is the 9.png image Are you using the draw9patch tool that comes with the sdk? it is quite

Fully transparent activity with 9 patch corner image

萝らか妹 提交于 2019-12-04 18:09:11
In my activity I try to make it transparent and with a 9 patch corner design , but it still showing a black color at the corner there, anyone know how to get rid of it ? What I try to do here is Non transparent (normal) Activity A with start a new transparent activity B as shown as below image but the 9patch background with corner design not fully transparent. Here's my 9patch Activity XML <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:cacheColorHint="

9Patch on Lollipop shows gray oval in background

匆匆过客 提交于 2019-12-04 11:56:47
I have the following button: <Button android:layout_height="32dp" android:layout_marginTop="4dp" android:layout_marginLeft="@dimen/aecs_item_inner_padding_positive" android:id="@+id/aecsTelephone" android:layout_width="wrap_content" android:layout_gravity="center_horizontal" android:layout_below="@id/aecsServicesContainer" android:layout_alignParentLeft="true" android:text="Mobile" android:background="@drawable/selector_mobile_button" /> and it has the following background selector: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">

When To Use 9-Patch

自闭症网瘾萝莉.ら 提交于 2019-12-04 09:52:18
Is there any Android developer documentation that says when drawable resources can be 9-patch? To put it another way, is there a document that says something along the lines of "the following items use 9-patch data, if available"? From poking around and experience, I've learned that 9-patch graphics should be used for application launcher icons icons used in the "Add to Home screen" selection list for App Widgets, Wallpapers, and Folders desktop wallpapers and when otherwise using BitMaps , e.g. on canvases button graphics view backgrounds I've been surprised to see that 9-patch data is

my 9 Patch Image stopped working

戏子无情 提交于 2019-12-04 03:31:51
问题 I have been using 9 patch images for a while now. But have come to an issue. The GUI designer in Eclipse tells me that the image works fine. And it looks how it should. However in the device it just stretches the image as if it were a normal png. The worst part is that it was working but then i did a Clean and Rebuild and I cannot seem to get the 9patch image working any more. My question is has anyone else encountered this issue. Is there some setting somewhere in the android compilation or

Change the color of divider in LinearLayout

ぃ、小莉子 提交于 2019-12-04 02:43:46
May I know how I can change the color of divider in LinearLayout ? <LinearLayout android:layout_width="match_parent" android:layout_height="48dp" android:orientation="horizontal" android:divider="?android:attr/dividerVertical" android:dividerPadding="12dip" android:showDividers="middle" android:background="#ff2d2d2d" > ... </LinearLayout> Do I need to manually copy 9 patch image from Android SDK into my project, and define my own attribute to refer it? It looks like android:divider attribute doesn't accept a color value. So you have to create a separate divider drawable in order to get it