Skip to content

Commit

Permalink
[Catalog] Surround TransitionFragment platform demos with proper sdk …
Browse files Browse the repository at this point in the history
…int check to fix lint error

PiperOrigin-RevId: 449045527
  • Loading branch information
dsn5ft committed May 16, 2022
1 parent 9de56c2 commit 265cb86
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -22,6 +22,7 @@
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import androidx.fragment.app.Fragment;
import androidx.annotation.ChecksSdkIntAtLeast;
import dagger.Provides;
import dagger.android.ContributesAndroidInjector;
import dagger.multibindings.IntoSet;
Expand All @@ -38,6 +39,10 @@
/** A landing fragment that links to Transition demos for the Catalog app. */
public class TransitionFragment extends DemoLandingFragment {

@ChecksSdkIntAtLeast(api = VERSION_CODES.LOLLIPOP)
private static final boolean PLATFORM_TRANSITIONS_AVAILABLE =
VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP;

@Override
public int getTitleResId() {
return R.string.cat_transition_title;
Expand All @@ -61,8 +66,7 @@ public Intent createActivityIntent() {
@Override
public List<Demo> getAdditionalDemos() {
List<Demo> demos = new ArrayList<>();
boolean shouldAddPlatformDemos = VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP;
if (shouldAddPlatformDemos) {
if (PLATFORM_TRANSITIONS_AVAILABLE) {
demos.add(
new Demo(R.string.cat_transition_container_transform_activity_title) {
@Override
Expand All @@ -86,7 +90,7 @@ public Fragment createFragment() {
}
}));

if (shouldAddPlatformDemos) {
if (PLATFORM_TRANSITIONS_AVAILABLE) {
demos.add(
new Demo(R.string.cat_transition_shared_axis_activity_title) {
@Override
Expand Down

0 comments on commit 265cb86

Please sign in to comment.