[android-developers] Re: Shape having two sided border

2011-06-20 Thread Sapna Srivastav
?xml version=1.0 encoding=utf-8?

RelativeLayout android:layout_width=wrap_content
xmlns:android=http://schemas.android.com/apk/res/android;
android:background=#ff android:layout_height=fill_parent
ImageView android:layout_width=wrap_content android:id=@+id/
leftBorderImage
android:layout_alignParentLeft=true 
android:background=@drawable/
b1
android:layout_height=fill_parent/ImageView

ImageView android:layout_width=wrap_content android:id=@+id/
rightBorderImage
android:layout_alignParentRight=true 
android:background=@drawable/
b2
android:layout_height=fill_parent/ImageView
LinearLayout android:layout_width=wrap_content
android:layout_height=fill_parent
/LinearLayout
/RelativeLayout

This layout produces two sided border. and where b1 and b2 are:

?xml version=1.0 encoding=utf-8?
bitmap xmlns:android=http://schemas.android.com/apk/res/android;
android:src=@drawable/leftgrayborder
android:tileMode=repeat
android:dither=true
/



Thanks all.

On Jun 17, 9:49 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 You can also use a nine-patch drawable as the background, most of it
 transparent, the top-left edges having some pixels.

 -- Kostya

 2011/6/17 Prakash Iyer thei...@gmail.com

  I'm not sure there is any XML way of doing this. You can extend TextView
  (or whatever is the view that you are looking to have this border on) and
  implement this in the onDraw. There should also be a way to write a Drawable
  and do this which can then be extended to any View but I don't know enough
  to suggest.

  On Fri, Jun 17, 2011 at 3:41 AM, Sapna Srivastav 
  sapna.ari...@gmail.comwrote:

  I am still getting the four boundaries on the layout.

  On Jun 16, 11:58 am, Rajiv rajiv...@gmail.com wrote:
   Use the following shape tag:

    padding android:left=1dp
                   android:top=0dp
               android:right=1dp
               android:bottom=0dp
               /

   On Thu, Jun 16, 2011 at 12:06 PM, Sapna Srivastav 
  sapna.ari...@gmail.comwrote:

Hi all.

I would like to create a layout having a shape that has border only on
2 sides:
left and right, i.e. I want top and  bottom to be open.  How can I
achieve that
defining shape in XML?

Currently I have a normal 4 side border using the following shape XML
definition:

?xml version=1.0 encoding=utf-8?
shape xmlns:android=http://schemas.android.com/apk/res/android;
   android:layout_width=fill_parent
   android:layout_height=fill_parent

       solid android:color=#FF
                  /

   stroke android:width=1dp
               android:color=#FF
               /

   padding android:left=1dp
                android:top=1dp
            android:right=1dp
            android:bottom=1dp
            /
/shape

Please help, its urgent.
Thanks in advance.

--
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



-- 
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: Shape having two sided border

2011-06-17 Thread Sapna Srivastav
I am still getting the four boundaries on the layout.

On Jun 16, 11:58 am, Rajiv rajiv...@gmail.com wrote:
 Use the following shape tag:

  padding android:left=1dp
                 android:top=0dp
             android:right=1dp
             android:bottom=0dp
             /

 On Thu, Jun 16, 2011 at 12:06 PM, Sapna Srivastav 
 sapna.ari...@gmail.comwrote:

  Hi all.

  I would like to create a layout having a shape that has border only on
  2 sides:
  left and right, i.e. I want top and  bottom to be open.  How can I
  achieve that
  defining shape in XML?

  Currently I have a normal 4 side border using the following shape XML
  definition:

  ?xml version=1.0 encoding=utf-8?
  shape xmlns:android=http://schemas.android.com/apk/res/android;
     android:layout_width=fill_parent
     android:layout_height=fill_parent

         solid android:color=#FF
                    /

     stroke android:width=1dp
                 android:color=#FF
                 /

     padding android:left=1dp
                  android:top=1dp
              android:right=1dp
              android:bottom=1dp
              /
  /shape

  Please help, its urgent.
  Thanks in advance.

  --
  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: Shape having two sided border

2011-06-17 Thread Prakash Iyer
I'm not sure there is any XML way of doing this. You can extend TextView (or
whatever is the view that you are looking to have this border on) and
implement this in the onDraw. There should also be a way to write a Drawable
and do this which can then be extended to any View but I don't know enough
to suggest.

On Fri, Jun 17, 2011 at 3:41 AM, Sapna Srivastav sapna.ari...@gmail.comwrote:

 I am still getting the four boundaries on the layout.

 On Jun 16, 11:58 am, Rajiv rajiv...@gmail.com wrote:
  Use the following shape tag:
 
   padding android:left=1dp
  android:top=0dp
  android:right=1dp
  android:bottom=0dp
  /
 
  On Thu, Jun 16, 2011 at 12:06 PM, Sapna Srivastav 
 sapna.ari...@gmail.comwrote:
 
   Hi all.
 
   I would like to create a layout having a shape that has border only on
   2 sides:
   left and right, i.e. I want top and  bottom to be open.  How can I
   achieve that
   defining shape in XML?
 
   Currently I have a normal 4 side border using the following shape XML
   definition:
 
   ?xml version=1.0 encoding=utf-8?
   shape xmlns:android=http://schemas.android.com/apk/res/android;
  android:layout_width=fill_parent
  android:layout_height=fill_parent
 
  solid android:color=#FF
 /
 
  stroke android:width=1dp
  android:color=#FF
  /
 
  padding android:left=1dp
   android:top=1dp
   android:right=1dp
   android:bottom=1dp
   /
   /shape
 
   Please help, its urgent.
   Thanks in advance.
 
   --
   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

Re: [android-developers] Re: Shape having two sided border

2011-06-17 Thread Kostya Vasilyev
You can also use a nine-patch drawable as the background, most of it
transparent, the top-left edges having some pixels.

-- Kostya

2011/6/17 Prakash Iyer thei...@gmail.com

 I'm not sure there is any XML way of doing this. You can extend TextView
 (or whatever is the view that you are looking to have this border on) and
 implement this in the onDraw. There should also be a way to write a Drawable
 and do this which can then be extended to any View but I don't know enough
 to suggest.


 On Fri, Jun 17, 2011 at 3:41 AM, Sapna Srivastav 
 sapna.ari...@gmail.comwrote:

 I am still getting the four boundaries on the layout.

 On Jun 16, 11:58 am, Rajiv rajiv...@gmail.com wrote:
  Use the following shape tag:
 
   padding android:left=1dp
  android:top=0dp
  android:right=1dp
  android:bottom=0dp
  /
 
  On Thu, Jun 16, 2011 at 12:06 PM, Sapna Srivastav 
 sapna.ari...@gmail.comwrote:
 
   Hi all.
 
   I would like to create a layout having a shape that has border only on
   2 sides:
   left and right, i.e. I want top and  bottom to be open.  How can I
   achieve that
   defining shape in XML?
 
   Currently I have a normal 4 side border using the following shape XML
   definition:
 
   ?xml version=1.0 encoding=utf-8?
   shape xmlns:android=http://schemas.android.com/apk/res/android;
  android:layout_width=fill_parent
  android:layout_height=fill_parent
 
  solid android:color=#FF
 /
 
  stroke android:width=1dp
  android:color=#FF
  /
 
  padding android:left=1dp
   android:top=1dp
   android:right=1dp
   android:bottom=1dp
   /
   /shape
 
   Please help, its urgent.
   Thanks in advance.
 
   --
   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


-- 
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