Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Tablet UI issue
    primarykey
    data
    text
    <p>I wanna make friendly design for the all Android devices. I made design for the Smartphones using the Navigation Drawer like on the image 1. I also want to make design for the Tablet devices like on the image 2 without using the Navigation Drawer. How can i make this? Do I need to detect a device programmatically and if it is the Tablet device i will use a alternative layout for Tablet device?</p> <p>Here is my layout for Tablet devices( folder layout-sw600dp) without using the left drawer:</p> <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;LinearLayout android:id="@+id/content" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;ListView android:id="@+id/left_list" android:listSelector="@drawable/state_listview_left" android:choiceMode="singleChoice" android:background="@color/white" android:layout_gravity="start" android:layout_width="300dp" android:layout_height="match_parent" &gt; &lt;/ListView&gt; &lt;LinearLayout android:id="@+id/content_frame" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;RelativeLayout android:id="@+id/llBasketBarCenter" style="@style/StyleInfoPanelBasket" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/textView1" style="@style/StyleBarText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/payable" /&gt; &lt;TextView android:id="@+id/tvCenterPanelSum" style="@style/StyleBarSum" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView1" /&gt; &lt;TextView android:id="@+id/tvCenterPanelSumCoins" style="@style/StyleBarCoins" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/tvCenterPanelSum" android:layout_toRightOf="@+id/tvCenterPanelSum" /&gt; &lt;TextView android:id="@+id/tvCenterPanelSumValue" style="@style/StyleBaCurrency" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/tvCenterPanelSum" android:layout_toRightOf="@+id/tvCenterPanelSumCoins" android:text="@string/currency" /&gt; &lt;RelativeLayout style="@style/StyleCartIcon" android:layout_toRightOf="@+id/tvCenterPanelSumValue" android:layout_centerVertical="true"&gt; &lt;TextView android:id="@+id/tvCountInCart" style="@style/StyleCartCount" android:layout_alignParentRight="true" /&gt; &lt;/RelativeLayout&gt; &lt;TextView android:id="@+id/textView4" style="@style/StyleTextNext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:clickable="true" android:onClick="onGoToTheBasketClick" android:text="@string/in_basket" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;ListView android:visibility="gone" android:id="@+id/left_drawer" android:listSelector="@drawable/state_listview_left" android:choiceMode="singleChoice" android:background="@color/white" android:layout_gravity="start" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;/ListView&gt; &lt;LinearLayout android:background="@color/white" android:id="@+id/right_drawer" android:layout_gravity="end" android:layout_width="600dp" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>![enter image description here][1]</p> <p>Here is my layout for the others devices with using the left drawer:</p> <pre><code>&lt;android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;LinearLayout android:id="@+id/content_frame" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"&gt; &lt;RelativeLayout android:id="@+id/llBasketBarCenter" style="@style/StyleInfoPanelBasket" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/textView1" style="@style/StyleBarText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/payable" /&gt; &lt;TextView android:id="@+id/tvCenterPanelSum" style="@style/StyleBarSum" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView1" /&gt; &lt;TextView android:id="@+id/tvCenterPanelSumCoins" style="@style/StyleBarCoins" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/tvCenterPanelSum" android:layout_toRightOf="@+id/tvCenterPanelSum" /&gt; &lt;TextView android:id="@+id/tvCenterPanelSumValue" style="@style/StyleBaCurrency" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/tvCenterPanelSum" android:layout_toRightOf="@+id/tvCenterPanelSumCoins" android:text="@string/currency" /&gt; &lt;RelativeLayout style="@style/StyleCartIcon" android:layout_toRightOf="@+id/tvCenterPanelSumValue" android:layout_centerVertical="true"&gt; &lt;TextView android:id="@+id/tvCountInCart" style="@style/StyleCartCount" android:layout_alignParentRight="true" /&gt; &lt;/RelativeLayout&gt; &lt;TextView android:id="@+id/textView4" style="@style/StyleTextNext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:clickable="true" android:onClick="onGoToTheBasketClick" android:text="@string/in_basket" /&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; &lt;ListView android:id="@+id/left_drawer" android:listSelector="@drawable/state_listview_left" android:choiceMode="singleChoice" android:background="@color/white" android:layout_gravity="start" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;/ListView&gt; &lt;LinearLayout android:background="@color/white" android:id="@+id/right_drawer" android:layout_gravity="end" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;/LinearLayout&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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