mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-02 02:53:44 +00:00
[android] Migrate download screens to Material components
Signed-off-by: Jean-Baptiste Charron <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
committed by
Konstantin Pastbin
parent
3858b0905f
commit
deb663e4f9
@@ -1,8 +1,8 @@
|
||||
package app.organicmaps.downloader;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.util.StringUtils;
|
||||
@@ -14,7 +14,7 @@ class BottomPanel
|
||||
{
|
||||
private final DownloaderFragment mFragment;
|
||||
private final FloatingActionButton mFab;
|
||||
private final Button mButton;
|
||||
private final MaterialButton mButton;
|
||||
|
||||
private final View.OnClickListener mDownloadListener = new View.OnClickListener()
|
||||
{
|
||||
|
||||
@@ -6,13 +6,14 @@ import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.base.BaseMwmFragment;
|
||||
import app.organicmaps.base.BaseMwmFragmentActivity;
|
||||
@@ -30,10 +31,10 @@ public class CountrySuggestFragment extends BaseMwmFragment implements View.OnCl
|
||||
private LinearLayout mLlSelectDownload;
|
||||
private LinearLayout mLlActiveDownload;
|
||||
private WheelProgressView mWpvDownloadProgress;
|
||||
private TextView mTvCountry;
|
||||
private TextView mTvActiveCountry;
|
||||
private TextView mTvProgress;
|
||||
private Button mBtnDownloadMap;
|
||||
private MaterialTextView mTvCountry;
|
||||
private MaterialTextView mTvActiveCountry;
|
||||
private MaterialTextView mTvProgress;
|
||||
private MaterialButton mBtnDownloadMap;
|
||||
|
||||
private CountryItem mCurrentCountry;
|
||||
private CountryItem mDownloadingCountry;
|
||||
@@ -150,7 +151,7 @@ public class CountrySuggestFragment extends BaseMwmFragment implements View.OnCl
|
||||
mLlNoLocation = view.findViewById(R.id.ll__location_unknown);
|
||||
mBtnDownloadMap = view.findViewById(R.id.btn__download_map);
|
||||
mBtnDownloadMap.setOnClickListener(this);
|
||||
Button selectMap = view.findViewById(R.id.btn__select_map);
|
||||
MaterialButton selectMap = view.findViewById(R.id.btn__select_map);
|
||||
selectMap.setOnClickListener(this);
|
||||
mWpvDownloadProgress = view.findViewById(R.id.wpv__download_progress);
|
||||
mWpvDownloadProgress.setOnClickListener(this);
|
||||
|
||||
@@ -4,11 +4,13 @@ import android.location.Location;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.MwmActivity;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.location.LocationHelper;
|
||||
@@ -28,11 +30,11 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
||||
|
||||
private final MwmActivity mActivity;
|
||||
private final View mFrame;
|
||||
private final TextView mParent;
|
||||
private final TextView mTitle;
|
||||
private final TextView mSize;
|
||||
private final MaterialTextView mParent;
|
||||
private final MaterialTextView mTitle;
|
||||
private final MaterialTextView mSize;
|
||||
private final WheelProgressView mProgress;
|
||||
private final Button mButton;
|
||||
private final MaterialButton mButton;
|
||||
|
||||
private int mStorageSubscriptionSlot;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
android:clipChildren="false"
|
||||
android:gravity="center"
|
||||
tools:ignore="UselessParent">
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -35,7 +35,7 @@
|
||||
android:textAppearance="@style/MwmTextAppearance.Body2"
|
||||
android:gravity="center_horizontal"
|
||||
tools:text="Some country very loooooooooong country"/>
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -45,7 +45,7 @@
|
||||
android:gravity="center_horizontal"
|
||||
tools:text="Some name very loooooooooong name"
|
||||
tools:ignore="UnusedAttribute"/>
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -58,7 +58,7 @@
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="@dimen/downloader_status_size"
|
||||
android:clipChildren="false">
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/downloader_button"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_width="180dp"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:layout_height="match_parent">
|
||||
<include layout="@layout/toolbar_with_search"/>
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/action"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/height_block_base"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
wheel:layout_constraintEnd_toEndOf="parent"
|
||||
wheel:layout_constraintStart_toStartOf="parent"
|
||||
wheel:layout_constraintTop_toTopOf="parent">
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
@@ -33,7 +33,7 @@
|
||||
android:text="@string/search_without_internet_advertisement"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body2"/>
|
||||
|
||||
<ImageView
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/placeholder_size"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
@@ -47,7 +47,7 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/tv__country_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -58,7 +58,7 @@
|
||||
android:textAppearance="@style/MwmTextAppearance.Title"
|
||||
tools:text="Some country name"/>
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn__download_map"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
@@ -75,7 +75,7 @@
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/height_block_base"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
@@ -83,7 +83,7 @@
|
||||
android:text="@string/unknown_current_position"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"/>
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn__select_map"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_marginTop="@dimen/margin_half"
|
||||
@@ -103,13 +103,13 @@
|
||||
android:visibility="gone"
|
||||
wheel:layout_constraintBottom_toTopOf="@+id/ll__select_download"
|
||||
wheel:layout_constraintTop_toTopOf="parent">
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/tv__active_country_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/MwmTextAppearance.Title"/>
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
android:background="@drawable/onmap_downloader_background"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_parent"
|
||||
android:layout_width="@dimen/square_block_size"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -27,7 +27,7 @@
|
||||
android:textAppearance="@style/MwmTextAppearance.Body2"
|
||||
android:gravity="center_horizontal"
|
||||
tools:text="Some country very loooooooooong country"/>
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -38,7 +38,7 @@
|
||||
android:gravity="center_horizontal"
|
||||
tools:text="Some name very loooooooooong name"
|
||||
tools:ignore="UnusedAttribute"/>
|
||||
<TextView
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/downloader_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -51,7 +51,7 @@
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="48dp"
|
||||
android:clipChildren="false">
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/downloader_button"
|
||||
style="@style/MwmWidget.Button.Primary"
|
||||
android:layout_width="180dp"
|
||||
|
||||
Reference in New Issue
Block a user