implement feature for issue #294 - ProgressBarWidget

This commit is contained in:
Vadim Lopatin 2016-10-11 11:04:16 +03:00
parent db53e39ce3
commit 5ffe5db1e9
5 changed files with 17 additions and 8 deletions

View File

@ -791,8 +791,15 @@ class ImageDrawable : Drawable {
for (int xx = xx0; xx < rc.right; xx += imgdx) {
Rect dst = Rect(xx, yy, xx + imgdx, yy + imgdy);
Rect src = Rect(0, 0, imgdx, imgdy);
if (dst.intersects(rc))
buf.drawFragment(dst.left, dst.top, _image.get, src);
if (dst.intersects(rc)) {
Rect sr = src;
if (dst.right > rc.right)
sr.right -= dst.right - rc.right;
if (dst.bottom > rc.bottom)
sr.bottom -= dst.bottom - rc.bottom;
if (!sr.empty)
buf.drawFragment(dst.left, dst.top, _image.get, sr);
}
}
}
} else {

View File

@ -186,7 +186,7 @@ class ProgressBarWidget : AbstractProgressBar {
int w = animDrawable.width;
_animationPhase %= w * 1000;
animDrawable.drawTo(buf, rc, 0, cast(int)(_animationPhase * _animationSpeedPixelsPerSecond / 1000), 0);
Log.d("progress animation draw ", _animationPhase, " rc=", rc);
//Log.d("progress animation draw ", _animationPhase, " rc=", rc);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

@ -507,13 +507,14 @@
<style id="PROGRESS_BAR"
padding="2pt,2pt,2pt,2pt"
margins="2pt,2pt,2pt,2pt"
minWidth="50pt"
minHeight="10pt"
backgroundColor="#D0D0D0"
padding="1pt,1pt,1pt,1pt">
<drawable id="progress_bar_gauge" value="#0000FF"/>
minHeight="16pt"
backgroundImageId="progress_bar_background_frame"
>
<drawable id="progress_bar_gauge" value="#4080FF"/>
<drawable id="progress_bar_gauge_animation" value="progress_bar_gauge_animation.tiled"/>
<drawable id="progress_bar_indeterminate" value="#8080C0"/>
<drawable id="progress_bar_indeterminate" value="#80C080"/>
<drawable id="progress_bar_indeterminate_animation" value="progress_bar_gauge_animation.tiled"/>
</style>

View File

@ -56,6 +56,7 @@ res/group_box_frame_up_left_dark.9.png
res/group_box_frame_up_right_dark.9.png
res/slider_background_dark.9.png
res/progress_bar_gauge_animation.png
res/progress_bar_background_frame.9.png
res/i18n/std_en.ini
res/i18n/std_ru.ini
res/list_item_background.xml