nine-patch

Android Lollipop 5.1: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e985ff8 in tid 4093 (RenderThread) / when using lot of nine patch graphics

流过昼夜 提交于 2019-11-29 00:17:28
I'm using quite a large amount of NinePatchDrawables in the app views. The underlying Bitmaps are cached, so there is no memory issue. While preparing/drawing the screen, the app crashes with the following log entry: 04-03 19:37:42.651: A/libc(4064): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e985ff8 in tid 4093 (RenderThread) The issue just popped up with the latest Android 5.1 builds (LMY47D, LMY47E, LMY47I). The same views with the same graphics worked well on earlier Android Versions up to 5.0.2 (LRX22C). I'm getting the issue on the Nexus 6, so far I don't had the chance to test it

Meaning of red color in Android's Nine-patch drawables

天涯浪子 提交于 2019-11-28 23:08:01
According to the Android documentation , we know that the left and top black line define the stretchable area, and the bottom and right line define the content area. It's easy to understand, but I found the below image named textfield_activated_holo_dark.9.png from android-17 framework. What is the purpose of the red colors in the lower-left, lower-right and top-right corners? Abhishek Sabbarwal I believe this thread has some discussion on the same topic. This has got something to do with setting layout bounds and I believe its not documented yet. It's too support layout bounds. See https:/

Android 9 Patch tool: What is the new layout bounds feature?

限于喜欢 提交于 2019-11-28 22:12:59
问题 I've updated r20 of the Android SDK and started the 9 Patch tool. There seems to be a new feature - Holding Control and clicking adds layout bounds which are referred to as red pixels. I've taken a look at the documentation but it seems out of date. My question is, what are layout bounds used for and what is the best way to use them? Thanks. 回答1: Edit: Supported in Android 4.3 (API level 18). See more recent answer by wayne. Original: It's not documented because it's not part of the OS yet,

Is there a nine-patch loader for iPhone?

北慕城南 提交于 2019-11-28 15:45:30
问题 Android has a nice way of defining stretchable images called a nine-patch. See these docs for a description of the concept. The idea is to surround a png image with a 1-pixel border where you can define the stretchable areas and the padding dimensions of the image. This is absolutely brilliant and I'd like to use the idea in my iPhone app. Before writing my own nine-patch to UIImage loader I thought I'd see if one already exists. Google doesn't return any results so I don't have much hope,

How to return to default style on EditText if I apply a background?

我是研究僧i 提交于 2019-11-28 10:42:21
I just encountered with a problem that I don't know how to solve. It looks silly but I cannot find a way to fix it. I have a form in android with several EditText and when you submit the form it checks those EditText and if they have wrong data I change the EditText to red border (applying a ninepatch image). myEditText.setBackgroundResource(R.drawable.edittext_red); The problem is, I want to restore android's default style when the user change the EditText, but I don't know how to do it. if I do: myEditText.setBackgroundResource(0); It will just remove everything and that's not what I want.

What should i use for better performance, nine-patch or drawable xml resource?

喜你入骨 提交于 2019-11-28 09:17:33
What is the best way to set background for some view? For example 2 variants of backround: background with gradient, rounded corners and border background with just one color and rounded corners So which of variants would be better, nine-patch or drawable xml resource? My guess is, NinePatch would be slightly faster in most cases. Here's what I found. GradientDrawable (the one used for rects in xml) uses this code to call through to Canvas which in turn uses native call leading to SkCanvas , SkDraw and eventually SkScan and SkBlitter . On the other hand, NinePatch 's draw() has almost zero

Building a 9 patch drawable at runtime

白昼怎懂夜的黑 提交于 2019-11-28 06:59:18
I am successfully building a 9patch drawable at runtime on Android 3.0+ using the excellent gist provided by Brian Griffey (found here ). Essentially I load the raw (no patches) graphic file from the network and the filename contains the cap insets that I need to use in order to scale the image accordingly. I then use these values with the class found above and apply the image as a background to a variety of elements (such as TextView , ImageButton , Button , ViewGroup , etc). This works perfectly as you can see here: However, running the same code on Android 2.3.x yields the result: I've

Nine patch image not working on my device?

冷暖自知 提交于 2019-11-28 01:44:01
This is the first time i use nine-patch image on my android app. It so stupit. When I preview on eclipse layout editor, it work. But when I build the application on real device (HTC Inspire 4g, HTC Explorer,...) it's not. <LinearLayout android:layout_width="0dip" android:layout_height="fill_parent" android:layout_margin="5dp" android:layout_weight="1" android:background="@drawable/shadow_border" android:gravity="center" android:padding="0dip" > <TextView android:id="@+id/itemdetail_textview_price" style="@style/textview_nomalBold" android:layout_width="wrap_content" android:layout_height="wrap

How to add the bubbles to textview android?

廉价感情. 提交于 2019-11-27 18:50:57
In my application, I want to set bubbles to a text view, in the text view I add the setBackgroundResource() as you can see in the code. With this code i'm getting an image like this: I want a bubble shape image like this: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#EDF5E4" /> <corners android:bottomLeftRadius="@dimen/corner_radius" android:bottomRightRadius="@dimen/corner_radius" android:topLeftRadius="@dimen/corner_radius" id:topRightRadius="@dimen/corner_radius" /> Please tell me

Android seekbar set custom style using nine-patch images

佐手、 提交于 2019-11-27 18:09:36
问题 I am trying to create a custom-styled seekbar. I have two nine-patch images one is a gray stretching bar search_progress.9.png (background color) and the other is a green stretching bar search_progress_bar.9.png (foreground color). I use this xml as my seekbar's progressDrawable: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/search_progress"></item> <item