INNER CODE UNIT · Java
resetStyles
jjoe64/GraphView · src/main/java/com/jjoe64/graphview/CursorMode.java:65
public void resetStyles() {
mStyles.textSize = mGraphView.getGridLabelRenderer().getTextSize();
mStyles.spacing = (int) (mStyles.textSize / 5);
mStyles.padding = (int) (mStyles.textSize / 2);
mStyles.width = 0;
mStyles.backgroundColor = Color.argb(180, 100, 100, 100);
mStyles.margin = (int) (mStyles.textSize);
// get matching styles from theme
TypedValue typedValue = new TypedValue();
mGraphView.getContext().getTheme().resolveAttribute(android.R.attr.textAppearanceSmall, typedValue, true);
int color1;
try {
TypedArray array = mGraphView.getContext().obtainStyledAttributes(typedValue.data, new int[]{
android.R.attr.textColorPrimary});
color1 = array.getColor(0, Color.BLACK);