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