EMMA Coverage Report (generated Wed Jun 27 17:43:42 CEST 2012)
[all classes][aarddict.android]

COVERAGE SUMMARY FOR SOURCE FILE [EinkArticleView.java]

nameclass, %method, %block, %line, %
EinkArticleView.java0%   (0/1)0%   (0/7)0%   (0/110)0%   (0/31)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EinkArticleView0%   (0/1)0%   (0/7)0%   (0/110)0%   (0/31)
EinkArticleView (Context): void 0%   (0/1)0%   (0/4)0%   (0/2)
EinkArticleView (Context, AttributeSet): void 0%   (0/1)0%   (0/5)0%   (0/2)
EinkArticleView (Context, AttributeSet, int): void 0%   (0/1)0%   (0/6)0%   (0/2)
onDraw (Canvas): void 0%   (0/1)0%   (0/6)0%   (0/3)
onSizeChanged (int, int, int, int): void 0%   (0/1)0%   (0/19)0%   (0/4)
pageDown (boolean): boolean 0%   (0/1)0%   (0/47)0%   (0/11)
pageUp (boolean): boolean 0%   (0/1)0%   (0/23)0%   (0/7)

1package aarddict.android;
2 
3import android.content.Context;
4import android.graphics.Canvas;
5import android.util.AttributeSet;
6 
7public class EinkArticleView extends ArticleView {
8 
9        public EinkArticleView(Context context) {
10                super(context);
11        }
12        public EinkArticleView(Context context, AttributeSet attrs) {
13                super(context, attrs);
14        }
15        public EinkArticleView(Context context, AttributeSet attrs, int defStyle) {
16                super(context, attrs, defStyle);
17        }
18 
19        private ArticleView articleView;
20        public static int HSCROLL_SIZE;
21 
22        @Override
23        protected void onDraw (Canvas canvas) {
24                N2EpdController.setGL16Mode(0); // partial refresh
25                super.onDraw(canvas);
26        }
27        
28    public void onSizeChanged(int w, int h, int ow, int oh) {
29        super.onSizeChanged(w, h, ow, oh);
30 
31        articleView = (ArticleView)findViewById(R.id.EinkArticleView);
32        HSCROLL_SIZE = articleView.getHeight() - 20;
33    }
34 
35    public boolean pageUp(boolean top) {
36        int cury = articleView.getScrollY();
37        if (cury == 0) { return false; }
38        int newy = cury - HSCROLL_SIZE;
39        if (newy < 0) {
40          newy = 0;
41        }
42        articleView.scrollTo(0, newy);
43        return true;
44    }
45 
46    public boolean pageDown(boolean bottom) {
47            int cury = articleView.getScrollY();
48            int hmax = 0;
49            if (HSCROLL_SIZE < articleView.getContentHeight() )
50                    hmax = (int) (articleView.getContentHeight() * articleView.getScale()) - HSCROLL_SIZE; 
51        if (cury == hmax) { return false; }        
52        int newy = cury + HSCROLL_SIZE;
53        if (newy > hmax) {
54          newy = hmax;
55        }
56        if (cury != newy) {
57          articleView.scrollTo(0, newy);
58        }
59        return true;
60    }
61}

[all classes][aarddict.android]
EMMA 0.0.0 (unsupported private build) (C) Vladimir Roubtsov