From 19ebc13c024defb13c68e4111673f963df01dfa5 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sun, 16 Aug 2015 22:18:49 +0000 Subject: [PATCH] Add SVG icon file --- app/src/main/java/net/jacekk/bridge/android/MainActivity.java | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/app/src/main/java/net/jacekk/bridge/android/MainActivity.java b/app/src/main/java/net/jacekk/bridge/android/MainActivity.java index eb1677f..15d2906 100644 --- a/app/src/main/java/net/jacekk/bridge/android/MainActivity.java +++ b/app/src/main/java/net/jacekk/bridge/android/MainActivity.java @@ -1,9 +1,12 @@ package net.jacekk.bridge.android; import android.app.Activity; +import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; +import android.view.Menu; +import android.view.MenuItem; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.SeekBar; @@ -51,6 +54,25 @@ InitializeApp(); } + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.main, menu); + return super.onCreateOptionsMenu(menu); + } + + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.main_action_about: + Intent about = new Intent(getApplicationContext(), AboutActivity.class); + startActivity(about); + return true; + case R.id.main_action_reset: + resetInputs(); + return true; + } + + return super.onOptionsItemSelected(item); + } + private void resetInputs() { BidSlider.setProgress(0); MinorSuitsToggle.setChecked(true); @@ -61,7 +83,7 @@ ResultsText.setText(getString(R.string.enter_data)); } - private void InitializeApp() { + protected void InitializeApp() { bridgeCompute = new BridgeCompute(); BidSlider = (SeekBar) findViewById(R.id.BidSlider); -- Gitblit v1.9.1