1. Are you ready for the Galaxy S20? Here is everything we know so far!

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

Discussion in 'Android Development' started by MuhammedRefaat, Dec 12, 2013.

  1. MuhammedRefaat

    Thread Starter

    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':

    [​IMG]

    with 10':

    [​IMG]

    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:eek:rientation="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:eek:rientation="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]
     



    1. Download the Forums for Android™ app!


      Download

       
Loading...
Similar Threads - sidebar flexible behavior
  1. rshimizu12
    Replies:
    3
    Views:
    437
  2. Rg68
    Replies:
    17
    Views:
    2,661
  3. DynV
    Replies:
    0
    Views:
    818
  4. Papamalo
    Replies:
    2
    Views:
    2,209
  5. frappydan
    Replies:
    1
    Views:
    1,402
  6. Syam Kishore
    Replies:
    2
    Views:
    1,674
  7. zackls
    Replies:
    1
    Views:
    1,947
  8. RickyMs
    Replies:
    7
    Views:
    3,661
  9. Sanjit Keksar
    Replies:
    4
    Views:
    2,248
  10. App Update
    Replies:
    0
    Views:
    709

Share This Page

Loading...