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

COVERAGE SUMMARY FOR SOURCE FILE [DictionaryInfoActivity.java]

nameclass, %method, %block, %line, %
DictionaryInfoActivity.java100% (1/1)100% (4/4)100% (150/150)100% (30/30)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DictionaryInfoActivity100% (1/1)100% (4/4)100% (150/150)100% (30/30)
DictionaryInfoActivity (): void 100% (1/1)100% (3/3)100% (1/1)
createTabContent (String): View 100% (1/1)100% (78/78)100% (19/19)
initUI (): void 100% (1/1)100% (16/16)100% (5/5)
onDictionaryServiceReady (): void 100% (1/1)100% (53/53)100% (5/5)

1/* This file is part of Aard Dictionary for Android <http://aarddict.org>.
2 * 
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 3
5 * as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License <http://www.gnu.org/licenses/gpl-3.0.txt>
11 * for more details.
12 * 
13 * Copyright (C) 2010 Igor Tkach
14*/
15 
16package aarddict.android;
17 
18import aarddict.Metadata;
19import aarddict.Volume;
20import android.content.Intent;
21import android.text.util.Linkify;
22import android.view.View;
23import android.widget.TabHost;
24import android.widget.TextView;
25import android.widget.TabHost.TabContentFactory;
26 
27public final class DictionaryInfoActivity extends BaseDictionaryActivity implements TabContentFactory {
28        
29    private TabHost tabs;
30    
31        @Override
32        void initUI() {
33        setContentView(R.layout.dict_info);
34        tabs = (TabHost)findViewById(android.R.id.tabhost);
35        tabs.setup();        
36        setTitle(R.string.titleDictionaryInfoActivity);        
37        }        
38        
39        @Override
40        void onDictionaryServiceReady() {
41                tabs.addTab(tabs.newTabSpec("d").setIndicator(getString(R.string.tabDescription)).setContent(this));
42                tabs.addTab(tabs.newTabSpec("c").setIndicator(getString(R.string.tabCopyright)).setContent(this));
43                tabs.addTab(tabs.newTabSpec("s").setIndicator(getString(R.string.tabSource)).setContent(this));
44                tabs.addTab(tabs.newTabSpec("l").setIndicator(getString(R.string.tabLicense)).setContent(this));
45        }
46 
47        public View createTabContent(String tag) {
48                Intent intent = getIntent();
49                String volumeId = intent.getStringExtra("volumeId");
50                Volume d = dictionaryService.getVolume(volumeId);
51                setTitle(new StringBuilder(d.getDisplayTitle(false)).append(" ").append(d.metadata.version));
52                Metadata m = d.metadata;
53                TextView textView = new TextView(this);
54                textView.setAutoLinkMask(Linkify.WEB_URLS | Linkify.EMAIL_ADDRESSES);
55                CharSequence text = "";
56                if (tag.equals("d")) {        
57                        text = m.description;
58                }
59                else 
60                if (tag.equals("c")) {        
61                        text = m.copyright;
62                }
63                else
64                if (tag.equals("s")) {        
65                        text = m.source;
66                }
67                else
68                if (tag.equals("l")) {        
69                        text = m.license;
70                        textView.setHorizontallyScrolling(true);
71                }                
72                textView.setText(text);
73                return textView;
74        }
75}

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