root/ui/android/java/src/org/chromium/ui/autofill/AutofillDividerDrawable.java

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. draw
  2. onBoundsChange
  3. setHeight
  4. setColor
  5. setAlpha
  6. setColorFilter
  7. getOpacity

// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.ui.autofill;

import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

class AutofillDividerDrawable extends Drawable {

    private Paint mPaint;
    private Rect mDividerRect;

    public AutofillDividerDrawable() {
        mPaint = new Paint();
        mDividerRect = new Rect();
    }

    @Override
    public void draw(Canvas canvas) {
        canvas.drawRect(mDividerRect, mPaint);
    }

    @Override
    public void onBoundsChange(Rect bounds) {
        mDividerRect.set(0, 0, bounds.width(), mDividerRect.height());
    }

    public void setHeight(int height) {
        mDividerRect.set(0, 0, mDividerRect.right, height);
    }

    public void setColor(int color) {
        mPaint.setColor(color);
    }

    @Override
    public void setAlpha(int alpha) {
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
    }

    @Override
    public int getOpacity() {
        return PixelFormat.OPAQUE;
    }
}

/* [<][>][^][v][top][bottom][index][help] */