Category reset button

This commit is contained in:
Daniele Verducci (Slimpenguin) 2024-03-01 07:20:29 +01:00
parent 0de02c6d44
commit ce1b921447
3 changed files with 37 additions and 13 deletions

View File

@ -307,6 +307,12 @@ public class GeofavoriteDetailActivity extends NextcloudMapsStyledActivity imple
CategoriesAdapter categoriesAdapter = new CategoriesAdapter(binding.root.getContext()); CategoriesAdapter categoriesAdapter = new CategoriesAdapter(binding.root.getContext());
this.binding.categoryAt.setAdapter(categoriesAdapter); this.binding.categoryAt.setAdapter(categoriesAdapter);
this.binding.categoryAt.setText(Geofavorite.DEFAULT_CATEGORY); this.binding.categoryAt.setText(Geofavorite.DEFAULT_CATEGORY);
this.binding.categoryAtClear.setOnClickListener((v) -> {
if (this.binding.categoryAt.getText().toString().isEmpty())
this.binding.categoryAt.setText(Geofavorite.DEFAULT_CATEGORY);
else
this.binding.categoryAt.setText("");
});
// Set map properties // Set map properties
this.binding.map.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.NEVER); this.binding.map.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.NEVER);

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

View File

@ -198,15 +198,18 @@
android:drawableTint="@color/defaultBrand" android:drawableTint="@color/defaultBrand"
android:hint="@string/description"/> android:hint="@string/description"/>
<AutoCompleteTextView <LinearLayout
android:id="@+id/category_at"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:orientation="horizontal"
android:ems="10" android:layout_marginTop="20dp">
android:gravity="start|top"
android:inputType="textMultiLine" <AutoCompleteTextView
android:maxLines="10" android:id="@+id/category_at"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:drawableLeft="@drawable/ic_category_asc" android:drawableLeft="@drawable/ic_category_asc"
android:drawablePadding="5dp" android:drawablePadding="5dp"
@ -214,6 +217,16 @@
android:hint="@string/category" android:hint="@string/category"
android:completionThreshold="0"/> android:completionThreshold="0"/>
<ImageButton
android:id="@+id/category_at_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="3dp"
android:background="@color/transparent"
android:src="@drawable/ic_clear"/>
</LinearLayout>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"