Android Mobile Physical Therapy Exercise Documenter

com.communipatient.amptedapp.util
Class UIUtils

java.lang.Object
  extended by com.communipatient.amptedapp.util.UIUtils

public class UIUtils
extends java.lang.Object

An assortment of UI helpers.


Field Summary
private static int BRIGHTNESS_THRESHOLD
           
private static android.text.style.StyleSpan sBoldSpan
           
private static java.lang.StringBuilder sBuilder
          StringBuilder used for formatting time block.
private static java.util.Formatter sFormatter
          Formatter used for formatting time block.
private static int TIME_FLAGS
          Flags used with DateUtils.formatDateRange(android.content.Context, long, long, int).
 
Constructor Summary
UIUtils()
           
 
Method Summary
static android.text.Spannable buildStyledSnippet(java.lang.String snippet)
          Given a snippet string with matching segments surrounded by curly braces, turn those areas into bold spans, removing the curly braces.
static long getCurrentTime(android.content.Context context)
           
static android.graphics.drawable.Drawable getIconForIntent(android.content.Context context, android.content.Intent i)
           
static java.lang.String getLastUsedTrackID(android.content.Context context)
           
static boolean isColorDark(int color)
          Calculate whether a color is light or dark, based on a commonly known brightness formula.
static boolean isHoneycomb()
           
static boolean isHoneycombTablet(android.content.Context context)
           
static void setLastUsedTrackID(android.content.Context context, java.lang.String trackID)
           
static void setTextMaybeHtml(android.widget.TextView view, java.lang.String text)
          Populate the given TextView with the requested text, formatting through Html.fromHtml(String) when applicable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_FLAGS

private static final int TIME_FLAGS
Flags used with DateUtils.formatDateRange(android.content.Context, long, long, int).

See Also:
Constant Field Values

sBuilder

private static java.lang.StringBuilder sBuilder
StringBuilder used for formatting time block.


sFormatter

private static java.util.Formatter sFormatter
Formatter used for formatting time block.


sBoldSpan

private static android.text.style.StyleSpan sBoldSpan

BRIGHTNESS_THRESHOLD

private static final int BRIGHTNESS_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

UIUtils

public UIUtils()
Method Detail

setTextMaybeHtml

public static void setTextMaybeHtml(android.widget.TextView view,
                                    java.lang.String text)
Populate the given TextView with the requested text, formatting through Html.fromHtml(String) when applicable. Also sets TextView.setMovementMethod(android.text.method.MovementMethod) so inline links are handled.


buildStyledSnippet

public static android.text.Spannable buildStyledSnippet(java.lang.String snippet)
Given a snippet string with matching segments surrounded by curly braces, turn those areas into bold spans, removing the curly braces.


getLastUsedTrackID

public static java.lang.String getLastUsedTrackID(android.content.Context context)

setLastUsedTrackID

public static void setLastUsedTrackID(android.content.Context context,
                                      java.lang.String trackID)

isColorDark

public static boolean isColorDark(int color)
Calculate whether a color is light or dark, based on a commonly known brightness formula.

See Also:
http://en.wikipedia.org/wiki/HSV_color_space%23Lightness}

isHoneycomb

public static boolean isHoneycomb()

isHoneycombTablet

public static boolean isHoneycombTablet(android.content.Context context)

getCurrentTime

public static long getCurrentTime(android.content.Context context)

getIconForIntent

public static android.graphics.drawable.Drawable getIconForIntent(android.content.Context context,
                                                                  android.content.Intent i)

Revision: 109 Generated on Sat Dec 10 07:00:03 UTC 2011