package hh.michelson;

import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.widget.ListView;

import java.util.Locale;

import hh.lib.D;

public class RotatedLv extends ListView {
    static String tag;
    D d;

    public RotatedLv(Context c) { this(c, null); }

    public RotatedLv(Context c, AttributeSet a) {
        super(c, a);
        d = new D(c, getClass().getSimpleName() + "." + getId());
    }

    protected void onMeasure(int w, int h) {
        super.onMeasure(w, h);
	    Resources r = d.c.getResources();
	    int W = r.getDimensionPixelSize(R.dimen.graph_width);
	    int H = C.windowWidth - r.getDimensionPixelSize(R.dimen.graph_heigth);
        setMeasuredDimension(W, H);
        d.l(4, String.format(Locale.getDefault(), "onMeasure, adjusted to width=%d, heigth=%d", W, H));
    }
}
