[android-developers] Re: Use of shapes for background

2012-08-27 Thread Pau Rodríguez Coloma
Please, help...

El viernes, 24 de agosto de 2012 12:08:54 UTC+2, Pau Rodríguez Coloma 
escribió:
>
> Hi, 
>
>  I'm want to set the background of a RelativeLayout like the attached png. 
> For the moment I'm using a bitmap definition xml named 
> "background_dark.xml" like:
>
>
> 
>
> http://schemas.android.com/apk/res/android";
>
> android:src="@drawable/fondo_oscuro"
>
> android:tileMode="repeat">
>
> 
>
>
> And using it as the background drawable in my RelativeLayout: 
>
>
> 
> android:layout_width="fill_parent"
>
> android:layout_height="fill_parent"
>
> android:layout_below="@+id/headerLayout"
>
> android:background="@drawable/background_dark">
>
> 
>
>
> But I want to make the same effect without using the png file, i.e. using 
> only shapes and layer-list. The number of lines has to be different 
> depending of the screen size, only the separation between lines are 
> determinated.
>
>
> Does anyone know how can I do this?
>
>
> Thanks in advance. 
>
>
> NOTE: Sorry about my english.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Use of shapes for background

2012-08-28 Thread bob
Why not extend android.widget.RelativeLayout and implement your own onDraw 
method?  



On Friday, August 24, 2012 5:08:54 AM UTC-5, Pau Rodríguez Coloma wrote:
>
> Hi, 
>
>  I'm want to set the background of a RelativeLayout like the attached png. 
> For the moment I'm using a bitmap definition xml named 
> "background_dark.xml" like:
>
>
> 
>
> http://schemas.android.com/apk/res/android";
>
> android:src="@drawable/fondo_oscuro"
>
> android:tileMode="repeat">
>
> 
>
>
> And using it as the background drawable in my RelativeLayout: 
>
>
> 
> android:layout_width="fill_parent"
>
> android:layout_height="fill_parent"
>
> android:layout_below="@+id/headerLayout"
>
> android:background="@drawable/background_dark">
>
> 
>
>
> But I want to make the same effect without using the png file, i.e. using 
> only shapes and layer-list. The number of lines has to be different 
> depending of the screen size, only the separation between lines are 
> determinated.
>
>
> Does anyone know how can I do this?
>
>
> Thanks in advance. 
>
>
> NOTE: Sorry about my english.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Use of shapes for background

2012-08-29 Thread Pau Rodríguez Coloma
 

Thanks to all for your help. The "problem" (but not a critical problem) is 
that if I use a png file for the background I need at least 4 files for 
ldpi, mdpi, hdpi and xhdpi in order to have the same separation between 
lines. And also I think that if I use shapes instead of png I could have 
better performance with quality and RAM (but I'm not sure about it, it's 
only an idea that I want to check).

I was trying to make a shape with the dark rectangle and only one light 
line from bottom-left corner to top-right corner, with the idea to use this 
shape in a bitmap xml drawable resource with tileMode=repeat. But the 
problem with this approach is that when I use this like the background of 
the RelativeLayout it fills all the space and no makes repetitions. I was 
testing with use of width and height but the result is the same.

Does anyone have a idea? At the moment this is not only a necessity it is 
also a personal challenge.

Thanks in advance. 

El martes, 28 de agosto de 2012 23:11:02 UTC+2, bob escribió:
>
> Why not extend android.widget.RelativeLayout and implement your own onDraw 
> method?  
>
>
>
> On Friday, August 24, 2012 5:08:54 AM UTC-5, Pau Rodríguez Coloma wrote:
>>
>> Hi, 
>>
>>  I'm want to set the background of a RelativeLayout like the attached 
>> png. For the moment I'm using a bitmap definition xml named 
>> "background_dark.xml" like:
>>
>>
>> 
>>
>> http://schemas.android.com/apk/res/android";
>>
>> android:src="@drawable/fondo_oscuro"
>>
>> android:tileMode="repeat">
>>
>> 
>>
>>
>> And using it as the background drawable in my RelativeLayout: 
>>
>>
>> >
>> android:layout_width="fill_parent"
>>
>> android:layout_height="fill_parent"
>>
>> android:layout_below="@+id/headerLayout"
>>
>> android:background="@drawable/background_dark">
>>
>> 
>>
>>
>> But I want to make the same effect without using the png file, i.e. using 
>> only shapes and layer-list. The number of lines has to be different 
>> depending of the screen size, only the separation between lines are 
>> determinated.
>>
>>
>> Does anyone know how can I do this?
>>
>>
>> Thanks in advance. 
>>
>>
>> NOTE: Sorry about my english.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Use of shapes for background

2012-08-28 Thread vinay kumar
May I know what is the issue you are facing with?

On Tue, Aug 28, 2012 at 12:26 PM, Pau Rodríguez Coloma wrote:

