Category reset button
This commit is contained in:
parent
0de02c6d44
commit
ce1b921447
@ -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);
|
||||||
|
5
app/src/main/res/drawable/ic_clear.xml
Normal file
5
app/src/main/res/drawable/ic_clear.xml
Normal 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>
|
@ -198,21 +198,34 @@
|
|||||||
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:background="@android:color/transparent"
|
android:layout_width="0dp"
|
||||||
android:drawableLeft="@drawable/ic_category_asc"
|
android:layout_height="wrap_content"
|
||||||
android:drawablePadding="5dp"
|
android:layout_weight="1"
|
||||||
android:drawableTint="@color/defaultBrand"
|
android:maxLines="1"
|
||||||
android:hint="@string/category"
|
android:background="@android:color/transparent"
|
||||||
android:completionThreshold="0"/>
|
android:drawableLeft="@drawable/ic_category_asc"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:drawableTint="@color/defaultBrand"
|
||||||
|
android:hint="@string/category"
|
||||||
|
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"
|
||||||
|
Loading…
Reference in New Issue
Block a user