Material 3 Migration (#26)

This commit is contained in:
Jean-Baptiste 2024-03-29 18:06:38 +01:00 committed by jacques
parent 7d41b75cd3
commit 5be59a8308
30 changed files with 212 additions and 196 deletions

View file

@ -6,12 +6,12 @@ import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import net.foucry.pilldroid.dao.PrescriptionsDAO;
import net.foucry.pilldroid.databases.PrescriptionDatabase;
import net.foucry.pilldroid.models.Prescription;
@ -46,7 +46,7 @@ public class DrugDetailActivity extends AppCompatActivity {
setSupportActionBar(toolbar);
}
ImageButton fab = findViewById(R.id.fab);
FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(v -> {
Log.d(TAG, "Click on save icon");

View file

@ -5,10 +5,11 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textview.MaterialTextView;
import net.foucry.pilldroid.models.Prescription;
/**
@ -72,34 +73,34 @@ public class DrugDetailFragment extends Fragment {
if (prescription != null) {
// Find each component of rootView
nameView = detailView.findViewById(R.id.name_cell);
TextView nameLabel = nameView.findViewById(R.id.label);
TextView nameValue = nameView.findViewById(R.id.value);
MaterialTextView nameLabel = nameView.findViewById(R.id.label);
MaterialTextView nameValue = nameView.findViewById(R.id.value);
nameLabel.setText(R.string.drug_name_label);
nameValue.setText(prescription.getName());
presentationView = detailView.findViewById(R.id.presentation_cell);
TextView presentationLabel = presentationView.findViewById(R.id.label);
TextView presentationValue = presentationView.findViewById(R.id.value);
MaterialTextView presentationLabel = presentationView.findViewById(R.id.label);
MaterialTextView presentationValue = presentationView.findViewById(R.id.value);
presentationLabel.setText(R.string.drug_presentation_label);
presentationValue.setText(prescription.getPresentation());
adminModeView = detailView.findViewById(R.id.administration_cell);
TextView adminModeLabel = adminModeView.findViewById(R.id.label);
TextView adminModeValue = adminModeView.findViewById(R.id.value);
MaterialTextView adminModeLabel = adminModeView.findViewById(R.id.label);
MaterialTextView adminModeValue = adminModeView.findViewById(R.id.value);
adminModeLabel.setText(R.string.drug_administrationMode_label);
adminModeValue.setText(prescription.getAdministration_mode());
stockView = detailView.findViewById(R.id.stock_cell);
TextView stockLibelle = (stockView.findViewById(R.id.label));
TextView stockValue = stockView.findViewById(R.id.value);
MaterialTextView stockLibelle = (stockView.findViewById(R.id.label));
TextInputEditText stockValue = stockView.findViewById(R.id.value);
stockLibelle.setText(R.string.drug_current_stock_label);
stockValue.setText(Utils.fmt(prescription.getStock()));
stockValue.setHint(R.string.drug_current_stock_label);
stockValue.setSelectAllOnFocus(true);
takeView = detailView.findViewById(R.id.take_cell);
TextView takeLabel = takeView.findViewById(R.id.label);
TextView takeValue = (takeView.findViewById(R.id.value));
MaterialTextView takeLabel = takeView.findViewById(R.id.label);
TextInputEditText takeValue = (takeView.findViewById(R.id.value));
takeLabel.setText(R.string.drug_take_label);
//takeValue.setText(Double.toString(prescription.getTake()));
takeValue.setText(Utils.fmt(prescription.getTake()));
@ -107,8 +108,8 @@ public class DrugDetailFragment extends Fragment {
takeValue.setSelectAllOnFocus(true);
warningView = detailView.findViewById(R.id.warning_cell);
TextView warningLibelle = warningView.findViewById(R.id.label);
TextView warningValue = warningView.findViewById(R.id.value);
MaterialTextView warningLibelle = warningView.findViewById(R.id.label);
TextInputEditText warningValue = warningView.findViewById(R.id.value);
warningLibelle.setText(R.string.drug_warningThreshold_label);
//warningValue.setText(Integer.toString(prescription.getWarnThreshold()));
warningValue.setText(Utils.fmt(prescription.getWarning()));
@ -116,8 +117,8 @@ public class DrugDetailFragment extends Fragment {
warningValue.setSelectAllOnFocus(true);
alertView = detailView.findViewById(R.id.alert_cell);
TextView alertLibelle = alertView.findViewById(R.id.label);
TextView alertValue = alertView.findViewById(R.id.value);
MaterialTextView alertLibelle = alertView.findViewById(R.id.label);
TextInputEditText alertValue = alertView.findViewById(R.id.value);
alertLibelle.setText(R.string.drug_alertThreshold_label);
//alertValue.setText(Integer.toString(prescription.getAlertThreshold()));
alertValue.setText(Utils.fmt(prescription.getAlert()));

View file

@ -378,21 +378,16 @@ public class DrugListActivity extends AppCompatActivity {
}
}
});
ok.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dialog.cancel();
Log.i("EditText Value",editText.getEditableText().toString());
MedicinesDAO medicinesDAO = medicines.getMedicinesDAO();
Medicine aMedicine = medicinesDAO.getMedicineByCIP13(cip13);
askToAddInDB(aMedicine);
}
ok.setOnClickListener(v -> {
dialog.cancel();
Log.i("EditText Value",editText.getEditableText().toString());
MedicinesDAO medicinesDAO = medicines.getMedicinesDAO();
Medicine aMedicine = medicinesDAO.getMedicineByCIP13(cip13);
askToAddInDB(aMedicine);
});
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.cancel();
Log.i(TAG, "dismiss dialog");
}
cancel.setOnClickListener(v -> {
dialog.cancel();
Log.i(TAG, "dismiss dialog");
});
dialog.show();
@ -426,27 +421,21 @@ public class DrugListActivity extends AppCompatActivity {
cpl.setEnabled(false);
}
icon.setImageResource(R.drawable.tickmark);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
addDrugToList(Utils.medicine2prescription(aMedicine));
}
btn.setOnClickListener(v -> {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
addDrugToList(Utils.medicine2prescription(aMedicine));
});
} else {
msgString = getString(R.string.msgNotFound);
msg.setText(msgString);
cpl.setText("");
icon.setImageResource(R.drawable.tickcross);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
}
btn.setOnClickListener(v -> {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
});
}
dlg.show();
@ -524,13 +513,10 @@ public class DrugListActivity extends AppCompatActivity {
}
Snackbar.make(recyclerView, prescription.getName(),
Snackbar.LENGTH_LONG).setAction(R.string.Undo, new View.OnClickListener() {
@Override
public void onClick(View v) {
prescriptionList.add(position, prescription);
mAdapter.notifyItemInserted(position);
}
}).show();
Snackbar.LENGTH_LONG).setAction(R.string.Undo, v -> {
prescriptionList.add(position, prescription);
mAdapter.notifyItemInserted(position);
}).show();
}
@Override
@ -657,17 +643,14 @@ public class DrugListActivity extends AppCompatActivity {
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
holder.mIconView.setImageResource(R.drawable.ic_suspended_pill);
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Prescription aPrescription = mValues.get(position);
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("prescription", aPrescription);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
holder.mView.setOnClickListener(v -> {
Prescription aPrescription = mValues.get(position);
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("prescription", aPrescription);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
});
} else {
int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getTake());
@ -683,16 +666,13 @@ public class DrugListActivity extends AppCompatActivity {
holder.mIconView.setImageResource(R.drawable.ok_stock_vect);
}
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Prescription prescription = mValues.get(position);
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("prescription", prescription);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
holder.mView.setOnClickListener(v -> {
Prescription prescription = mValues.get(position);
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("prescription", prescription);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
});
}
}

View file

@ -13,23 +13,23 @@ import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
public class WelcomeActivity extends AppCompatActivity {
private ViewPager viewPager;
private LinearLayout dotsLayout;
private int[] layouts;
private Button btnSkip, btnNext;
private MaterialButton btnSkip, btnNext;
// viewpager change listener
final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
@ -141,12 +141,12 @@ public class WelcomeActivity extends AppCompatActivity {
dlg.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dlg.setContentView(R.layout.custom_dialog_layout_one_button);
dlg.setCancelable(false);
TextView msg = dlg.findViewById(R.id.msg);
MaterialTextView msg = dlg.findViewById(R.id.msg);
String msgString;
TextView cpl = dlg.findViewById(R.id.cpl);
MaterialTextView cpl = dlg.findViewById(R.id.cpl);
String cplString = "";
ImageView icon = dlg.findViewById(R.id.image);
Button btn = dlg.findViewById(R.id.txtClose);
ShapeableImageView icon = dlg.findViewById(R.id.image);
MaterialButton btn = dlg.findViewById(R.id.txtClose);
dlg.show();
msgString = getString(R.string.understood);
@ -164,11 +164,11 @@ public class WelcomeActivity extends AppCompatActivity {
}
private void addBottomDots(int currentPage) {
TextView[] dots = new TextView[layouts.length];
MaterialTextView[] dots = new MaterialTextView[layouts.length];
dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this);
dots[i] = new MaterialTextView(this);
dots[i].setText("");
dots[i].setTextSize(65);
dots[i].setTextColor(ContextCompat.getColor(this, R.color.dot_dark));

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M313,520L537,744L480,800L160,480L480,160L537,216L313,440L800,440L800,520L313,520Z"/>
</vector>

View file

@ -1,11 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical"
tools:ignore="Overdraw">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@android:color/white"
android:orientation="vertical"
tools:ignore="Overdraw">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_collapseMode="pin"
app:titleTextColor="@color/white"
app:title="@string/about"/>
<WebView
android:id="@+id/aboutHtml"

View file

@ -21,7 +21,7 @@
app:zxing_viewfinder_laser_visibility="true"
app:zxing_viewfinder_mask="@color/grey" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/zxing_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -4,7 +4,7 @@
android:layout_height="fill_parent"
android:orientation="vertical" >
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/custom_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

View file

@ -7,7 +7,7 @@
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
@ -23,7 +23,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image"
android:layout_width="61dp"
android:layout_height="61dp"
@ -33,7 +33,7 @@
android:background="@drawable/shadow_bg"
tools:ignore="ContentDescription"/>
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -46,7 +46,7 @@
android:textSize="15dp"
tools:ignore="HardcodedText,RtlHardcoded,SpUsage"/>
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@id/cpl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -60,7 +60,7 @@
tools:ignore="HardcodedText,RtlHardcoded,SpUsage" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/txtClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -81,7 +81,7 @@
android:textSize="16sp"
tools:ignore="HardcodedText,RtlHardcoded,SpUsage" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -7,7 +7,7 @@
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<androidx.cardview.widget.CardView
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
@ -23,7 +23,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_gravity="center"
@ -31,7 +31,7 @@
android:background="@drawable/shadow_bg"
android:src="@drawable/ic_launcher_foreground" />
<TextView
<com.google.android.material.card.MaterialCardView
android:id="@id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -45,7 +45,7 @@
android:labelFor="@+id/msg"
tools:ignore="HardcodedText,RtlHardcoded,SpUsage" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@id/cpl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -64,7 +64,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/agreed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -81,7 +81,7 @@
android:layout_width="155dp"
android:layout_height="wrap_content" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/notagreed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -94,5 +94,5 @@
android:textColor="#212121"
android:textSize="16sp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -51,5 +51,6 @@
android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/save_button"
app:srcCompat="@drawable/ic_save_black_24dp"
app:backgroundTint="@color/colorPrimary" />
app:backgroundTint="@color/colorPrimary"
app:tint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -44,8 +44,8 @@
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:accessibilityHeading="true"
android:backgroundTint="@color/colorPrimary"
android:contentDescription="@string/add_button"
android:src="@drawable/ic_add"
app:backgroundTint="@color/colorPrimary" />
app:backgroundTint="@color/colorPrimary"
app:tint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -9,7 +9,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/list_image"
android:layout_width="50sp"
android:layout_height="50sp"
@ -19,7 +19,7 @@
android:contentDescription="@string/stockIcon"
android:src="@drawable/ok_stock_vect" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -32,7 +32,7 @@
android:textStyle="bold"
android:typeface="sans" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/endOfStock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -52,7 +52,7 @@
<!-- dateEndOfStock -->
<!-- Rightend Arrow -->
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"

View file

@ -2,10 +2,10 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector"
android:background="@color/white"
android:orientation="vertical">
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -17,7 +17,7 @@
android:textSize="16sp"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -30,5 +30,10 @@
android:text="@string/label"
android:textColor="#0c4758"
android:textStyle="italic" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
android:layout_below="@id/label"/>
</RelativeLayout>

View file

@ -18,7 +18,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/notagreed"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
@ -46,7 +46,7 @@
app:layout_constraintEnd_toStartOf="@+id/agreed"
app:layout_constraintStart_toEndOf="@+id/notagreed" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/agreed"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
@ -84,7 +84,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.416" />
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/imageView"
android:layout_width="60dp"
android:layout_height="60dp"
@ -97,7 +97,7 @@
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_launcher_foreground" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/textView4"
android:layout_width="55dp"
android:layout_height="33dp"

View file

@ -1,45 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector"
android:orientation="horizontal"
android:padding="10dp"
android:weightSum="1">
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="10dp"
android:weightSum="1">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/inputLayout"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@id/inputLayout"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingEnd="25dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#040404"
android:textStyle="bold" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/inputLayout"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/value"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@id/value"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingEnd="25dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#040404"
android:textStyle="bold" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:gravity="end|fill_vertical"
<EditText
android:id="@+id/value"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:ems="10"
android:gravity="end|fill_vertical"
android:hint="@string/zero"
android:importantForAutofill="no"
android:inputType="numberDecimal"
android:labelFor="@id/value"
android:paddingStart="5dp"
android:paddingEnd="25dp"
android:textAlignment="gravity"
android:textColorHint="@color/grey"
tools:ignore="LabelFor" />
android:importantForAutofill="no"
android:inputType="numberDecimal"
android:labelFor="@id/value"
android:paddingStart="5dp"
android:paddingEnd="25dp"
android:textAlignment="gravity"
android:textColorHint="@color/grey"
tools:ignore="LabelFor" />
</com.google.android.material.textfield.TextInputLayout>
</RelativeLayout>

View file

@ -9,13 +9,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/slide1_Pilldroid"
@ -23,7 +23,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="58dp"
android:layout_marginTop="20dp"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/suspended_treatment_icon"
android:src="@drawable/ic_suspended_pill" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"
@ -24,7 +24,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/save_icon"
android:src="@drawable/ic_save_black_24dp" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"
@ -24,7 +24,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"
@ -24,7 +24,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="350dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/the_plus_icon"
android:src="@drawable/ic_add_circle_black_24dp" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"
@ -24,7 +24,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/barcode_icon"
android:src="@drawable/ic_barcode" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"
@ -24,7 +24,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="33dp"
android:layout_marginTop="20dp"

View file

@ -6,13 +6,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/qr_code_icon"
android:src="@drawable/ic_qr_code" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/slide4_Pilldroid"
@ -20,7 +20,7 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginTop="20dp"

View file

@ -9,13 +9,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/happy_face"
android:src="@drawable/ok_stock_vect" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

@ -8,13 +8,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/neutral_face"
android:src="@drawable/warning_stock_vect" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

@ -6,13 +6,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
android:contentDescription="@string/unhappy_face"
android:src="@drawable/lower_stock_vect" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="349dp"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/screen_shot_height"
android:layout_height="@dimen/screen_shot_height"
android:contentDescription="@string/drug_info"
android:src="@drawable/info" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

@ -7,13 +7,13 @@
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/screen_shot_height"
android:layout_height="@dimen/screen_shot_height"
android:contentDescription="@string/tunable"
android:src="@drawable/tunable" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

@ -21,8 +21,9 @@
android:gravity="center"
android:orientation="horizontal"/>
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_next"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
@ -30,11 +31,11 @@
android:layout_marginBottom="@dimen/button_margin_bottom"
android:background="@null"
android:text="@string/next"
android:textColor="@android:color/white"
tools:ignore="RelativeOverlap,RtlSymmetry" />
android:textColor="@android:color/white" />
<Button
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_skip"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"

View file

@ -1,13 +1,14 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="backgroundTint">@color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="popupMenuBackground">@color/white</item>
</style>
<style name="AppTheme.NoActionBar">
@ -15,9 +16,9 @@
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.Material3.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.Material3.Light" />
<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<!--buttons color-->