Skip to content

Commit 3250a82

Browse files
Material Design Teamafohrman
authored andcommitted
Added a new card demo with rich media examples.
PiperOrigin-RevId: 235186221
1 parent 3745cc5 commit 3250a82

File tree

5 files changed

+433
-0
lines changed

5 files changed

+433
-0
lines changed

catalog/java/io/material/catalog/card/CardFragment.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ public Fragment createFragment() {
7777
public Fragment createFragment() {
7878
return new CardStatesFragment();
7979
}
80+
},
81+
new Demo(R.string.cat_card_rich_media_demo) {
82+
@Nullable
83+
@Override
84+
public Fragment createFragment() {
85+
return new CardRichMediaDemoFragment();
86+
}
8087
});
8188
}
8289

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2019 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.material.catalog.card;
18+
19+
import io.material.catalog.R;
20+
21+
import androidx.annotation.LayoutRes;
22+
23+
/** A fragment that displays rich media card demos for the Catalog app. */
24+
public class CardRichMediaDemoFragment extends CardMainDemoFragment {
25+
26+
@Override
27+
public int getDemoTitleResId() {
28+
return R.string.cat_card_rich_media_demo;
29+
}
30+
31+
@Override
32+
@LayoutRes
33+
protected int getCardContent() {
34+
return R.layout.cat_card_rich_media_demo_fragment;
35+
}
36+
}

0 commit comments

Comments
 (0)