2 * This file is part of WolneLektury-Mobile, licensed under GNU Affero GPLv3 or later.
3 * Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 package pl.org.nowoczesnapolska.wlmobi;
8 import android.os.Bundle;
9 import android.view.KeyEvent;
10 import android.view.Menu;
11 import android.view.MenuItem;
12 import android.webkit.WebSettings;
14 import com.phonegap.*;
16 public class Catalogue extends DroidGap {
18 String infoLabel = "Proszę czekać";
19 Boolean infoEnabled = false;
21 /** Called when the activity is first created. */
23 public void onCreate(Bundle savedInstanceState) {
24 super.onCreate(savedInstanceState);
26 super.loadUrl("file:///android_asset/www/index.html");
28 WebSettings settings = this.appView.getSettings();
29 settings.setSupportZoom(true);
30 settings.setBuiltInZoomControls(true);
34 public boolean onCreateOptionsMenu(Menu menu) {
35 menu.add(Menu.NONE, 1, 1, "Początek");
36 menu.add(Menu.NONE, 2, 2, MenuInterface.infoLabel);
37 menu.add(Menu.NONE, 3, 3, "Dodaj zakładkę");
38 //MenuInflater inflater = getMenuInflater();
39 //inflater.inflate(R.menu.game_menu, menu);
40 return super.onCreateOptionsMenu(menu);
44 public boolean onPrepareOptionsMenu(Menu menu) {
45 MenuItem mi = menu.getItem(1);
46 mi.setTitle(MenuInterface.infoLabel);
47 mi.setEnabled(MenuInterface.infoEnabled);
48 return super.onPrepareOptionsMenu(menu);
53 public boolean onKeyDown(int i,KeyEvent e){
54 if (e.getKeyCode() == KeyEvent.KEYCODE_MENU) {
57 return super.onKeyDown(i, e);
61 public boolean onOptionsItemSelected(MenuItem item) {
62 switch (item.getItemId()) {
64 this.appView.loadUrl("javascript:Menu.start();");
67 this.appView.loadUrl("javascript:Menu.info();");
70 this.appView.loadUrl("javascript:Menu.bookmark();");
73 return super.onOptionsItemSelected(item);