The separator is going through the reset button

1

I wanted the tab to stop just below the FREE THROW buttons, not at the bottom of the screen. How do I correct so that the design is responsive?

Why is the content disorganized when the screen is in landscape mode?

<?xmlversion="1.0" encoding="utf-8"?>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    tools:context="com.example.android.courtcount.MainActivity">

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:fontFamily="sans-serif-medium"
            android:gravity="center_horizontal"
            android:text="Team A"
            android:textColor="#616161"
            android:textSize="14sp" />

        <TextView
            android:id="@+id/team_a_score"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:fontFamily="sans-serif-light"
            android:gravity="center_horizontal"
            android:text="0"
            android:textSize="56sp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add3CurrentTeamAScore"
            android:text="+3" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add2CurrentTeamAScore"
            android:text="+2" />


        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:onClick="add1CurrentTeamAScore"
            android:text="Free Throw" />

    </LinearLayout>

    <View
        android:layout_width="1dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="24dp"
        android:layout_marginRight="24dp"
        android:background="@android:color/darker_gray"></View>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:fontFamily="sans-serif-medium"
            android:gravity="center_horizontal"
            android:text="Team B"
            android:textColor="#616161"
            android:textSize="14sp" />

        <TextView
            android:id="@+id/team_b_score"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:fontFamily="sans-serif-light"
            android:gravity="center_horizontal"
            android:text="0"
            android:textSize="56sp" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add3CurrentTeamBScore"
            android:text="+3" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:onClick="add2CurrentTeamBScore"
            android:text="+2" />


        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:onClick="add1CurrentTeamBScore"
            android:text="Free Throw" />

    </LinearLayout>

</LinearLayout>

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:onClick="resetScores"
    android:text="Reset" />

    
asked by anonymous 05.08.2016 / 07:28

1 answer

1

You could create a folder called "layout-land", in there you add new layout files that will be used when the phone is in landscape.

It is difficult to create an xml that fits all devices and vertical / horizontal by a number of factors, among them, the most striking was the size of the screens of other devices.

    
05.08.2016 / 13:43