1 package pl.org.nowoczesnapolska.wlmobi;
3 import android.os.Bundle;
4 import android.util.Log;
5 import android.view.KeyEvent;
6 import android.view.Menu;
7 import android.view.MenuItem;
8 import android.webkit.WebSettings;
10 import com.phonegap.*;
12 public class Catalogue extends DroidGap {
14 String infoLabel = "Proszę czekać";
15 Boolean infoEnabled = false;
17 /** Called when the activity is first created. */
19 public void onCreate(Bundle savedInstanceState) {
20 super.onCreate(savedInstanceState);
22 super.loadUrl("file:///android_asset/www/index.html");
24 WebSettings settings = this.appView.getSettings();
25 settings.setSupportZoom(true);
26 settings.setBuiltInZoomControls(true);
30 public boolean onCreateOptionsMenu(Menu menu) {
31 menu.add(Menu.NONE, 1, 1, "Początek");
32 menu.add(Menu.NONE, 2, 2, MenuInterface.infoLabel);
33 menu.add(Menu.NONE, 3, 3, "Dodaj zakładkę");
34 //MenuInflater inflater = getMenuInflater();
35 //inflater.inflate(R.menu.game_menu, menu);
36 return super.onCreateOptionsMenu(menu);
40 public boolean onPrepareOptionsMenu(Menu menu) {
41 MenuItem mi = menu.getItem(1);
42 mi.setTitle(MenuInterface.infoLabel);
43 mi.setEnabled(MenuInterface.infoEnabled);
44 return super.onPrepareOptionsMenu(menu);
49 public boolean onKeyDown(int i,KeyEvent e){
50 if (e.getKeyCode() == KeyEvent.KEYCODE_MENU) {
53 return super.onKeyDown(i, e);
57 public boolean onOptionsItemSelected(MenuItem item) {
58 switch (item.getItemId()) {
60 this.appView.loadUrl("javascript:Menu.start();");
63 this.appView.loadUrl("javascript:Menu.info();");
66 this.appView.loadUrl("javascript:Menu.bookmark();");
69 return super.onOptionsItemSelected(item);