altosdroid: Add version information to UI
authorMike Beattie <mike@ethernal.org>
Wed, 24 Oct 2012 07:54:18 +0000 (20:54 +1300)
committerMike Beattie <mike@ethernal.org>
Wed, 24 Oct 2012 07:54:18 +0000 (20:54 +1300)
Signed-off-by: Mike Beattie <mike@ethernal.org>
altosdroid/res/layout/altosdroid.xml
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java

index f185ea9f2144c0ce8402062a74b96aa284118bbe..691c5e0467f5c4a659b2ee420083c0f81a979b99 100644 (file)
         </RelativeLayout>
 
 
-        <TextView
-               android:id="@+id/text"
-               android:layout_width="fill_parent"
-               android:layout_height="0dip"
-               android:layout_alignParentBottom="true"
-               android:layout_below="@+id/longitude_container"
-               android:gravity="bottom"
-               android:scrollbars="vertical"
-               android:textSize="7dp"
-               android:typeface="monospace" />
+        <RelativeLayout
+            android:id="@+id/text_container"
+            android:layout_width="wrap_content"
+            android:layout_height="fill_parent"
+            android:layout_below="@id/longitude_container" >
+
+               <TextView
+                   android:id="@+id/text"
+                   android:layout_width="fill_parent"
+                   android:layout_height="fill_parent"
+                   android:layout_above="@+id/version"
+                   android:scrollbars="vertical"
+                   android:textSize="7dp"
+                   android:typeface="monospace" />
+        
+            <TextView
+                android:id="@+id/version"
+                android:layout_width="fill_parent"
+                android:layout_height="10dip"
+                android:layout_alignParentBottom="true"
+                android:gravity="bottom|right"
+                android:textSize="7dp"
+                android:typeface="monospace" />
+
+        </RelativeLayout>
 
     </RelativeLayout>
index b1fc8d30fd091d124c52619f2c930e763235e843..ab1fb0dee09f837cf56df1b4ddb00efc8c550337 100644 (file)
@@ -81,6 +81,7 @@ public class AltosDroid extends Activity {
 
        // Generic field for extras at the bottom
        private TextView mTextView;
+       private TextView mVersion;
 
        // Service
        private boolean mIsBound   = false;
@@ -249,6 +250,11 @@ public class AltosDroid extends Activity {
                mTextView.setClickable(false);
                mTextView.setLongClickable(false);
 
+               mVersion = (TextView) findViewById(R.id.version);
+               mVersion.setText("Version: " + BuildInfo.version +
+                                "  Built: " + BuildInfo.builddate + " " + BuildInfo.buildtime + " " + BuildInfo.buildtz +
+                                "  (" + BuildInfo.branch + "-" + BuildInfo.commitnum + "-" + BuildInfo.commithash + ")");
+
                mCallsignView  = (TextView) findViewById(R.id.callsign_value);
                mRSSIView      = (TextView) findViewById(R.id.rssi_value);
                mSerialView    = (TextView) findViewById(R.id.serial_value);