Skip to content

After use ProSwipeButton my layout.xml gets crazy #2

Open

Description

@pess0a

Before use:
image

after use:
image

Activity

  1. ishaangarg commented on Dec 9, 2017

    @ishaangarg
    Member

    Are you using coordinator layout? Can you post your layout XML?

  2. pess0a commented on Dec 11, 2017

    @pess0a
    Author

    Im not using coordinator.

    `

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:background="@color/white"
        android:elevation="5dp"
        android:id="@+id/relativeLayout6">
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:weightSum="4">
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical">
    
                <TextView
                    android:id="@+id/textview_title_address"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="16sp"
                    android:layout_marginTop="16sp"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    android:textColor="@color/light_gray"
                    android:text="LOCAL DE PARTIDA"/>
    
                <TextView
                    android:id="@+id/textview_address"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:textSize="24sp"
                    android:paddingLeft="16dp"
                    android:paddingRight="16dp"
                    android:textColor="@color/md_black_1000"
                    android:text="Rua dom jose lopes 604 - boa viagem"
                    />
            </LinearLayout>
    
            <View
                android:id="@+id/divider"
                android:layout_width="2dp"
                android:layout_height="match_parent"
                android:layout_marginBottom="16dp"
                android:layout_marginTop="16dp"
                android:layout_toLeftOf="@id/imageview_maps"
                android:background="@color/gray">
    
            </View>
    
    
            <LinearLayout
                android:id="@+id/linearlayout_navigation"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:layout_weight="3"
                android:gravity="center">
    
    
                <ImageView
                    android:id="@+id/imageview_maps"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_navigation" />
    
                <TextView
                    android:id="@+id/textview_time"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:textStyle="bold"
                    android:text="4 min" />
    
                <TextView
                    android:id="@+id/textView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_above="@+id/trip_map"
                    android:gravity="center"
                    android:layout_gravity=""
                    android:text="NAVEGAR" />
    
            </LinearLayout>
    
    
    
    
        </LinearLayout>
    
    </RelativeLayout>
    
    <fragment
        android:id="@+id/trip_map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/relativeLayout6"
        android:layout_above="@+id/button_local"
        tools:context="com.marydrivedriver.home.HomeActivity" />
    
    
    <include android:id="@+id/news_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        layout="@layout/modal_rider"
        android:layout_above="@id/button_local"/>
    
    <!-- -->
    <in.shadowfax.proswipebutton.ProSwipeButton
        android:id="@+id/button_local"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        app:text_size="16sp"
        app:bg_color="@color/primary"
        app:btn_text="Estou no local" />
    

    `

  3. ishaangarg commented on Jan 24, 2018

    @ishaangarg
    Member

    I had to cleanup your layout XML a bit. Wrapped the whole thing inside another RelativeLayout. replaced fragment tag with a View tag and commented out the include layout as I dont have that.

    After all these changes it is working fine.
    Make sure you test on a real device or emulator as Android Studio wont show the button in its layout preview

    For me to better understand what's wrong, please upload a screenshot from a real device or emulator, not Studio preview window :)

    Here's the layout code I got working: Gist Link

    Here's the screenshot:
    screenshot_1516797236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions