nine-patch

Creating a chat bubble using Shapes or 9-patch image

旧城冷巷雨未停 提交于 2021-02-19 02:27:29
问题 I am trying to create a template for my chat bubbles in an android app i am currently working on. The end result should look something like this: I tried it with Shapes, but i could not get the multiple layers right. I also tried a 9-patch image, but creating the 9-patch was as far as i got. I hade no clue as to how to use it, specifically with the avatar, message header and content placements. Can anyone help out? My knowledge on shapes is fairly limited, although, i think i know just enough

Creating a chat bubble using Shapes or 9-patch image

匆匆过客 提交于 2021-02-19 02:26:59
问题 I am trying to create a template for my chat bubbles in an android app i am currently working on. The end result should look something like this: I tried it with Shapes, but i could not get the multiple layers right. I also tried a 9-patch image, but creating the 9-patch was as far as i got. I hade no clue as to how to use it, specifically with the avatar, message header and content placements. Can anyone help out? My knowledge on shapes is fairly limited, although, i think i know just enough

Change top padding of nine-patch image after stretching

匆匆过客 提交于 2020-02-05 09:37:31
问题 I have TextView with nine-patch background image: The vertical padding is set to fit text into bottom grey rectangle like this: But when the image is stretched vertically, it's top padding saves its absolute value, so text goes above of expected place: How to make TextView increase top padding after vertical stretch and fit text into bottom area which is not stretchable? 来源: https://stackoverflow.com/questions/20177163/change-top-padding-of-nine-patch-image-after-stretching

How use a 9-patch image as background on a JPanel?

寵の児 提交于 2020-01-15 06:42:49
问题 I'm searching a way for use a 9-patch file as background for javax.swing.JPanel. So that the background image automatically resizes itself when the dimensions of the JPanel change. Is it possible? Or I have to create all the pieces of the image and manually resize some of them when the listener triggers (like in the piece of code that follows)? public class JPanelWithNinePatchBackground extends JPanel { { /* Define all parts of the background like BufferedImage */ addComponentListener(new

9 patch editor android studio suddenly black

旧时模样 提交于 2020-01-02 10:36:30
问题 Anyone with experience having the 9 patch editor in AS suddenly start using a black background for images? I have had no problems using it, now suddenly I can't make any edits. The image below should have a transparent background. If I try and drag the stretchable patches nothing changes, it keeps resetting itself, so to speak. Also this change happened in the same session. 回答1: Question is old, but I have run into this issue 5 minutes ago. The problem occur when I save custom .png in paint

How to use Nine-patch images correctly

感情迁移 提交于 2020-01-02 06:24:06
问题 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

9-Patch drawable dimensions Android. How do different densities handle the non-stretched areas?

筅森魡賤 提交于 2019-12-31 10:42:05
问题 Consider the above image. - The dotted line demarcates the 9-Patch png I will slice out of a photoshop file. I need it to create a popup box. - The box incorporates a dropShadow as shown by the measuring tool in this photo. - The pink lines are there to show how I will use the draw9Patch tool to create the 9-Patch. My question is : If I have a View "Container" with the 9-Patch for a background I need to ensure its children views are always inside the white box. I was going to use padding for

9-Patch drawable dimensions Android. How do different densities handle the non-stretched areas?

余生长醉 提交于 2019-12-31 10:41:13
问题 Consider the above image. - The dotted line demarcates the 9-Patch png I will slice out of a photoshop file. I need it to create a popup box. - The box incorporates a dropShadow as shown by the measuring tool in this photo. - The pink lines are there to show how I will use the draw9Patch tool to create the 9-Patch. My question is : If I have a View "Container" with the 9-Patch for a background I need to ensure its children views are always inside the white box. I was going to use padding for

ListView With Nine-Patch Item Background Issues

百般思念 提交于 2019-12-31 03:08:14
问题 WARNING: The XML in this question is wrong, read the answer before you confuse yourself! I have been banging my head on the wall for a while now. The following posts have shed light on the subject, but failed to solve my issue: Android ListView State List not showing default item background and ListView item background via custom selector The proper nine-patch background shows perfectly when I select the list item, but I can not get the default nine-patch background to show initially. It

video not taking full screen in landscape mode using videoview android

时间秒杀一切 提交于 2019-12-30 07:51:07
问题 i m using videoview in portrait mode and have set this in manifest <activity android:name="com.ui.VideoDetailActivity" android:configChanges="orientation|screenSize|keyboard" android:theme="@style/newtheme" /> my layout is working fine in portrait mode but in landscape i do not want to load another layout from layout-land because this will start buffering of video from start position so i m trying to change views programtically but this is not working as expected.Layout for portrait : <?xml