forked from upstream-mirrors/OpenTracks
Theming: move TrackEdit to material design text fields.
This commit is contained in:
@@ -32,12 +32,13 @@ import android.view.View;
|
|||||||
import android.widget.ArrayAdapter;
|
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.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -76,9 +77,9 @@ public class MarkerEditActivity extends AbstractActivity {
|
|||||||
private boolean hasCamera;
|
private boolean hasCamera;
|
||||||
|
|
||||||
// UI elements
|
// UI elements
|
||||||
private EditText waypointName;
|
private TextInputEditText waypointName;
|
||||||
private AutoCompleteTextView waypointMarkerType;
|
private AutoCompleteTextView waypointMarkerType;
|
||||||
private EditText waypointDescription;
|
private TextInputEditText waypointDescription;
|
||||||
private ImageView waypointPhoto;
|
private ImageView waypointPhoto;
|
||||||
private ImageView waypointDeletePhotoBtn;
|
private ImageView waypointDeletePhotoBtn;
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ import android.view.View;
|
|||||||
import android.widget.ArrayAdapter;
|
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.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.android.material.textfield.TextInputEditText;
|
||||||
|
|
||||||
import de.dennisguse.opentracks.content.data.Track;
|
import de.dennisguse.opentracks.content.data.Track;
|
||||||
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
import de.dennisguse.opentracks.content.provider.ContentProviderUtils;
|
||||||
import de.dennisguse.opentracks.fragments.ChooseActivityTypeDialogFragment;
|
import de.dennisguse.opentracks.fragments.ChooseActivityTypeDialogFragment;
|
||||||
@@ -55,10 +56,10 @@ public class TrackEditActivity extends AbstractActivity implements ChooseActivit
|
|||||||
private Track track;
|
private Track track;
|
||||||
private String iconValue;
|
private String iconValue;
|
||||||
|
|
||||||
private EditText nameEditText;
|
private TextInputEditText nameEditText;
|
||||||
private AutoCompleteTextView activityType;
|
private AutoCompleteTextView activityType;
|
||||||
private Spinner activityTypeIcon;
|
private Spinner activityTypeIcon;
|
||||||
private EditText description;
|
private TextInputEditText description;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle bundle) {
|
protected void onCreate(Bundle bundle) {
|
||||||
|
|||||||
@@ -28,45 +28,46 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
style="@style/EditLabel"
|
|
||||||
android:text="@string/generic_name" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:hint="@string/generic_name"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:importantForAutofill="no">
|
||||||
|
|
||||||
<EditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/marker_edit_waypoint_name"
|
|
||||||
style="@style/EditNameMarker"
|
|
||||||
android:drawableStart="@drawable/ic_marker_orange_pushpin_with_shadow"
|
android:drawableStart="@drawable/ic_marker_orange_pushpin_with_shadow"
|
||||||
android:hint="@string/generic_name"
|
android:id="@+id/marker_edit_waypoint_name"
|
||||||
android:imeOptions="actionNext"
|
android:layout_width="match_parent"
|
||||||
android:importantForAutofill="no" />
|
android:layout_height="wrap_content" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
style="@style/EditLabel.WithPaddingTop"
|
android:layout_width="match_parent"
|
||||||
android:text="@string/marker_edit_marker_type" />
|
android:layout_height="wrap_content"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:importantForAutofill="no">
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<AutoCompleteTextView
|
||||||
android:id="@+id/marker_edit_waypoint_marker_type"
|
android:id="@+id/marker_edit_waypoint_marker_type"
|
||||||
style="@style/EditCategory"
|
style="@style/EditCategory"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:hint="@string/marker_edit_marker_type_hint"
|
android:hint="@string/marker_edit_marker_type"
|
||||||
android:imeOptions="actionNext" />
|
android:imeOptions="actionNext" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
style="@style/EditLabel.WithPaddingTop"
|
android:layout_width="match_parent"
|
||||||
android:text="@string/generic_description" />
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/generic_description"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
|
android:importantForAutofill="no">
|
||||||
|
|
||||||
<EditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/marker_edit_waypoint_description"
|
android:id="@+id/marker_edit_waypoint_description"
|
||||||
style="@style/EditDescription"
|
android:layout_width="match_parent"
|
||||||
android:hint="@string/generic_description"
|
android:layout_height="wrap_content" />
|
||||||
android:imeOptions="actionDone"
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
android:importantForAutofill="no" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -28,32 +28,37 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="8dp">
|
android:padding="8dp">
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
style="@style/EditLabel"
|
android:layout_width="match_parent"
|
||||||
android:text="@string/generic_name" />
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/track_edit_name"
|
|
||||||
style="@style/EditNameTrack"
|
|
||||||
android:hint="@string/generic_name"
|
android:hint="@string/generic_name"
|
||||||
android:imeOptions="actionNext"
|
android:imeOptions="actionNext"
|
||||||
android:importantForAutofill="no" />
|
android:importantForAutofill="no">
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
style="@style/EditLabel.WithPaddingTop"
|
android:id="@+id/track_edit_name"
|
||||||
android:text="@string/track_edit_activity_type" />
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/track_edit_activity_type"
|
|
||||||
style="@style/EditCategory"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:hint="@string/track_edit_activity_type_hint"
|
android:layout_height="wrap_content"
|
||||||
android:imeOptions="actionNext" />
|
android:imeOptions="actionNext"
|
||||||
|
android:importantForAutofill="no">
|
||||||
|
|
||||||
|
<AutoCompleteTextView
|
||||||
|
android:id="@+id/track_edit_activity_type"
|
||||||
|
style="@style/EditCategory"
|
||||||
|
android:hint="@string/track_edit_activity_type_hint"
|
||||||
|
android:imeOptions="actionNext" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/track_edit_activity_type_icon"
|
android:id="@+id/track_edit_activity_type_icon"
|
||||||
@@ -62,16 +67,19 @@ limitations under the License.
|
|||||||
android:layout_gravity="bottom" />
|
android:layout_gravity="bottom" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
style="@style/EditLabel.WithPaddingTop"
|
android:layout_width="match_parent"
|
||||||
android:text="@string/generic_description" />
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/track_edit_description"
|
|
||||||
style="@style/EditDescription"
|
|
||||||
android:hint="@string/generic_description"
|
android:hint="@string/generic_description"
|
||||||
android:imeOptions="actionDone"
|
android:imeOptions="actionNext"
|
||||||
android:importantForAutofill="no" />
|
android:importantForAutofill="no">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/track_edit_description"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user