Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a582d064 authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Remove NearestImageView from CanvasCompare"

parents 8ce24f2a a2d519e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@
        </LinearLayout>
    </LinearLayout>

    <com.android.test.hwuicompare.NearestImageView
    <ImageView
        android:id="@+id/compare_image_view"
        android:layout_width="@dimen/layer_width_double"
        android:layout_height="@dimen/layer_height_double"
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ public class ManualActivity extends CompareActivity {
                        mCompareImageView.setImageBitmap(mCompareBitmap);
                        break;
                }
                mCompareImageView.getDrawable().setFilterBitmap(false);
                mCompareImageView.invalidate();
            }

+0 −47
Original line number Diff line number Diff line
/*
 * Copyright (C) 2013 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 com.android.test.hwuicompare;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.util.AttributeSet;
import android.widget.ImageView;

public class NearestImageView extends ImageView {
    public NearestImageView(Context context) {
        super(context);
    }

    public NearestImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NearestImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    final PaintFlagsDrawFilter mFilter = new PaintFlagsDrawFilter(Paint.FILTER_BITMAP_FLAG, 0);

    @Override
    public void onDraw(Canvas canvas) {
        canvas.setDrawFilter(mFilter);
        super.onDraw(canvas);
        canvas.setDrawFilter(null);
    }
}
 No newline at end of file