Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.app.Activity;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;

public class Main {
    private static final String IS_SHARED_ELEMENT_TRANSITION = "isSharedElementTransition";
    private static final int SHARED_ELEMENT_TARGET_API = Build.VERSION_CODES.LOLLIPOP_MR1;

    static boolean isSharedElementTransition(Activity activity) {
        return isSharedElementTransition(activity.getIntent().getExtras());
    }

    static boolean isSharedElementTransition(Intent intent) {
        return isSharedElementTransition(intent.getExtras());
    }

    static boolean isSharedElementTransition(@Nullable Bundle args) {
        return Build.VERSION.SDK_INT >= SHARED_ELEMENT_TARGET_API && args != null
                && args.getBoolean(IS_SHARED_ELEMENT_TRANSITION, false);
    }
}