> Please, help...
>
> El viernes, 24 de agosto de 2012 12:08:54 UTC+2, Pau Rodríguez Coloma
> escribió:
>
>> Hi,
>>
>>  I'm want to set the background of a RelativeLayout like the attached
>> png. For the moment I'm using a bitmap definition xml named
>> "background_dark.xml" like:
>>
>>
>> 
>>
>> > xmlns:android="http://schemas.**android.com/apk/res/android
>> "
>>
>> android:src="@drawable/fondo_**oscuro"
>>
>> android:tileMode="repeat">
>>
>> 
>>
>>
>> And using it as the background drawable in my RelativeLayout:
>>
>>
>> >
>> android:layout_width="fill_**parent"
>>
>> android:layout_height="fill_**parent"
>>
>> android:layout_below="@+id/**headerLayout"
>>
>> android:background="@drawable/**background_dark">
>>
>> 
>>
>>
>> But I want to make the same effect without using the png file, i.e. using
>> only shapes and layer-list. The number of lines has to be different
>> depending of the screen size, only the separation between lines are
>> determinated.
>>
>>
>> Does anyone know how can I do this?
>>
>>
>> Thanks in advance.
>>
>>
>> NOTE: Sorry about my english.
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Use of shapes for background

2012-08-28 Thread vinay kumar
I mean to ask is there any problem with .png file.

On Tue, Aug 28, 2012 at 5:08 PM, vinay kumar  wrote:

> May I know what is the issue you are facing with?
>
>
> On Tue, Aug 28, 2012 at 12:26 PM, Pau Rodríguez Coloma 
> wrote:
>
>> Please, help...
>>
>> El viernes, 24 de agosto de 2012 12:08:54 UTC+2, Pau Rodríguez Coloma
>> escribió:
>>
>>> Hi,
>>>
>>>  I'm want to set the background of a RelativeLayout like the attached
>>> png. For the moment I'm using a bitmap definition xml named
>>> "background_dark.xml" like:
>>>
>>>
>>> 
>>>
>>> >> xmlns:android="http://schemas.**android.com/apk/res/android
>>> "
>>>
>>> android:src="@drawable/fondo_**oscuro"
>>>
>>> android:tileMode="repeat">
>>>
>>> 
>>>
>>>
>>> And using it as the background drawable in my RelativeLayout:
>>>
>>>
>>> >>
>>> android:layout_width="fill_**parent"
>>>
>>> android:layout_height="fill_**parent"
>>>
>>> android:layout_below="@+id/**headerLayout"
>>>
>>> android:background="@drawable/**background_dark">
>>>
>>> 
>>>
>>>
>>> But I want to make the same effect without using the png file, i.e.
>>> using only shapes and layer-list. The number of lines has to be different
>>> depending of the screen size, only the separation between lines are
>>> determinated.
>>>
>>>
>>> Does anyone know how can I do this?
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>> NOTE: Sorry about my english.
>>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Use of shapes for background

2012-08-28 Thread Justin Anderson
I am not sure you can do that exact background with shapes defined in XML.
You can look here to see the full documentation on defining drawables in
XML:

http://developer.android.com/guide/topics/resources/drawable-resource.html

Also, I have a blog post that covers some of these... This is the first of
a three-part blog post I plan on doing to cover defining drawables in xml:

http://android-dev-tips-and-tricks.blogspot.com/2012/08/xml-drawables-part-i.html

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


On Tue, Aug 28, 2012 at 5:45 AM, vinay kumar  wrote:

> I mean to ask is there any problem with .png file.
>
>
> On Tue, Aug 28, 2012 at 5:08 PM, vinay kumar  wrote:
>
>> May I know what is the issue you are facing with?
>>
>>
>> On Tue, Aug 28, 2012 at 12:26 PM, Pau Rodríguez Coloma > > wrote:
>>
>>> Please, help...
>>>
>>> El viernes, 24 de agosto de 2012 12:08:54 UTC+2, Pau Rodríguez Coloma
>>> escribió:
>>>
 Hi,

  I'm want to set the background of a RelativeLayout like the attached
 png. For the moment I'm using a bitmap definition xml named
 "background_dark.xml" like:


 

 >>> xmlns:android="http://schemas.**android.com/apk/res/android
 "

 android:src="@drawable/fondo_**oscuro"

 android:tileMode="repeat">

 


 And using it as the background drawable in my RelativeLayout:


 >>>
 android:layout_width="fill_**parent"

 android:layout_height="fill_**parent"

 android:layout_below="@+id/**headerLayout"

 android:background="@drawable/**background_dark">

 


 But I want to make the same effect without using the png file, i.e.
 using only shapes and layer-list. The number of lines has to be different
 depending of the screen size, only the separation between lines are
 determinated.


 Does anyone know how can I do this?


 Thanks in advance.


 NOTE: Sorry about my english.

>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Developers" group.
>>> To post to this group, send email to android-developers@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> android-developers+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-developers?hl=en
>>>
>>
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en