@@ -0,0 +1,1538 @@
+/*%0A * Copyright (C) 2018 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.google.android.material.internal;%0A%0Aimport static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP;%0A%0Aimport android.app.Activity;%0Aimport android.content.Context;%0Aimport android.content.ContextWrapper;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.annotation.RestrictTo;%0A%0A/**%0A * Utils class for %7B@link Context%7D.%0A *%0A * @hide%0A */%0A@RestrictTo(LIBRARY_GROUP)%0Apublic class ContextUtils %7B%0A%0A  /**%0A   * Returns the %7B@link Activity%7D given a %7B@link Context%7D or null if there is no %7B@link Activity%7D,%0A   * taking into account the potential hierarchy of %7B@link ContextWrapper ContextWrappers%7D.%0A   */%0A  @Nullable%0A  public static Activity getActivity(Context context) %7B%0A    while (context instanceof ContextWrapper) %7B%0A      if (context instanceof Activity) %7B%0A        return (Activity) context;%0A      %7D%0A      context = ((ContextWrapper) context).getBaseContext();%0A    %7D%0A    return null;%0A  %7D%0A%7D%0A

Add ContextUtils getActivity() method