Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Have been playing around a little regarding this question. Did a solution based on linearLayouts with 1dp views as dividers and transparent background to get the minimalism look on the buttons.</p> <p><img src="https://i.stack.imgur.com/K4Xp9.png" alt="enter image description here"></p> <p>We want the buttons to change apperance depending on the state of the button. (More on this here <a href="http://developer.android.com/resources/tutorials/views/hello-formstuff.html#CustomButton" rel="nofollow noreferrer">hello form stuff tutorial</a>). We change the background color so that the user get an indication when pressing the button.</p> <p>borderless_background.xml (goes in the drawable folder)</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_pressed="true"&gt; &lt;shape&gt; &lt;solid android:color="#33b5e5" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item android:state_focused="true"&gt; &lt;shape&gt; &lt;solid android:color="#0099cc" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item&gt; &lt;shape&gt; &lt;solid android:color="@android:color/transparent" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;/selector&gt; </code></pre> <p>The main.xml will then use borderless_background file, see the android:background tag for the buttons in the following code</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="8dp" android:orientation="vertical" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="0dp" android:gravity="center" android:layout_weight="1.0" android:textSize="14sp" android:text="@string/borderless" /&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:textSize="12sp" android:autoLink="web" android:text="@string/source1" /&gt; &lt;View android:id="@+id/horizontal_divider1" android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/darker_gray" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" &gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_weight="1.0" android:background="@drawable/borderless_background" android:textColor="@android:color/white" android:textSize="16sp" android:text="Cancel" android:onClick="cancel" /&gt; &lt;View android:id="@+id/vertical_divider" android:layout_width="1dip" android:layout_marginTop="8dp" android:layout_marginBottom="8dp" android:layout_height="fill_parent" android:background="@android:color/darker_gray" /&gt; &lt;Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="48dp" android:layout_weight="1.0" android:background="@drawable/borderless_background" android:textColor="@android:color/white" android:textSize="16sp" android:text="Next" android:onClick="next" /&gt; &lt;/LinearLayout&gt; &lt;View android:id="@+id/horizontal_divider2" android:layout_width="fill_parent" android:layout_height="1dp" android:background="@android:color/darker_gray" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>There are warnings regarding performance because of the nested linear layuots but thing run fine on the tablet I tested on so me too lazy for fixing this. A fix would probably be based on relative layout or grid layout.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload