2 * Copyright 2008 ZXing authors
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 package com.google.zxing.client.rim;
\r
19 import net.rim.device.api.ui.Field;
\r
20 import net.rim.device.api.ui.FieldChangeListener;
\r
21 import net.rim.device.api.ui.Manager;
\r
22 import net.rim.device.api.ui.Screen;
\r
23 import net.rim.device.api.ui.Ui;
\r
24 import net.rim.device.api.ui.UiEngine;
\r
25 import net.rim.device.api.ui.DrawStyle;
\r
26 import net.rim.device.api.ui.component.ButtonField;
\r
27 import net.rim.device.api.ui.component.LabelField;
\r
28 import net.rim.device.api.ui.container.MainScreen;
\r
29 import net.rim.device.api.ui.container.VerticalFieldManager;
\r
32 * The screen used to display the application 'about' information.
\r
34 * This code was contributed by LifeMarks.
\r
36 * @author Matt York (matt@lifemarks.mobi)
\r
38 final class AboutScreen extends MainScreen {
\r
41 setTitle(new LabelField("ZXing - About", DrawStyle.ELLIPSIS | USE_ALL_WIDTH));
\r
42 Manager vfm = new VerticalFieldManager(FIELD_HCENTER);
\r
43 Field title = new LabelField("ZXing - BlackBerry Client", FIELD_HCENTER);
\r
44 Field uri = new LabelField("http://code.google.com/p/zxing/", FIELD_HCENTER);
\r
47 Field okButton = new ButtonField("OK", FIELD_HCENTER | ButtonField.CONSUME_CLICK);
\r
48 okButton.setChangeListener(new ButtonListener(this));
\r
54 * Used to close the screen when the ok button is pressed.
\r
56 private static class ButtonListener implements FieldChangeListener {
\r
57 private final Screen screen;
\r
58 private ButtonListener(Screen screen) {
\r
59 this.screen = screen;
\r
61 public void fieldChanged(Field field, int context) {
\r
62 UiEngine ui = Ui.getUiEngine();
\r
63 ui.popScreen(screen);
\r