Example usage for android.graphics.drawable ShapeDrawable setIntrinsicHeight

List of usage examples for android.graphics.drawable ShapeDrawable setIntrinsicHeight

Introduction

In this page you can find the example usage for android.graphics.drawable ShapeDrawable setIntrinsicHeight.

Prototype

public void setIntrinsicHeight(int height) 

Source Link

Document

Sets the intrinsic (default) height for this shape.

Usage

From source file:com.skytree.epubtest.BookViewActivity.java

public void makeControls() {
    this.removeControls();
    Theme theme = getCurrentTheme();// w  w w.j  a  v a  2s . c om

    int bs = 38;
    if (this.isRotationLocked)
        rotationButton = this.makeImageButton(9000, R.drawable.rotationlocked2x, ps(42), ps(42));
    else
        rotationButton = this.makeImageButton(9000, R.drawable.rotation2x, ps(42), ps(42));
    listButton = this.makeImageButton(9001, R.drawable.list2x, getPS(bs), getPS(bs));
    fontButton = this.makeImageButton(9002, R.drawable.font2x, getPS(bs), getPS(bs));
    searchButton = this.makeImageButton(9003, R.drawable.search2x, getPS(bs), getPS(bs));
    rotationButton.setOnTouchListener(new ImageButtonHighlighterOnTouchListener(rotationButton));
    listButton.setOnTouchListener(new ImageButtonHighlighterOnTouchListener(listButton));
    fontButton.setOnTouchListener(new ImageButtonHighlighterOnTouchListener(fontButton));
    searchButton.setOnTouchListener(new ImageButtonHighlighterOnTouchListener(searchButton));

    titleLabel = this.makeLabel(3000, title, Gravity.CENTER_HORIZONTAL, 17, Color.argb(240, 94, 61, 35)); // setTextSize in android uses sp (Scaled Pixel) as default, they say that sp guarantees the device dependent size, but as usual in android it can't be 100% sure.    
    authorLabel = this.makeLabel(3000, author, Gravity.CENTER_HORIZONTAL, 17, Color.argb(240, 94, 61, 35));
    pageIndexLabel = this.makeLabel(3000, "......", Gravity.CENTER_HORIZONTAL, 13, Color.argb(240, 94, 61, 35));
    secondaryIndexLabel = this.makeLabel(3000, "......", Gravity.CENTER_HORIZONTAL, 13,
            Color.argb(240, 94, 61, 35));

    //      rv.customView.addView(rotationButton);
    //      rv.customView.addView(listButton);
    //      rv.customView.addView(fontButton);
    //      rv.customView.addView(searchButton);      
    rv.customView.addView(titleLabel);
    rv.customView.addView(authorLabel);

    ePubView.addView(rotationButton);
    ePubView.addView(listButton);
    ePubView.addView(fontButton);
    if (!rv.isScrollMode())
        ePubView.addView(searchButton);
    //      ePubView.addView(titleLabel);
    //      ePubView.addView(authorLabel);

    ePubView.addView(pageIndexLabel);
    ePubView.addView(secondaryIndexLabel);

    seekBar = new SkySeekBar(this);
    seekBar.setMax(999);
    seekBar.setId(999);
    RectShape rectShape = new RectShape();
    ShapeDrawable thumb = new ShapeDrawable(rectShape);

    thumb.getPaint().setColor(theme.seekThumbColor);
    thumb.setIntrinsicHeight(getPS(28));
    thumb.setIntrinsicWidth(getPS(28));
    seekBar.setThumb(thumb);
    seekBar.setBackgroundColor(Color.TRANSPARENT);
    seekBar.setOnSeekBarChangeListener(new SeekBarDelegate());
    seekBar.setProgressDrawable(new DottedDrawable(theme.seekBarColor));
    seekBar.setThumbOffset(-3);
    seekBar.setMinimumHeight(24);

    int filterColor = theme.controlColor;
    rotationButton.setColorFilter(filterColor);
    listButton.setColorFilter(filterColor);
    fontButton.setColorFilter(filterColor);
    searchButton.setColorFilter(filterColor);

    authorLabel.setTextColor(filterColor);
    titleLabel.setTextColor(filterColor);
    pageIndexLabel.setTextColor(filterColor);
    secondaryIndexLabel.setTextColor(filterColor);

    ePubView.addView(seekBar);
}