2

I would like to develop a layout which is diagonally divided in to two phases with option1 & option2. I want both this diagonal layers to be touch sensible so that when user touch on it, its event get executed. How can I develop such a layout?

I am attaching my Layouts rough design

enter image description here

<item>
        <rotate
            android:fromDegrees="40"
            android:toDegrees="120"
            android:pivotX="100%"
            android:pivotY="0%">
            <shape
                android:shape="rectangle" >
                <stroke android:color="@color/colorAccent" android:width="2dp"/>
                <solid
                    android:color="@color/colorPrimary" />
            </shape>
        </rotate>
    </item>

This code gives me very small triangle and I am not able to increase its height & width. Please help

NIket
  • 914
  • 1
  • 6
  • 19
  • [take a look](http://meta.stackoverflow.com/questions/266384/is-it-ok-to-downvote-questions-asking-about-how-to-achieve-something-without-ha) – M D Feb 25 '16 at 09:52
  • http://stackoverflow.com/questions/24991986/how-to-create-a-layout-thats-split-diagonally-and-the-two-halves-are-clickable – Amarjit Feb 25 '16 at 10:00
  • http://stackoverflow.com/questions/2517589/making-a-triangle-shape-using-xml-definitions..this will give you an idea – Asif Sb Feb 25 '16 at 10:04

1 Answers1

1

I will give some suggestion.

Take the relative layout as the base. Take a drawable with a triangle shape load into image view and place it on top of the layout you developed. Have a click listener for image view for an action and one for layout for another.

Ravi Gadipudi
  • 1,446
  • 1
  • 17
  • 30