mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Close fragment when tapped on the empty section
This commit is contained in:
parent
04e5432f13
commit
ec0da2f4af
2 changed files with 98 additions and 76 deletions
|
|
@ -107,4 +107,9 @@ public class NearbyInfoDialog extends OverlayDialog {
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, articleLink);
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, articleLink);
|
||||||
startActivity(browserIntent);
|
startActivity(browserIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OnClick(R.id.emptyLayout)
|
||||||
|
void onCloseClicked() {
|
||||||
|
dismissAllowingStateLoss();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout
|
<RelativeLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
|
@ -9,89 +9,106 @@
|
||||||
app:behavior_peekHeight="@dimen/bottom_peak_height">
|
app:behavior_peekHeight="@dimen/bottom_peak_height">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/emptyLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:weightSum="1" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:layout_alignParentBottom="true"
|
||||||
android:minHeight="@dimen/bottom_peak_height"
|
android:background="@android:color/white">
|
||||||
android:background="@android:color/white"
|
|
||||||
android:animateLayoutChanges="true">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/link_preview_toolbar"
|
android:id="@+id/dialogInfoLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:clickable="true"
|
android:animateLayoutChanges="true"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:minHeight="@dimen/bottom_peak_height"
|
||||||
android:minHeight="64dp">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/link_preview_toolbar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:minHeight="64dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/link_preview_title"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="12dp"
|
||||||
|
android:layout_marginRight="12dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:fontFamily="serif"
|
||||||
|
android:lineSpacingMultiplier="0.9"
|
||||||
|
android:maxLines="3"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="20sp"
|
||||||
|
tools:text="Lorem ipsum" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:background="@android:color/black" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/link_preview_title"
|
android:id="@+id/link_preview_extract"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:lineSpacingMultiplier="1.3"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
tools:text="Lorem ipsum" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/link_preview_bottom_padding"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/dialogButtonsLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/dialogInfoLayout"
|
||||||
|
android:layout_gravity="bottom">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/link_preview_directions_button"
|
||||||
|
style="@style/Widget.AppCompat.Button.Borderless"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_gravity="center_vertical"
|
android:paddingBottom="16dp"
|
||||||
android:paddingBottom="4dp"
|
android:paddingTop="16dp"
|
||||||
android:textSize="20sp"
|
android:text="GET DIRECTIONS"
|
||||||
android:fontFamily="serif"
|
android:textColor="@android:color/black" />
|
||||||
android:lineSpacingMultiplier="0.9"
|
|
||||||
android:maxLines="3"
|
<TextView
|
||||||
android:ellipsize="end"
|
android:id="@+id/link_preview_go_button"
|
||||||
android:layout_marginLeft="12dp"
|
style="@style/Widget.AppCompat.Button.Borderless"
|
||||||
android:textColor="@android:color/black"
|
android:layout_width="0dp"
|
||||||
tools:text="Lorem ipsum" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:text="READ ARTICLE"
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
</RelativeLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0.5dp"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:background="@android:color/black"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/link_preview_extract"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingTop="8dp"
|
|
||||||
android:paddingLeft="16dp"
|
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:lineSpacingMultiplier="1.3"
|
|
||||||
android:textIsSelectable="true"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
tools:text="Lorem ipsum"/>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/link_preview_bottom_padding"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/link_preview_directions_button"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:text="GET DIRECTIONS"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/link_preview_go_button"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:text="READ ARTICLE"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue