1 package de
.rmdir
.ms2debounce
;
3 import android
.app
.Activity
;
4 import android
.app
.Dialog
;
5 import android
.app
.AlertDialog
;
6 import android
.os
.Bundle
;
7 import android
.content
.Intent
;
8 import android
.content
.DialogInterface
;
9 import android
.widget
.TextView
;
10 import android
.view
.Menu
;
11 import android
.view
.MenuInflater
;
12 import android
.view
.MenuItem
;
14 public class MS2Debounce
extends Activity
17 public void onCreate(Bundle savedInstanceState
)
19 super.onCreate(savedInstanceState
);
21 DebounceModuleHelper module
= new DebounceModuleHelper(this);
23 if (!module
.isLoaded()) {
27 setContentView(R
.layout
.main
);
29 TextView text
= (TextView
)findViewById(R
.id
.text
);
30 text
.setText("You will soon be able to set the debounce_delay here.\nModule loaded: " + module
.isLoaded() + "\ndebounce_delay: " + module
.getDelay() + "ms\nsafe_to_load: " + module
.is_safe_to_load());
34 public boolean onCreateOptionsMenu(Menu menu
) {
35 MenuInflater inflater
= getMenuInflater();
36 inflater
.inflate(R
.menu
.main
, menu
);
41 public boolean onOptionsItemSelected(MenuItem item
) {
42 switch (item
.getItemId()) {
47 return super.onOptionsItemSelected(item
);
51 protected Dialog
onCreateDialog(int id
) {
54 AlertDialog
.Builder about
= new AlertDialog
.Builder(this);
55 about
.setMessage("Milestone 2 Debounce\n\n(C) 2011 Michael Gernoth <michael@gernoth.net>\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA")
57 .setPositiveButton("Ok", new DialogInterface
.OnClickListener() {
58 public void onClick(DialogInterface dialog
, int id
) {