summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/fragments/SeekbarTicks.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-11-07 22:40:51 +0100
committerArne Schwabe <arne@rfc2549.org>2013-11-07 22:40:51 +0100
commit8ced9f378613425efb9949196e967dbe2f03a63a (patch)
tree37eb4395b3d04463f63916b1cdb7498bf6ebb828 /src/de/blinkt/openvpn/fragments/SeekbarTicks.java
parente66b35409cff37433af11693673145406029356f (diff)
Fine tune log window.
--HG-- rename : res/layout-w720dp/log_fragment.xml => res/layout-sw600dp/log_fragment.xml rename : res/values-w600dp/dimens.xml => res/values-sw600dp/dimens.xml
Diffstat (limited to 'src/de/blinkt/openvpn/fragments/SeekbarTicks.java')
-rw-r--r--src/de/blinkt/openvpn/fragments/SeekbarTicks.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/de/blinkt/openvpn/fragments/SeekbarTicks.java b/src/de/blinkt/openvpn/fragments/SeekbarTicks.java
index 1e289529..ec68e7e4 100644
--- a/src/de/blinkt/openvpn/fragments/SeekbarTicks.java
+++ b/src/de/blinkt/openvpn/fragments/SeekbarTicks.java
@@ -14,6 +14,7 @@ public class SeekBarTicks extends SeekBar {
private Paint mTickPaint;
private float mTickHeight;
+ private float tickHeightRatio = 0.6f;
public SeekBarTicks(Context context, AttributeSet attrs) {
super (context, attrs);
@@ -37,7 +38,7 @@ public class SeekBarTicks extends SeekBar {
new int[] { android.R.attr.secondaryProgress }, defStyle, 0);
- int tickColor = a.getColor(0, android.R.color.white);
+ int tickColor = a.getColor(0, android.R.color.black);
mTickPaint = new Paint();
mTickPaint.setColor( context.getResources().getColor(tickColor));
a.recycle();
@@ -53,11 +54,16 @@ public class SeekBarTicks extends SeekBar {
private void drawTicks(Canvas canvas) {
final int available = getWidth() - getPaddingLeft() - getPaddingRight();
+ final int availableHeight = getHeight() - getPaddingBottom() - getPaddingTop();
+
+ int extrapadding = (int) ((availableHeight- (availableHeight * tickHeightRatio))/2);
+
int tickSpacing = available / (getMax() );
for (int i = 1; i < getMax(); i++) {
final float x = getPaddingLeft() + i * tickSpacing;
- canvas.drawLine(x, getPaddingTop(), x, getHeight()-getPaddingBottom(), mTickPaint);
+
+ canvas.drawLine(x, getPaddingTop()+extrapadding, x, getHeight()-getPaddingBottom()-extrapadding, mTickPaint);
}
}
}