forked from upstream-mirrors/OpenTracks
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:
@@ -57,7 +57,7 @@ limitations under the License.
|
|||||||
android:hint="@string/marker_edit_marker_type_hint"
|
android:hint="@string/marker_edit_marker_type_hint"
|
||||||
android:id="@+id/marker_edit_waypoint_marker_type"
|
android:id="@+id/marker_edit_waypoint_marker_type"
|
||||||
android:imeOptions="actionNext"
|
android:imeOptions="actionNext"
|
||||||
style="@style/EditCategoryMarker" />
|
style="@style/EditCategory" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/generic_description"
|
android:text="@string/generic_description"
|
||||||
style="@style/EditLabel.WithPaddingTop" />
|
style="@style/EditLabel.WithPaddingTop" />
|
||||||
|
|||||||
@@ -33,13 +33,14 @@ limitations under the License.
|
|||||||
android:imeOptions="actionNext"
|
android:imeOptions="actionNext"
|
||||||
style="@style/EditNameTrack" />
|
style="@style/EditNameTrack" />
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/track_edit_activity_type_label"
|
||||||
android:text="@string/track_edit_activity_type"
|
android:text="@string/track_edit_activity_type"
|
||||||
style="@style/EditLabel.WithPaddingTop" />
|
style="@style/EditLabel.WithIcon.WithPaddingTop" />
|
||||||
<AutoCompleteTextView
|
<AutoCompleteTextView
|
||||||
android:hint="@string/track_edit_activity_type_hint"
|
android:hint="@string/track_edit_activity_type_hint"
|
||||||
android:id="@+id/track_edit_activity_type"
|
android:id="@+id/track_edit_activity_type"
|
||||||
android:imeOptions="actionNext"
|
android:imeOptions="actionNext"
|
||||||
style="@style/EditCategoryTrack" />
|
style="@style/EditCategory" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/generic_description"
|
android:text="@string/generic_description"
|
||||||
style="@style/EditLabel.WithPaddingTop" />
|
style="@style/EditLabel.WithPaddingTop" />
|
||||||
|
|||||||
@@ -960,9 +960,9 @@ limitations under the License.
|
|||||||
Marker type: %1$s
|
Marker type: %1$s
|
||||||
</string>
|
</string>
|
||||||
<string name="marker_edit_marker_type"
|
<string name="marker_edit_marker_type"
|
||||||
translation_description="In the marker edit page, the label for the marker type, including some
|
translation_description="In the marker edit page, the label for the marker type, including an
|
||||||
examples.">
|
example.">
|
||||||
Marker type (e.g. building, waterfall...)
|
Marker type (e.g. waterfall)
|
||||||
</string>
|
</string>
|
||||||
<string name="marker_edit_marker_type_hint"
|
<string name="marker_edit_marker_type_hint"
|
||||||
translation_description="In the marker edit page, the hint in the marker type text field when it
|
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>
|
||||||
<string name="track_edit_activity_type"
|
<string name="track_edit_activity_type"
|
||||||
translation_description="In the page to edit a track, the label for the text field to edit the
|
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, including an example.">
|
||||||
Activity type (e.g. hiking, cycling...)
|
Activity type (e.g. hiking)
|
||||||
</string>
|
</string>
|
||||||
<string name="track_edit_activity_type_hint"
|
<string name="track_edit_activity_type_hint"
|
||||||
translation_description="In the page to edit a track, the hint in the 'Activity type' text field
|
translation_description="In the page to edit a track, the hint in the 'Activity type' text field
|
||||||
|
|||||||
@@ -44,14 +44,8 @@ limitations under the License.
|
|||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- The style for the editing marker category -->
|
<!-- The style for the editing category -->
|
||||||
<style name="EditCategoryMarker" parent="@style/TextMedium">
|
<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>
|
|
||||||
</style>
|
|
||||||
<!-- The style for the editing track category -->
|
|
||||||
<style name="EditCategoryTrack" parent="@style/TextMedium.WithIcon">
|
|
||||||
<item name="android:layout_width">fill_parent</item>
|
<item name="android:layout_width">fill_parent</item>
|
||||||
<item name="android:selectAllOnFocus">true</item>
|
<item name="android:selectAllOnFocus">true</item>
|
||||||
<item name="android:singleLine">true</item>
|
<item name="android:singleLine">true</item>
|
||||||
@@ -68,6 +62,14 @@ limitations under the License.
|
|||||||
<style name="EditLabel" parent="@style/TextMedium">
|
<style name="EditLabel" parent="@style/TextMedium">
|
||||||
<item name="android:layout_width">fill_parent</item>
|
<item name="android:layout_width">fill_parent</item>
|
||||||
</style>
|
</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 -->
|
<!-- The style for the edit lable with padding top -->
|
||||||
<style name="EditLabel.WithPaddingTop">
|
<style name="EditLabel.WithPaddingTop">
|
||||||
<item name="android:paddingTop">16dp</item>
|
<item name="android:paddingTop">16dp</item>
|
||||||
@@ -153,7 +155,6 @@ limitations under the License.
|
|||||||
<style name="TextLarge">
|
<style name="TextLarge">
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
<item name="android:textColor">?android:textColorPrimary</item>
|
|
||||||
<item name="android:textSize">22sp</item>
|
<item name="android:textSize">22sp</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- The style for large size text with top margin -->
|
<!-- The style for large size text with top margin -->
|
||||||
@@ -164,7 +165,6 @@ limitations under the License.
|
|||||||
<style name="TextMedium">
|
<style name="TextMedium">
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
<item name="android:textColor">?android:textColorPrimary</item>
|
|
||||||
<item name="android:textSize">18sp</item>
|
<item name="android:textSize">18sp</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- The style for medium size text with an icon on the left -->
|
<!-- The style for medium size text with an icon on the left -->
|
||||||
@@ -176,7 +176,6 @@ limitations under the License.
|
|||||||
<style name="TextSmall">
|
<style name="TextSmall">
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
<item name="android:textColor">?android:textColorSecondary</item>
|
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
</style>
|
</style>
|
||||||
<!-- Theme selector -->
|
<!-- Theme selector -->
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import android.widget.ArrayAdapter;
|
|||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An activity that let's the user see and edit the user editable track meta
|
* 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 Track track;
|
||||||
|
|
||||||
private EditText name;
|
private EditText name;
|
||||||
|
private TextView activityTypeLabel;
|
||||||
private AutoCompleteTextView activityType;
|
private AutoCompleteTextView activityType;
|
||||||
private EditText description;
|
private EditText description;
|
||||||
|
|
||||||
@@ -77,6 +79,8 @@ public class TrackEditActivity extends AbstractMyTracksActivity {
|
|||||||
|
|
||||||
activityType = (AutoCompleteTextView) findViewById(R.id.track_edit_activity_type);
|
activityType = (AutoCompleteTextView) findViewById(R.id.track_edit_activity_type);
|
||||||
activityType.setText(track.getCategory());
|
activityType.setText(track.getCategory());
|
||||||
|
|
||||||
|
activityTypeLabel = (TextView) findViewById(R.id.track_edit_activity_type_label);
|
||||||
setActivityTypeIcon(track.getIcon());
|
setActivityTypeIcon(track.getIcon());
|
||||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
|
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
|
||||||
this, R.array.activity_types, android.R.layout.simple_dropdown_item_1line);
|
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
|
* @param iconValue the icon value
|
||||||
*/
|
*/
|
||||||
private void setActivityTypeIcon(String iconValue) {
|
private void setActivityTypeIcon(String iconValue) {
|
||||||
activityType.setCompoundDrawablesWithIntrinsicBounds(
|
activityTypeLabel.setCompoundDrawablesWithIntrinsicBounds(
|
||||||
TrackIconUtils.getIconDrawable(iconValue), 0, 0, 0);
|
TrackIconUtils.getIconDrawable(iconValue), 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user