// Path: app/src/main/java/com/ge/protein/util/ViewUtils.java
// public class ViewUtils {
// 
//     public static final ViewOutlineProvider CIRCULAR_OUTLINE = new ViewOutlineProvider() {
//         @Override
//         public void getOutline(View view, Outline outline) {
//             outline.setOval(view.getPaddingLeft(),
//                     view.getPaddingTop(),
//                     view.getWidth() - view.getPaddingRight(),
//                     view.getHeight() - view.getPaddingBottom());
//         }
//     };
// 
//     public static RippleDrawable createRipple(@NonNull Palette palette,
//             @FloatRange(from = 0f, to = 1f) float darkAlpha,
//             @FloatRange(from = 0f, to = 1f) float lightAlpha,
//             @ColorInt int fallbackColor,
//             boolean bounded) {
//         int rippleColor = fallbackColor;
//         if (palette != null) {
//             // try the named swatches in preference order
//             if (palette.getVibrantSwatch() != null) {
//                 rippleColor =
//                         ColorUtils.modifyAlpha(palette.getVibrantSwatch().getRgb(), darkAlpha);
// 
//             } else if (palette.getLightVibrantSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getLightVibrantSwatch().getRgb(),
//                         lightAlpha);
//             } else if (palette.getDarkVibrantSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getDarkVibrantSwatch().getRgb(),
//                         darkAlpha);
//             } else if (palette.getMutedSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getMutedSwatch().getRgb(), darkAlpha);
//             } else if (palette.getLightMutedSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getLightMutedSwatch().getRgb(),
//                         lightAlpha);
//             } else if (palette.getDarkMutedSwatch() != null) {
//                 rippleColor =
//                         ColorUtils.modifyAlpha(palette.getDarkMutedSwatch().getRgb(), darkAlpha);
//             }
//         }
//         return new RippleDrawable(ColorStateList.valueOf(rippleColor), null,
//                 bounded ? new ColorDrawable(Color.WHITE) : null);
//     }
// 
// }


import android.content.Context;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import com.ge.protein.util.ViewUtils;
/*
 * Copyright 2017 Jiaheng Ge
 *
 * 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 com.ge.protein.ui.widget;



public class CircularImageView extends AppCompatImageView {
    public CircularImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
// Path: app/src/main/java/com/ge/protein/util/ViewUtils.java
// public class ViewUtils {
// 
//     public static final ViewOutlineProvider CIRCULAR_OUTLINE = new ViewOutlineProvider() {
//         @Override
//         public void getOutline(View view, Outline outline) {
//             outline.setOval(view.getPaddingLeft(),
//                     view.getPaddingTop(),
//                     view.getWidth() - view.getPaddingRight(),
//                     view.getHeight() - view.getPaddingBottom());
//         }
//     };
// 
//     public static RippleDrawable createRipple(@NonNull Palette palette,
//             @FloatRange(from = 0f, to = 1f) float darkAlpha,
//             @FloatRange(from = 0f, to = 1f) float lightAlpha,
//             @ColorInt int fallbackColor,
//             boolean bounded) {
//         int rippleColor = fallbackColor;
//         if (palette != null) {
//             // try the named swatches in preference order
//             if (palette.getVibrantSwatch() != null) {
//                 rippleColor =
//                         ColorUtils.modifyAlpha(palette.getVibrantSwatch().getRgb(), darkAlpha);
// 
//             } else if (palette.getLightVibrantSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getLightVibrantSwatch().getRgb(),
//                         lightAlpha);
//             } else if (palette.getDarkVibrantSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getDarkVibrantSwatch().getRgb(),
//                         darkAlpha);
//             } else if (palette.getMutedSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getMutedSwatch().getRgb(), darkAlpha);
//             } else if (palette.getLightMutedSwatch() != null) {
//                 rippleColor = ColorUtils.modifyAlpha(palette.getLightMutedSwatch().getRgb(),
//                         lightAlpha);
//             } else if (palette.getDarkMutedSwatch() != null) {
//                 rippleColor =
//                         ColorUtils.modifyAlpha(palette.getDarkMutedSwatch().getRgb(), darkAlpha);
//             }
//         }
//         return new RippleDrawable(ColorStateList.valueOf(rippleColor), null,
//                 bounded ? new ColorDrawable(Color.WHITE) : null);
//     }
// 
// }


// Path: app/src/main/java/com/ge/protein/ui/widget/CircularImageView.java
import android.content.Context;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import com.ge.protein.util.ViewUtils;

/*
 * Copyright 2017 Jiaheng Ge
 *
 * 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 com.ge.protein.ui.widget;



public class CircularImageView extends AppCompatImageView {
    public CircularImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
        setOutlineProvider(ViewUtils.CIRCULAR_OUTLINE);