Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r759 committed - Clean layout by changing buttons on results to menu options.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r759 committed - Clean layout by changing buttons on results to menu options.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r759 committed - Clean layout by changing buttons on results to menu options.
  • Date: Thu, 15 Dec 2011 16:07:17 +0000

Revision: 759
Author:

Date: Thu Dec 15 08:06:20 2011
Log: Clean layout by changing buttons on results to menu options.
http://code.google.com/p/ndt/source/detail?r=759

Modified:
/branches/android/Android/res/layout/results.xml
/branches/android/Android/src/net/measurementlab/ndt/InitialActivity.java
/branches/android/Android/src/net/measurementlab/ndt/ResultsActivity.java

=======================================
--- /branches/android/Android/res/layout/results.xml Thu Dec 15 06:33:50 2011
+++ /branches/android/Android/res/layout/results.xml Thu Dec 15 08:06:20 2011
@@ -129,10 +129,6 @@
<LinearLayout android:orientation="horizontal"
android:layout_alignParentRight="true" android:layout_width="wrap_content"
android:layout_height="wrap_content">
- <Button android:text="@string/results_email" android:id="@+id/ButtonEmail"
- style="@style/NdtButton" />
- <Button android:text="@string/results_test_again" android:id="@+id/ButtonStart"
- style="@style/NdtButton" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/InitialActivity.java Thu Dec 15 07:59:31 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/InitialActivity.java Thu Dec 15 08:06:20 2011
@@ -55,14 +55,14 @@
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
- case R.id.SelectServers: {
+ case R.id.MenuSelectServers: {
Intent intent = new Intent(InitialActivity.this, SelectServerActivity.class);

intent.putExtra(SelectServerActivity.EXTRA_SERVER_NUMBER, serverNumber);
startActivityForResult(intent, SelectServerActivity.ACTIVITY_SELECT_SERVER);

return true;
}
- case R.id.About: {
+ case R.id.MenuAbout: {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri
.parse("http://measurementlab.net";));
startActivity(intent);
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/ResultsActivity.java Thu Dec 15 06:33:50 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/ResultsActivity.java Thu Dec 15 08:06:20 2011
@@ -10,9 +10,11 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
-import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

@@ -60,27 +62,6 @@
aboutView.setOnClickListener(aboutListener);
aboutView = findViewById(R.id.MLabLogo);
aboutView.setOnClickListener(aboutListener);
-
-
- Button emailButton = (Button) findViewById(R.id.ButtonEmail);
- emailButton.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- emailResults();
- }
- });
-
- Button startButton = (Button) findViewById(R.id.ButtonStart);
- startButton.setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- Intent intent = new
Intent(getApplicationContext(),
- TestsActivity.class);
- startActivity(intent);
- }
- });
}

/**
@@ -103,6 +84,34 @@
getString(R.string.results_swipe_hint), 10);
resultsHint.show();
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.results, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle item selection
+ switch (item.getItemId()) {
+ case R.id.MenuEmail: {
+ emailResults();
+
+ return true;
+ }
+ case R.id.MenuStartAgain: {
+ Intent intent = new Intent(getApplicationContext(),
+ TestsActivity.class);
+ startActivity(intent);
+
+ return true;
+ }
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }

private void formatSummaryResults(Map<String, Object> variables) {
DecimalFormat format = (DecimalFormat)
DecimalFormat.getInstance();


  • [ndt-dev] [ndt] r759 committed - Clean layout by changing buttons on results to menu options., ndt, 12/15/2011

Archive powered by MHonArc 2.6.16.

Top of Page