I want to adjust the layouts according to the Landscape mode
and portrait mode
.
In my 7' tablet device the portrait mode
is too small and Landscape mode
is quite large. Due to small portrait mode, the list items and some text is mixing like button
size got reduced, one text crossed the other one, etc..
So for the same view layout, I want to have different setups according to the modes.
For example consider this SO post of One Layout over the Top of Other. I want this scenario for the portrait mode
. However for the Landscape mode
, I don't want overlapping of one view on top of other. Rather I want one view on one side of the other.
My xml layout file for different modes-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/news_fragment"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
<FrameLayout
android:id="@+id/channel_fragment"
android:layout_weight="2"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
The problem is this seems good for landscape mode
but when it comes to portrait mode, I need news_fragment
to get overlapped over channel_fragment
.
How to achieve this behavior considering the layout file is same. Or do I have to create new one for portrait too?