I am using SwipeLayout in my activity.
Activity is having 2 buttons. On button click, I want to set respective fragment on bottom layout. And on close, it should set replace bottom layout with default fragment so that on swipe it displays default fragment.
When I set default fragment in onClose method of swipeLayout.addSwipeListener, it does not listen to button click.
This works fine with RecyclerView but now I want same in activity
xmlns:swipe="http://schemas.android.com/tools">
<com.daimajia.swipe.SwipeLayout
android:id="@+id/swipe_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Bottom View Start-->
<!--What you want to show-->
<LinearLayout
android:id="@+id/sub_item_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/holo_orange_light"></LinearLayout>
<!-- Bottom View End-->
<!-- Surface View Start -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/frame_list_card_item"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="9"
android:background="#eefeef"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:id="@+id/title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="this is the Title this is the Title this is the Title this is the Title this is the Title "
android:textColor="#000"
android:textSize="15sp"/>
<LinearLayout
android:id="@+id/container_list_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="this is description text this is description text this is description text this is description text this is description text this is description text this is description text this is description text this is description text this is description text this is description text "
android:textSize="13sp"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<Button
android:id="@+id/btn_one"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:text="4"/>
<Button
android:id="@+id/btn_two"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="0dp"
android:text="5"/>
</LinearLayout>
</LinearLayout>
<!--What you want to show in SurfaceView-->
</LinearLayout>
</LinearLayout>
<!-- Surface View End -->
</com.daimajia.swipe.SwipeLayout>
</android.support.v7.widget.CardView>`
`package com.sp.spsamples3.activities;
public class SwipeLayoutActivity extends AppCompatActivity {
I am using SwipeLayout in my activity. Activity is having 2 buttons. On button click, I want to set respective fragment on bottom layout. And on close, it should set replace bottom layout with default fragment so that on swipe it displays default fragment.
When I set default fragment in onClose method of swipeLayout.addSwipeListener, it does not listen to button click.
This works fine with RecyclerView but now I want same in activity
`<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView android:id="@+id/card_view" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" card_view:cardBackgroundColor="@android:color/white" card_view:cardCornerRadius="6dp" card_view:cardElevation="6dp"
</android.support.v7.widget.CardView>`
`package com.sp.spsamples3.activities;
public class SwipeLayoutActivity extends AppCompatActivity {
} `
This happens on button click 07-29 15:40:05.258 16442-16442/com.sp.spswipelayoutsample I/sp testing: start close 07-29 15:40:05.258 16442-16442/com.sp.spswipelayoutsample I/sp testing: closed