travisc ab2fec6da4 Move lib/src/ to lib/java/, and lib/jvmtests/javatests/ to lib/javatests/.
Bazel is happier if Java/Java test roots are named 'java' and 'javatests', and
this will mean that once we create a BUILD file for
android/support/design/{widget,internal}/ we'll no longer need a custom package
specified in our build (which tends to cause build problems that manifest quite
weirdly). This commit doesn't attempt to refactor the build at all yet, and is
just a pure move.

PiperOrigin-RevId: 178060739
2018-01-11 10:50:18 -05:00

110 lines
2.7 KiB
Java

/*
* Copyright 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.support.design.circularreveal;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
/** A CircularRevealWidget wrapper for {@link RelativeLayout}. */
public class CircularRevealRelativeLayout extends RelativeLayout implements CircularRevealWidget {
private final CircularRevealHelper helper;
public CircularRevealRelativeLayout(Context context) {
this(context, null);
}
public CircularRevealRelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
helper = new CircularRevealHelper(this);
}
@Override
public void buildCircularRevealCache() {
helper.buildCircularRevealCache();
}
@Override
public void destroyCircularRevealCache() {
helper.destroyCircularRevealCache();
}
@Nullable
@Override
public RevealInfo getRevealInfo() {
return helper.getRevealInfo();
}
@Override
public void setRevealInfo(@Nullable RevealInfo revealInfo) {
helper.setRevealInfo(revealInfo);
}
@Override
public int getCircularRevealScrimColor() {
return helper.getCircularRevealScrimColor();
}
@Override
public void setCircularRevealScrimColor(@ColorInt int color) {
helper.setCircularRevealScrimColor(color);
}
@Nullable
@Override
public Drawable getCircularRevealOverlayDrawable() {
return helper.getCircularRevealOverlayDrawable();
}
@Override
public void setCircularRevealOverlayDrawable(@Nullable Drawable drawable) {
helper.setCircularRevealOverlayDrawable(drawable);
}
@Override
public void draw(Canvas canvas) {
if (helper != null) {
helper.draw(canvas);
} else {
super.draw(canvas);
}
}
@Override
public void actualDraw(Canvas canvas) {
super.draw(canvas);
}
@Override
public boolean isOpaque() {
if (helper != null) {
return helper.isOpaque();
} else {
return super.isOpaque();
}
}
@Override
public boolean actualIsOpaque() {
return super.isOpaque();
}
}