• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps How to make a sidebar with a flexible behavior over different screen sizes?

I'm using a sidebar into my android app, this app required to run on from 7' to 10' android tablets, the problem is the side bar gives me different behaviors with the different sizes, look at the following pics:

with 7':

ss7.png


with 10':

ss10.png


and that happens with either fixing the sidebar size, making it in a specific range, or giving it the freedom to fit.

My code:


[HIGH]<LinearLayout
android:id="@+id/bottom_of_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_weight="3"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:text="Dimming Control"
android:layout_weight="1"
android:textColor="@android:color/white"
android:layout_gravity="left"
android:layout_marginLeft="20dp" />

<LinearLayout
android:orientation="vertical"
android:layout_width="400dp"
android:layout_height="0dp"
android:layout_weight="2"
android:layout_gravity="left"
android:layout_marginBottom="2dp"
android:layout_marginLeft="20dp"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:gravity="center"
android:background="@drawable/light_dimmingbg">


<SeekBar
android:id="@+id/seekbar"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="left"
android:layout_weight="2"
android:layout_marginBottom="2dp"
android:layout_marginRight="20dp"
android:layout_marginTop="2dp"
android:layout_marginLeft="20dp"
android:max="100"
android:minHeight="10dp"
android:maxHeight="13dp"
android:minWidth="120dp"
android:progress="20"
android:thumb="@drawable/light_sliderhandle"
/>
</LinearLayout>
</LinearLayout>[/HIGH]
 
Back
Top Bottom