Sha256: cab43cbc04a262b2fb63ee2fd9bedf0848c7061be3ec47e902d497eded28387c

Contents?: true

Size: 1.65 KB

Versions: 14

Compression:

Stored size: 1.65 KB

Contents

package com.rho.rhoelements.graphics;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.LinearLayout;

/**
 * A class for a transparent overlay panel that can hold Indicators.
 * @author Ben Kennedy
 */
public class IndicatorPanel extends LinearLayout
{
	private BatteryIndicator bIndicator;
	private SignalIndicator sIndicator;

	/**
	 * @param context
	 */
	public IndicatorPanel(Context context)
	{
		super(context);
		init();
	}

	/**
	 * @param context
	 * @param attrSet
	 */
	public IndicatorPanel(Context context, AttributeSet attrSet)
	{
		super(context, attrSet);
		init();
	}

	/**
	 * Initialises the IndicatorPanel by constructing the Indicators.
	 */
	private void init()
	{
		bIndicator = BatteryIndicator.getIndicator(this);
		sIndicator = SignalIndicator.getIndicator(this);
	}

	/* (non-Javadoc)
	 * @see android.view.ViewGroup#dispatchDraw(android.graphics.Canvas)
	 */
	@Override
	protected void dispatchDraw(Canvas canvas)
	{   
		bIndicator.draw(canvas);
		sIndicator.draw(canvas);
		super.dispatchDraw(canvas);
	}

	/**
	 * Returns the BatteryIndicator object
	 * @return the BatteryIndicator object
	 */
	public BatteryIndicator getBatteryIndicator()
	{
		return bIndicator;
	}

	/**
	 * Returns the SignalIndicator object
	 * @return the SignalIndicator
	 */
	public SignalIndicator getSignalIndicator()
	{
		return sIndicator;
	}

	/* (non-Javadoc)
	 * @see android.view.View#onSizeChanged(int, int, int, int)
	 */
	@Override
	protected void onSizeChanged(int w, int h, int oldw, int oldh)
	{
		super.onSizeChanged(w, h, oldw, oldh);
		sIndicator.setView(this);
		bIndicator.setView(this);
	}
}

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rhodes-7.6.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-7.5.1 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-7.4.1 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-7.1.17 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-6.2.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-6.0.11 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.18 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.17 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.15 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.0.22 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.2 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.0.7 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.0.3 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java
rhodes-5.5.0 extensions/rhoelementsext/ext/rhoelementsext/platform/android/rhoelements_temp/src/com/rho/rhoelements/graphics/IndicatorPanel.java