Skip to Content.
Sympa Menu

ndt-dev - [ndt-dev] [ndt] r493 committed - Add widgets for end points, clean up styling.

Subject: NDT-DEV email list created

List archive

[ndt-dev] [ndt] r493 committed - Add widgets for end points, clean up styling.


Chronological Thread 
  • From:
  • To:
  • Subject: [ndt-dev] [ndt] r493 committed - Add widgets for end points, clean up styling.
  • Date: Mon, 15 Aug 2011 19:24:58 +0000

Revision: 493
Author:

Date: Mon Aug 15 12:24:06 2011
Log: Add widgets for end points, clean up styling.
http://code.google.com/p/ndt/source/detail?r=493

Modified:
/branches/android/Android/res/layout/tests.xml
/branches/android/Android/res/values/strings.xml
/branches/android/Android/res/values/styles.xml
/branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java

=======================================
--- /branches/android/Android/res/layout/tests.xml Mon Aug 15 11:29:46
2011
+++ /branches/android/Android/res/layout/tests.xml Mon Aug 15 12:24:06
2011
@@ -6,16 +6,26 @@
<LinearLayout android:id="@+id/linearLayout1"
android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="match_parent">
- <TextView android:layout_width="match_parent"
- android:text="@string/tests_preparing_header"
- android:layout_height="wrap_content"
- android:id="@+id/NdtServerLocationLabel"
- android:layout_gravity="top"
- style="@style/NdtHeader" />
+ android:layout_height="wrap_content">
+ <TextView android:text="@string/tests_preparing_header"
+ android:id="@+id/NdtTestsHeader"
+ android:paddingTop="15sp"
+ style="@style/NdtTestsHeader" />
+ <TextView android:id="@+id/NdtTestsInfo"
+ style="@style/NdtTestsHeader.Info" />
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/progress_bar"
android:id="@+id/NdtServerLocationProgress"></ImageView>
+ <TextView android:text="@string/tests_test_server"
+ android:id="@+id/TestServerLabel"
+ style="@style/NdtTestsDetail" />
+ <TextView android:id="@+id/TestServerValue"
+ style="@style/NdtTestsDetail.Info" />
+ <TextView android:text="@string/tests_your_computer"
+ android:id="@+id/TestClientLabel"
+ style="@style/NdtTestsDetail" />
+ <TextView android:id="@+id/TestClientValue"
+ style="@style/NdtTestsDetail.Info" />
</LinearLayout>
</LinearLayout>
=======================================
--- /branches/android/Android/res/values/strings.xml Mon Aug 15 10:13:26 2011
+++ /branches/android/Android/res/values/strings.xml Mon Aug 15 12:24:06 2011
@@ -36,11 +36,12 @@
<string name="test_again">Press Start to test again.</string>
<string name="mlab">M-Lab</string>
<string name="mlabdesc">Network Diagnostic Tool (NDT) provides a sophisticated speed and diagnostic test. An NDT test reports more than just the upload and download speeds — it also attempts to determine what, if any, problems limited these speeds, differentiating between computer configuration and network infrastructure problems. While the diagnostic messages are most useful for expert users, they can also help novice users by allowing them to provide detailed trouble reports to their network administrator.</string>
- <string name="tests_preparing_header">Preparing Your Tests...</string>
- <string name="tests_now_testing_header">Now Testing</string>
- <string name="tests_upload_header">Upload Speed</string>
- <string name="tests_download_header">Download Speed</string>
- <string name="tests_test_server">Test Server</string>
- <string name="tests_your_computer">Your Computer</string>
+ <string name="tests_preparing_header">PREPARING YOUR TESTS...</string>
+ <string name="tests_both_header">NOW TESTING</string>
+ <string name="tests_complete_header">Tests Complete</string>
+ <string name="tests_upload_info">YOUR UPLOAD SPEED</string>
+ <string name="tests_download_info">YOUR DOWNLOAD SPEED</string>
+ <string name="tests_test_server">TEST SERVER</string>
+ <string name="tests_your_computer">YOUR COMPUTER</string>

