Skip to content

Commit 1dd6669

Browse files
committed
Improved sample app layout
1 parent 2e8bb25 commit 1dd6669

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

sample/src/main/java/com/yuyakaido/android/cardstackview/sample/MainActivity.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ public boolean onOptionsItemSelected(MenuItem item) {
7373
}
7474

7575
private TouristSpot createTouristSpot() {
76-
return new TouristSpot("Yasaka Shrine", "Kyoto", "https://source.unsplash.com/Xq1ntWruZQI");
76+
return new TouristSpot("Yasaka Shrine", "Kyoto", "https://source.unsplash.com/Xq1ntWruZQI/600x800");
7777
}
7878

7979
private List<TouristSpot> createTouristSpots() {
8080
List<TouristSpot> spots = new ArrayList<>();
81-
spots.add(new TouristSpot("Yasaka Shrine", "Kyoto", "https://source.unsplash.com/Xq1ntWruZQI"));
82-
spots.add(new TouristSpot("Fushimi Inari Shrine", "Kyoto", "https://source.unsplash.com/NYyCqdBOKwc"));
83-
spots.add(new TouristSpot("Bamboo Forest", "Kyoto", "https://source.unsplash.com/buF62ewDLcQ"));
84-
spots.add(new TouristSpot("Brooklyn Bridge", "New York", "https://source.unsplash.com/THozNzxEP3g"));
85-
spots.add(new TouristSpot("Empire State Building", "New York", "https://source.unsplash.com/USrZRcRS2Lw"));
86-
spots.add(new TouristSpot("The statue of Liberty", "New York", "https://source.unsplash.com/PeFk7fzxTdk"));
87-
spots.add(new TouristSpot("Louvre Museum", "Paris", "https://source.unsplash.com/LrMWHKqilUw"));
88-
spots.add(new TouristSpot("Eiffel Tower", "Paris", "https://source.unsplash.com/HN-5Z6AmxrM"));
89-
spots.add(new TouristSpot("Big Ben", "London", "https://source.unsplash.com/CdVAUADdqEc"));
90-
spots.add(new TouristSpot("Great Wall of China", "China", "https://source.unsplash.com/AWh9C-QjhE4"));
81+
spots.add(new TouristSpot("Yasaka Shrine", "Kyoto", "https://source.unsplash.com/Xq1ntWruZQI/600x800"));
82+
spots.add(new TouristSpot("Fushimi Inari Shrine", "Kyoto", "https://source.unsplash.com/NYyCqdBOKwc/600x800"));
83+
spots.add(new TouristSpot("Bamboo Forest", "Kyoto", "https://source.unsplash.com/buF62ewDLcQ/600x800"));
84+
spots.add(new TouristSpot("Brooklyn Bridge", "New York", "https://source.unsplash.com/THozNzxEP3g/600x800"));
85+
spots.add(new TouristSpot("Empire State Building", "New York", "https://source.unsplash.com/USrZRcRS2Lw/600x800"));
86+
spots.add(new TouristSpot("The statue of Liberty", "New York", "https://source.unsplash.com/PeFk7fzxTdk/600x800"));
87+
spots.add(new TouristSpot("Louvre Museum", "Paris", "https://source.unsplash.com/LrMWHKqilUw/600x800"));
88+
spots.add(new TouristSpot("Eiffel Tower", "Paris", "https://source.unsplash.com/HN-5Z6AmxrM/600x800"));
89+
spots.add(new TouristSpot("Big Ben", "London", "https://source.unsplash.com/CdVAUADdqEc/600x800"));
90+
spots.add(new TouristSpot("Great Wall of China", "China", "https://source.unsplash.com/AWh9C-QjhE4/600x800"));
9191
return spots;
9292
}
9393

sample/src/main/res/layout/activity_main.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
xmlns:android="http://schemas.android.com/apk/res/android"
55
xmlns:app="http://schemas.android.com/apk/res-auto"
66
android:layout_width="match_parent"
7-
android:layout_height="match_parent"
8-
android:clipChildren="false">
7+
android:layout_height="match_parent">
98

109
<com.yuyakaido.android.cardstackview.CardStackView
1110
android:id="@+id/activity_main_card_stack_view"
1211
android:layout_width="match_parent"
13-
android:layout_height="wrap_content"
14-
android:layout_centerInParent="true"
15-
android:padding="16dp"
12+
android:layout_height="match_parent"
13+
android:paddingTop="32dp"
14+
android:paddingBottom="32dp"
15+
android:paddingLeft="16dp"
16+
android:paddingRight="16dp"
1617
android:clipToPadding="false"
1718
app:visibleCount="3"
1819
app:swipeThreshold="0.75"

sample/src/main/res/layout/item_tourist_spot_card.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:app="http://schemas.android.com/apk/res-auto"
66
xmlns:card_view="http://schemas.android.com/apk/res-auto"
77
android:layout_width="match_parent"
8-
android:layout_height="500dp"
8+
android:layout_height="match_parent"
99
app:cardUseCompatPadding="true"
1010
card_view:cardCornerRadius="8dp"
1111
card_view:cardBackgroundColor="@android:color/white">

0 commit comments

Comments
 (0)