From 80ebbafb6d1e78f3023fb06993de3789a47e9fc3 Mon Sep 17 00:00:00 2001 From: Christopher Eby Date: Sun, 25 Apr 2010 23:37:07 -0500 Subject: [PATCH] Document ControlButton and add missing license header --- src/org/kreed/vanilla/ControlButton.java | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/org/kreed/vanilla/ControlButton.java b/src/org/kreed/vanilla/ControlButton.java index 45a4668c..e9b1afc2 100644 --- a/src/org/kreed/vanilla/ControlButton.java +++ b/src/org/kreed/vanilla/ControlButton.java @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2010 Christopher Eby + * + * This file is part of Vanilla Music Player. + * + * Vanilla Music Player is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * Vanilla Music Player is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package org.kreed.vanilla; import android.content.Context; @@ -6,11 +24,19 @@ import android.graphics.PorterDuff; import android.util.AttributeSet; import android.widget.ImageView; +/** + * ControlButton is a simple extension of ImageView to make it clickable and + * focusable and provide a visual indication of when these states occur by + * tinting the image green. + */ public class ControlButton extends ImageView { private static final int ACTIVE_TINT = Color.argb(100, 0, 255, 0); private static final int INACTIVE_TINT = Color.TRANSPARENT; private int mTint = Color.TRANSPARENT; + /** + * Constructor intended to be called by inflating from XML. + */ public ControlButton(Context context, AttributeSet attrs) { super(context, attrs); @@ -19,6 +45,10 @@ public class ControlButton extends ImageView { setClickable(true); } + /** + * Change the tint of the view when the state changes to pressed or + * focused. + */ @Override protected void drawableStateChanged() {