</resources>
=======================================
--- /branches/android/Android/res/values/styles.xml Mon Jun 20 09:23:24
2011
+++ /branches/android/Android/res/values/styles.xml Mon Aug 15 12:24:06
2011
@@ -11,12 +11,32 @@
<item name="android:layout_width">fill_parent</item>
<item name="android:padding">40sp</item>
</style>
- <style name="NdtHeader" parent="@android:style/TextAppearance">
- <item name="android:textColor">#000000</item>
+ <style name="NdtTestsHeader" parent="@android:style/TextAppearance">
+ <item name="android:textColor">#000</item>
<item name="android:textSize">32sp</item>
- <item name="android:gravity">center_horizontal</item>
+ <item name="android:gravity">left</item>
+ <item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">fill_parent</item>
- <item name="android:padding">15sp</item>
+ <item name="android:paddingLeft">25sp</item>
+ </style>
+ <style name="NdtTestsHeader.Info">
+ <item name="android:textColor">#FFF</item>
+ </style>
+ <style name="NdtTestsDetail" parent="@android:style/TextAppearance">
+ <item name="android:textColor">#FFF</item>
+ <item name="android:textSize">32sp</item>
+ <item name="android:gravity">left</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:paddingLeft">25sp</item>
+ </style>
+ <style name="NdtTestsDetail.Info" parent="@android:style/TextAppearance">
+ <item name="android:textColor">#000</item>
+ <item name="android:textSize">16sp</item>
+ <item name="android:gravity">left</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:paddingLeft">25sp</item>
</style>
<style name="NdtButton" parent="@android:style/Widget.Button">
<item name="android:layout_height">wrap_content</item>
=======================================
--- /branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java Mon Aug 15 11:29:46 2011
+++ /branches/android/Android/src/net/measurementlab/ndt/TestsActivity.java Mon Aug 15 12:24:06 2011
@@ -30,8 +30,18 @@
Log.i("ndt", "Loaded!");
Typeface typeFace = Typeface.createFromAsset(getAssets(),
"fonts/League_Gothic.otf");
- TextView textView = (TextView)
findViewById(R.id.NdtServerLocationLabel);
+ TextView textView = (TextView)
findViewById(R.id.NdtTestsHeader);
textView.setTypeface(typeFace);
+ textView = (TextView) findViewById(R.id.NdtTestsInfo);
+ textView.setTypeface(typeFace);
+ textView = (TextView) findViewById(R.id.TestServerLabel);
+ textView.setTypeface(typeFace);
+ textView = (TextView) findViewById(R.id.TestServerValue);
+ textView.setTypeface(typeFace);
+ textView = (TextView) findViewById(R.id.TestClientLabel);
+ textView.setTypeface(typeFace);
+ textView = (TextView) findViewById(R.id.TestClientValue);
+ textView.setTypeface(typeFace);
}

@Override
@@ -74,7 +84,26 @@

private void preparing() {
Log.i("ndt", "Preparing Your Tests...");
-
updateHeader(getResources().getText(R.string.tests_preparing_header));
+ updateHeader(R.string.tests_preparing_header);
+ // TODO show preparation animation
+ }
+
+ private void uploading() {
+ Log.i("ndt", "Testing Upload...");
+ updateHeader(R.string.tests_both_header,
R.string.tests_upload_info);
+ // TODO show upload animation
+ }
+
+ private void downloading() {
+ Log.i("ndt", "Testing Download...");
+ updateHeader(R.string.tests_both_header,
R.string.tests_download_info);
+ // TODO show download animation
+ }
+
+ private void complete() {
+ Log.i("ndt", "Testing Complete.");
+ updateHeader(R.string.tests_complete_header);
+ // TODO send intent for summary activity
}

private BroadcastReceiver createReceiver() {
@@ -89,16 +118,13 @@
preparing();
break;
case NdtService.UPLOADING:
- Log.i("ndt", "Testing Upload...");
- updateHeader("Testing upload...");
+ uploading();
break;
case NdtService.DOWNLOADING:
- Log.i("ndt", "Testing Download...");
- updateHeader("Testing download...");
+ downloading();
break;
case NdtService.COMPLETE:
- Log.i("ndt", "Testing Complete.");
- updateHeader("Test complete.");
+ complete();
break;
default:
Log.i("ndt", "Test reporter not
initialized.");
@@ -111,9 +137,17 @@

}

- private void updateHeader(CharSequence labelText) {
- TextView textView = (TextView)
findViewById(R.id.NdtServerLocationLabel);
- textView.setText(labelText);
+ private void updateHeader(int headerResource) {
+ TextView textView = (TextView)
findViewById(R.id.NdtTestsHeader);
+ textView.setText(getResources().getText(headerResource));
+ textView = (TextView) findViewById(R.id.NdtTestsInfo);
+ textView.setText("");
+ }
+
+ private void updateHeader(int headerResource, int infoResource) {
+ updateHeader(headerResource);
+ TextView textView = (TextView)
findViewById(R.id.NdtTestsInfo);
+ textView.setText(getResources().getText(infoResource));
}

private String getNetworkType() {


  • [ndt-dev] [ndt] r493 committed - Add widgets for end points, clean up styling., ndt, 08/15/2011

Archive powered by MHonArc 2.6.16.

Top of Page