forked from upstream-mirrors/OpenTracks
Fix sensor state activity to support right-to-left.
- Need to generate the value as one string rather than always putting the unit on the right.
This commit is contained in:
@@ -14,139 +14,79 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent">
|
||||
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<ScrollView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent">
|
||||
|
||||
<LinearLayout
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TableLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1,4"
|
||||
android:layout_width="fill_parent">
|
||||
|
||||
<!-- Layout the sensor state on one line. -->
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:layout_span="5"
|
||||
android:text="@string/menu_sensor_state" />
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:background="@color/stat_label_background">
|
||||
<TextView
|
||||
android:id="@+id/sensor_state_register"
|
||||
android:layout_column="1"
|
||||
android:layout_span="5"
|
||||
style="@style/StatsRegister" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Layout the sensor data age on one line. -->
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:layout_span="5"
|
||||
android:text="@string/sensor_state_last_sensor_time" />
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:background="@color/stat_label_background">
|
||||
<TextView
|
||||
android:id="@+id/sensor_data_time_register"
|
||||
android:layout_column="1"
|
||||
android:layout_span="5"
|
||||
style="@style/StatsRegister" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Power meter -->
|
||||
<TableRow
|
||||
android:padding="1dip">
|
||||
<TextView
|
||||
android:layout_column="1"
|
||||
android:layout_span="3"
|
||||
android:text="@string/sensor_state_power" />
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:background="@color/stat_label_background">
|
||||
<TextView
|
||||
style="@style/StatsRegister.Big"
|
||||
android:id="@+id/power_state_register"
|
||||
android:layout_column="1"
|
||||
android:layout_span="4" />
|
||||
<TextView
|
||||
style="@style/StatsUnitSolo" />
|
||||
android:layout_column="5"
|
||||
android:text="@string/watts" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Cadence -->
|
||||
<TableRow
|
||||
android:padding="1dip">
|
||||
<TextView
|
||||
android:layout_column="1"
|
||||
android:layout_span="3"
|
||||
android:text="@string/sensor_state_cadence" />
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:background="@color/stat_label_background">
|
||||
<TextView
|
||||
style="@style/StatsRegister.Big"
|
||||
android:id="@+id/cadence_state_register"
|
||||
android:layout_column="4" />
|
||||
<TextView
|
||||
style="@style/StatsUnitSolo" />
|
||||
android:layout_column="2"
|
||||
android:text="@string/revolutions_per_minute" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Heart Rate -->
|
||||
<TableRow
|
||||
android:padding="1dip">
|
||||
<TextView
|
||||
android:layout_column="1"
|
||||
android:layout_span="3"
|
||||
android:text="@string/sensor_state_heart_rate" />
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:background="@color/stat_label_background">
|
||||
<TextView
|
||||
style="@style/StatsRegister.Big"
|
||||
android:id="@+id/heart_rate_register"
|
||||
android:layout_column="1"
|
||||
android:layout_span="4" />
|
||||
<TextView
|
||||
style="@style/StatsUnitSolo"
|
||||
android:layout_column="5"
|
||||
android:text="@string/unit_beat_per_minute" />
|
||||
</TableRow>
|
||||
|
||||
<!-- Battery Level -->
|
||||
<TableRow
|
||||
android:padding="1dip">
|
||||
<TextView
|
||||
android:layout_column="1"
|
||||
android:layout_span="3"
|
||||
android:text="@string/sensor_state_battery" />
|
||||
</TableRow>
|
||||
<TableRow
|
||||
android:background="@color/stat_label_background">
|
||||
<TextView
|
||||
style="@style/StatsRegister.Big"
|
||||
android:id="@+id/battery_level_register"
|
||||
android:layout_column="1"
|
||||
android:layout_span="4" />
|
||||
<TextView
|
||||
style="@style/StatsUnitSolo"
|
||||
android:layout_column="5"
|
||||
android:text="@string/unit_percent" />
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
<!-- Sensor state -->
|
||||
<TextView
|
||||
android:text="@string/menu_sensor_state"
|
||||
style="@style/SensorStateHeader"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sensor_state"
|
||||
style="@style/SensorStateValue"
|
||||
/>
|
||||
|
||||
<!-- Last sensor time -->
|
||||
<TextView
|
||||
android:text="@string/sensor_state_last_sensor_time"
|
||||
style="@style/SensorStateHeader"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sensor_state_last_sensor_time"
|
||||
style="@style/SensorStateValue"
|
||||
/>
|
||||
|
||||
<!-- Power -->
|
||||
<TextView
|
||||
android:text="@string/sensor_state_power"
|
||||
style="@style/SensorStateHeader"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sensor_state_power"
|
||||
style="@style/SensorStateValue"
|
||||
/>
|
||||
|
||||
<!-- Cadence -->
|
||||
<TextView
|
||||
android:text="@string/sensor_state_cadence"
|
||||
style="@style/SensorStateHeader"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sensor_state_cadence"
|
||||
style="@style/SensorStateValue"
|
||||
/>
|
||||
|
||||
<!-- Heart rate -->
|
||||
<TextView
|
||||
android:text="@string/sensor_state_heart_rate"
|
||||
style="@style/SensorStateHeader"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sensor_state_heart_rate"
|
||||
style="@style/SensorStateValue"
|
||||
/>
|
||||
|
||||
<!-- Battery level -->
|
||||
<TextView
|
||||
android:text="@string/sensor_state_battery"
|
||||
style="@style/SensorStateHeader"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/sensor_state_battery"
|
||||
style="@style/SensorStateValue"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -49,6 +49,5 @@ limitations under the License.
|
||||
<string name="track_action_end">com.google.android.apps.mytracks.END_CURRENT_TRACK</string>
|
||||
<string name="track_action_save">android.intent.action.SAVE</string>
|
||||
<string name="track_action_start">com.google.android.apps.mytracks.START_NEW_TRACK</string>
|
||||
<string name="unit_percent">%</string>
|
||||
<string name="value_unknown">-</string>
|
||||
</resources>
|
||||
|
||||
@@ -1239,6 +1239,14 @@ limitations under the License.
|
||||
Screenshot: sensor_state_none.png">
|
||||
Battery level
|
||||
</string>
|
||||
<string name="sensor_state_battery_value"
|
||||
translation_description="In the 'Sensor state' page, the value for the 'Battery level'. E.g,
|
||||
'Battery level: 50 %'.
|
||||
|
||||
%1$d: a number. E.g., '50'.
|
||||
%%: escape sequence for the '%' character.">
|
||||
%1$d %%
|
||||
</string>
|
||||
<string name="sensor_state_cadence"
|
||||
translation_description="In the 'Sensor state' page, the label for the cadence on the bike
|
||||
sensor. Cadence is the number of revolutions of the crank per minute. E.g.,
|
||||
@@ -1247,6 +1255,13 @@ limitations under the License.
|
||||
Screenshot: sensor_state_none.png">
|
||||
Cadence
|
||||
</string>
|
||||
<string name="sensor_state_cadence_value"
|
||||
translation_description="In the 'Sensor state' page, the value for the 'Cadence'. Cadence is the
|
||||
number of revolutions of the crank per minute. E.g., 'Cadence: 80 rpm'.
|
||||
|
||||
%1$d: a number. E.g., '80'.">
|
||||
%1$d rpm
|
||||
</string>
|
||||
<string name="sensor_state_connected"
|
||||
translation_description="In the 'Sensor state' page, the 'Sensor state' value when the sensor
|
||||
has connected.
|
||||
@@ -1275,6 +1290,13 @@ limitations under the License.
|
||||
Screenshot: sensor_state_none.png">
|
||||
Heart rate
|
||||
</string>
|
||||
<string name="sensor_state_heart_rate_value"
|
||||
translation_description="In the 'Sensor state' page, the value for the 'Heart rate'. E.g.,
|
||||
'Hear rate: 100 bpm'.
|
||||
|
||||
%1$d: a number. E.g., '100'.">
|
||||
%1$d bpm
|
||||
</string>
|
||||
<string name="sensor_state_last_sensor_time"
|
||||
translation_description="In the 'Sensor state' page, the label for the last time the sensor has
|
||||
sent a data. E.g., 'Last sensor time: 10:05 am'.
|
||||
@@ -1289,6 +1311,13 @@ limitations under the License.
|
||||
Screenshot: sensor_state_none.png">
|
||||
Power
|
||||
</string>
|
||||
<string name="sensor_state_power_value"
|
||||
translation_description="In the 'Sensor state' page, the value for the 'Power'. Power is the
|
||||
power output of the rider. E.g., 'Power: 50 W'.
|
||||
|
||||
%1$d: a number. E.g., '50'.">
|
||||
%1$d W
|
||||
</string>
|
||||
<string name="sensor_state_sending"
|
||||
translation_description="In the 'Sensor state' page, the 'Sensor state' value when the sensor is
|
||||
sending data.
|
||||
@@ -2320,11 +2349,6 @@ limitations under the License.
|
||||
</string>
|
||||
|
||||
<!-- Unit -->
|
||||
<string name="unit_beat_per_minute"
|
||||
translation_description="Abbreviation for beats per minute, unit for heart rate. E.g.,
|
||||
'Heart rate: 80 bpm'.">
|
||||
bpm
|
||||
</string>
|
||||
<string name="unit_feet"
|
||||
translation_description="Abbreviation for feet. E.g., '2 ft'.">
|
||||
ft
|
||||
@@ -2365,15 +2389,6 @@ limitations under the License.
|
||||
translation_description="Abbreviation for minutes per mile. E.g, '5 min/mi'.">
|
||||
min/mi
|
||||
</string>
|
||||
<string name="unit_revolution_per_minute"
|
||||
translation_description="Abbreviation for revolutions per minute, unit for cadence. E.g.,
|
||||
'Cadence: 80 rpm'.">
|
||||
rpm
|
||||
</string>
|
||||
<string name="unit_watt"
|
||||
translation_description="Abbreviation for watts, unit for power. E.g., 'Power: 80 W'.">
|
||||
W
|
||||
</string>
|
||||
|
||||
<!-- Value -->
|
||||
<string name="value_adapt_accuracy"
|
||||
|
||||
@@ -71,6 +71,24 @@ limitations under the License.
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
|
||||
<style name="SensorStateHeader">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:paddingLeft">4dp</item>
|
||||
<item name="android:paddingRight">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SensorStateValue">
|
||||
<item name="android:background">@color/stat_label_background</item>
|
||||
<item name="android:gravity">right</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:paddingLeft">4dp</item>
|
||||
<item name="android:paddingRight">4dp</item>
|
||||
<item name="android:textColor">@color/stat_label_text</item>
|
||||
<item name="android:textSize">40sp</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for a view which divides the numerator and denominator of the units on the statistics activity. -->
|
||||
<style name="StatsDivider" parent="@android:Widget.TextView">
|
||||
<item name="android:background">@color/black</item>
|
||||
|
||||
Reference in New Issue
Block a user