mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-19 17:33:51 +00:00
[android] Migrate NavMenu to Material components
Signed-off-by: jeanbaptisteC <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
Konstantin Pastbin
parent
008387b0cf
commit
c3d8f948ce
@@ -16,7 +16,6 @@ import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.annotation.AnyRes;
|
||||
@@ -208,13 +207,6 @@ public final class UiUtils
|
||||
windowManager.getDefaultDisplay().getRealMetrics(metrics);
|
||||
return metrics.heightPixels;
|
||||
}
|
||||
|
||||
public static void updateRedButton(Button button)
|
||||
{
|
||||
button.setTextColor(ThemeUtils.getColor(
|
||||
button.getContext(), button.isEnabled() ? R.attr.redButtonTextColor : R.attr.redButtonTextColorDisabled));
|
||||
}
|
||||
|
||||
public static void setInputError(@NonNull TextInputLayout layout, @StringRes int error)
|
||||
{
|
||||
setInputError(layout, error == 0 ? null : layout.getContext().getString(error));
|
||||
|
||||
@@ -3,8 +3,6 @@ package app.organicmaps.widget.menu;
|
||||
import android.location.Location;
|
||||
import android.util.Pair;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
@@ -17,6 +15,8 @@ import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
import java.time.LocalTime;
|
||||
@@ -29,7 +29,7 @@ public class NavMenu
|
||||
private final View mBottomSheetBackground;
|
||||
private final View mHeaderFrame;
|
||||
|
||||
private final ImageView mTts;
|
||||
private final ShapeableImageView mTts;
|
||||
private final View mSpeedViewContainer;
|
||||
private final MaterialTextView mSpeedValue;
|
||||
private final MaterialTextView mSpeedUnits;
|
||||
@@ -105,13 +105,12 @@ public class NavMenu
|
||||
mRouteProgress = bottomFrame.findViewById(R.id.navigation_progress);
|
||||
|
||||
// Bottom frame buttons
|
||||
ImageView mSettings = bottomFrame.findViewById(R.id.settings);
|
||||
ShapeableImageView mSettings = bottomFrame.findViewById(R.id.settings);
|
||||
mSettings.setOnClickListener(v -> onSettingsClicked());
|
||||
mTts = bottomFrame.findViewById(R.id.tts_volume);
|
||||
mTts.setOnClickListener(v -> onTtsClicked());
|
||||
Button stop = bottomFrame.findViewById(R.id.stop);
|
||||
MaterialButton stop = bottomFrame.findViewById(R.id.stop);
|
||||
stop.setOnClickListener(v -> onStopClicked());
|
||||
UiUtils.updateRedButton(stop);
|
||||
}
|
||||
|
||||
private void onStopClicked()
|
||||
|
||||
Reference in New Issue
Block a user