mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[android] Use FAB instead save button at the top
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
jeanbaptisteC
parent
cc8f45bac9
commit
d1643d695e
@@ -6,9 +6,6 @@ import android.text.InputFilter;
|
||||
import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -20,6 +17,7 @@ import app.organicmaps.sdk.bookmarks.data.BookmarkManager;
|
||||
import app.organicmaps.util.InputUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import java.util.Objects;
|
||||
@@ -39,6 +37,8 @@ public class BookmarkCategorySettingsFragment extends BaseMwmToolbarFragment
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private TextInputEditText mEditCategoryNameView;
|
||||
@NonNull
|
||||
private ShapeableImageView mSaveView;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState)
|
||||
@@ -85,23 +85,8 @@ public class BookmarkCategorySettingsFragment extends BaseMwmToolbarFragment
|
||||
});
|
||||
mEditDescView = root.findViewById(R.id.edit_description);
|
||||
mEditDescView.setText(mCategory.getDescription());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, MenuInflater inflater)
|
||||
{
|
||||
inflater.inflate(R.menu.menu_done, menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item)
|
||||
{
|
||||
if (item.getItemId() == R.id.done)
|
||||
{
|
||||
onEditDoneClicked();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
mSaveView = root.findViewById(R.id.done);
|
||||
mSaveView.setOnClickListener(v -> onEditDoneClicked());
|
||||
}
|
||||
|
||||
private void onEditDoneClicked()
|
||||
|
||||
@@ -11,7 +11,14 @@
|
||||
style="@style/MwmWidget.ToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme"/>
|
||||
android:theme="@style/MwmWidget.ToolbarTheme">
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:layout_width="?actionBarSize"
|
||||
android:layout_height="?actionBarSize"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
app:srcCompat="@drawable/ic_done"/>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:scrollbars="none"
|
||||
android:fillViewport="true"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
@@ -12,42 +12,36 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:theme="@style/MwmWidget.ToolbarTheme">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/margin_half">
|
||||
android:theme="@style/MwmWidget.ToolbarTheme"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/editor_add_select_location"
|
||||
android:textAppearance="@style/MwmTextAppearance.Toolbar.Title"/>
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
app:tint="@color/image_view"
|
||||
android:id="@+id/done"
|
||||
app:srcCompat="@drawable/ic_done"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:layout_gravity="end"
|
||||
android:scaleType="centerInside"
|
||||
android:contentDescription="@string/done" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
android:padding="@dimen/margin_half"
|
||||
android:text="@string/editor_add_select_location"
|
||||
android:textAppearance="@style/MwmTextAppearance.Toolbar.Title"/>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?panel"
|
||||
android:padding="@dimen/margin_base"
|
||||
android:text="@string/editor_focus_map_on_location"/>
|
||||
android:text="@string/editor_focus_map_on_location"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar_point_chooser" />
|
||||
|
||||
</LinearLayout>
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/done"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:contentDescription="@string/save"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/ic_done" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
app:showAsAction="always"
|
||||
android:id="@+id/done"
|
||||
android:title="@string/done"
|
||||
android:icon="@drawable/ic_done"/>
|
||||
</menu>
|
||||
Reference in New Issue
Block a user