diff --git a/android/app/src/main/java/app/organicmaps/editor/FeatureCategoryAdapter.java b/android/app/src/main/java/app/organicmaps/editor/FeatureCategoryAdapter.java index ebcee31da..db0609728 100644 --- a/android/app/src/main/java/app/organicmaps/editor/FeatureCategoryAdapter.java +++ b/android/app/src/main/java/app/organicmaps/editor/FeatureCategoryAdapter.java @@ -1,16 +1,20 @@ package app.organicmaps.editor; +import android.content.res.ColorStateList; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import app.organicmaps.R; import app.organicmaps.sdk.editor.data.FeatureCategory; import app.organicmaps.sdk.util.StringUtils; import app.organicmaps.util.UiUtils; + +import com.google.android.material.button.MaterialButton; import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textview.MaterialTextView; @@ -119,7 +123,7 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter listener.onSendNoteClicked()); + final ColorStateList bgButtonColor = new ColorStateList( + new int[][]{ + new int[]{android.R.attr.state_enabled}, // enabled + new int[]{-android.R.attr.state_enabled} // disabled + }, + new int[]{ + ContextCompat.getColor( + mSendNoteButton.getContext(), R.color.base_accent), + ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_disabled) + }); + final ColorStateList textButtonColor = new ColorStateList( + new int[][]{ + new int[]{android.R.attr.state_enabled}, // enabled + new int[]{-android.R.attr.state_enabled} // disabled + }, + new int[]{ + ContextCompat.getColor( + mSendNoteButton.getContext(), + UiUtils.getStyledResourceId(mSendNoteButton.getContext(), android.R.attr.textColorPrimaryInverse)), + ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_text_disabled) + }); + mSendNoteButton.setBackgroundTintList(bgButtonColor); + mSendNoteButton.setTextColor(textButtonColor); mNoteEditText.addTextChangedListener(new StringUtils.SimpleTextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) diff --git a/android/app/src/main/res/layout/item_feature_category_footer.xml b/android/app/src/main/res/layout/item_feature_category_footer.xml index d57197db5..3ba0c67ff 100644 --- a/android/app/src/main/res/layout/item_feature_category_footer.xml +++ b/android/app/src/main/res/layout/item_feature_category_footer.xml @@ -51,9 +51,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:background="?accentButtonBackground" android:layout_marginTop="@dimen/margin_base" - android:enabled="true" + android:enabled="false" android:text="@string/editor_report_problem_send_button" - app:backgroundTint="@null"/> + android:textColor="?android:textColorPrimaryInverse" /> \ No newline at end of file