Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r761 committed - Add new resources, class for restored features.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r761 committed - Add new resources, class for restored features.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r761 committed - Add new resources, class for restored features.
  • Date: Thu, 15 Dec 2011 16:15:21 +0000

Revision: 761
Author:

Date: Thu Dec 15 08:08:02 2011
Log: Add new resources, class for restored features.
http://code.google.com/p/ndt/source/detail?r=761

Added:
/branches/android/Android/res/layout/servers.xml
/branches/android/Android/res/menu
/branches/android/Android/res/menu/initial.xml
/branches/android/Android/res/menu/results.xml
/branches/android/Android/src/net/measurementlab/ndt/SelectServerActivity.java

=======================================
--- /dev/null
+++ /branches/android/Android/res/layout/servers.xml Thu Dec 15 08:08:02 2011
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android";
+ android:orientation="vertical" android:layout_width="fill_parent"
+ android:layout_height="wrap_content">
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="fill_parent" android:layout_height="fill_parent">
+ <RadioGroup android:layout_width="fill_parent"
+ android:layout_height="wrap_content" android:orientation="vertical"
+ android:id="@+id/servergroup">
+ <!-- Add RadioButtons here by program dynamically -->
+ </RadioGroup>
+ <LinearLayout android:orientation="horizontal"
+ android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <Button android:layout_weight="1" android:layout_height="wrap_content"
+ android:layout_width="wrap_content" android:text="@string/servers_save"
+ android:id="@+id/ButtonServerSave" />
+ </LinearLayout>
+ </LinearLayout>
+</ScrollView>
=======================================
--- /dev/null
+++ /branches/android/Android/res/menu/initial.xml Thu Dec 15 08:08:02
2011
@@ -0,0 +1,973 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android";>
+ <item android:title="@string/initial_select_server" android:id="@+id/MenuSelectServers"/>
+ <item android:title="@string/about" android:id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+<menu xmlns:android="http://schemas.android.com/apk/res/android";>
+ <item android:title="@string/results_email" android:id="@+id/MenuEmail"/>
+ <item android:title="@string/results_test_again" android:id="@+id/MenuStartAgain"/>
+</menu>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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- /dev/null
+++ /branches/android/Android/src/net/measurementlab/ndt/SelectServerActivity.java Thu Dec 15 08:08:02 2011
@@ -0,0 +1,71 @@
+package net.measurementlab.ndt;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+
+/**
+ * User select the testing server here and pass the related value back to the
+ * main activity.
+ */
+public class SelectServerActivity extends Activity implements
+ RadioGroup.OnCheckedChangeListener {
+
+ public static final String EXTRA_SERVER_NUMBER = "net.measurementlab.ndt.SelectedServer";
+
+ public static final int ACTIVITY_SELECT_SERVER = 1;
+ private int serverNo = 0;
+ private RadioButton server[] = new RadioButton[Constants.NUMBER_OF_SERVERS];
+ private Button buttonOptionSave;
+ private RadioGroup radioGroup;
+
+ /**
+ * Reads the server list from Constants class. Records the user's choice and
+ * send it back to the main activity.
+ */
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.servers);
+ Bundle serverInfo = getIntent().getExtras();
+ if (serverInfo != null) {
+ serverNo = serverInfo.getInt(EXTRA_SERVER_NUMBER);
+ Log.v("NDT", "Passed Into Option: " + serverNo);
+ }
+ radioGroup = (RadioGroup) findViewById(R.id.servergroup);
+ buttonOptionSave = (Button)
findViewById(R.id.ButtonServerSave);
+ for (int i = 0; i < Constants.NUMBER_OF_SERVERS; i++) {
+ server[i] = new RadioButton(this);
+ server[i].setText(Constants.SERVER_LIST[i][0]);
+ radioGroup.addView(server[i]);
+ }
+ server[serverNo].setChecked(true);
+ radioGroup.setOnCheckedChangeListener(this);
+ buttonOptionSave.setOnClickListener(new
View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intentReturn = new Intent();
+ intentReturn.putExtra(EXTRA_SERVER_NUMBER,
serverNo);
+ setResult(RESULT_OK, intentReturn);
+ finish();
+ }
+ });
+ }
+
+ /**
+ * Responds to the change in selection.
+ */
+ @Override
+ public void onCheckedChanged(RadioGroup radioGroup, int checkedId) {
+ for (int i = 0; i < Constants.NUMBER_OF_SERVERS; i++) {
+ if (server[i].getId() == checkedId) {
+ serverNo = i;
+ }
+ }
+ }
+}


  • [ndt-dev] [ndt] r761 committed - Add new resources, class for restored features., ndt, 12/15/2011

Archive powered by MHonArc 2.6.16.

Top of Page