In track edit, move the activity icon next to the activity lable so that

the icon shows on Gingerbread phones.
This commit is contained in:
Jimmy Shih
2012-06-22 11:04:15 -07:00
parent 2146bee57e
commit c8be5919fd
5 changed files with 24 additions and 20 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ limitations under the License.
android:hint="@string/marker_edit_marker_type_hint"
android:id="@+id/marker_edit_waypoint_marker_type"
android:imeOptions="actionNext"
style="@style/EditCategoryMarker" />
style="@style/EditCategory" />
<TextView
android:text="@string/generic_description"
style="@style/EditLabel.WithPaddingTop" />
+3 -2
View File
@@ -33,13 +33,14 @@ limitations under the License.
android:imeOptions="actionNext"
style="@style/EditNameTrack" />
<TextView
android:id="@+id/track_edit_activity_type_label"
android:text="@string/track_edit_activity_type"
style="@style/EditLabel.WithPaddingTop" />
style="@style/EditLabel.WithIcon.WithPaddingTop" />
<AutoCompleteTextView
android:hint="@string/track_edit_activity_type_hint"
android:id="@+id/track_edit_activity_type"
android:imeOptions="actionNext"
style="@style/EditCategoryTrack" />
style="@style/EditCategory" />
<TextView
android:text="@string/generic_description"
style="@style/EditLabel.WithPaddingTop" />
+5 -5
View File
@@ -960,9 +960,9 @@ limitations under the License.
Marker type: %1$s
</string>
<string name="marker_edit_marker_type"
translation_description="In the marker edit page, the label for the marker type, including some
examples.">
Marker type (e.g. building, waterfall...)
translation_description="In the marker edit page, the label for the marker type, including an
example.">
Marker type (e.g. waterfall)
</string>
<string name="marker_edit_marker_type_hint"
translation_description="In the marker edit page, the hint in the marker type text field when it
@@ -2209,8 +2209,8 @@ limitations under the License.
</string>
<string name="track_edit_activity_type"
translation_description="In the page to edit a track, the label for the text field to edit the
activity type, including some examples of activity types.">
Activity type (e.g. hiking, cycling...)
activity type, including an example.">
Activity type (e.g. hiking)
</string>
<string name="track_edit_activity_type_hint"
translation_description="In the page to edit a track, the hint in the 'Activity type' text field
+10 -11
View File
@@ -44,14 +44,8 @@ limitations under the License.
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
</style>
<!-- The style for the editing marker category -->
<style name="EditCategoryMarker" parent="@style/TextMedium">
<item name="android:layout_width">fill_parent</item>
<item name="android:selectAllOnFocus">true</item>
<item name="android:singleLine">true</item>
</style>
<!-- The style for the editing track category -->
<style name="EditCategoryTrack" parent="@style/TextMedium.WithIcon">
<!-- The style for the editing category -->
<style name="EditCategory" parent="@style/TextMedium">
<item name="android:layout_width">fill_parent</item>
<item name="android:selectAllOnFocus">true</item>
<item name="android:singleLine">true</item>
@@ -68,6 +62,14 @@ limitations under the License.
<style name="EditLabel" parent="@style/TextMedium">
<item name="android:layout_width">fill_parent</item>
</style>
<!-- The style for the edit label with icon -->
<style name="EditLabel.WithIcon" parent="@style/TextMedium.WithIcon">
<item name="android:layout_width">fill_parent</item>
</style>
<!-- The style for the edit label with icon and with padding top -->
<style name="EditLabel.WithIcon.WithPaddingTop">
<item name="android:paddingTop">16dp</item>
</style>
<!-- The style for the edit lable with padding top -->
<style name="EditLabel.WithPaddingTop">
<item name="android:paddingTop">16dp</item>
@@ -153,7 +155,6 @@ limitations under the License.
<style name="TextLarge">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textSize">22sp</item>
</style>
<!-- The style for large size text with top margin -->
@@ -164,7 +165,6 @@ limitations under the License.
<style name="TextMedium">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textColor">?android:textColorPrimary</item>
<item name="android:textSize">18sp</item>
</style>
<!-- The style for medium size text with an icon on the left -->
@@ -176,7 +176,6 @@ limitations under the License.
<style name="TextSmall">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:textColor">?android:textColorSecondary</item>
<item name="android:textSize">14sp</item>
</style>
<!-- Theme selector -->
@@ -30,6 +30,7 @@ import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
/**
* An activity that let's the user see and edit the user editable track meta
@@ -49,6 +50,7 @@ public class TrackEditActivity extends AbstractMyTracksActivity {
private Track track;
private EditText name;
private TextView activityTypeLabel;
private AutoCompleteTextView activityType;
private EditText description;
@@ -77,6 +79,8 @@ public class TrackEditActivity extends AbstractMyTracksActivity {
activityType = (AutoCompleteTextView) findViewById(R.id.track_edit_activity_type);
activityType.setText(track.getCategory());
activityTypeLabel = (TextView) findViewById(R.id.track_edit_activity_type_label);
setActivityTypeIcon(track.getIcon());
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
this, R.array.activity_types, android.R.layout.simple_dropdown_item_1line);
@@ -145,7 +149,7 @@ public class TrackEditActivity extends AbstractMyTracksActivity {
* @param iconValue the icon value
*/
private void setActivityTypeIcon(String iconValue) {
activityType.setCompoundDrawablesWithIntrinsicBounds(
activityTypeLabel.setCompoundDrawablesWithIntrinsicBounds(
TrackIconUtils.getIconDrawable(iconValue), 0, 0, 0);
}
}