This commit is contained in:
14Sandee
2023-11-22 20:40:26 +05:30
parent 4204e2ed54
commit 09a024ad59
13 changed files with 53 additions and 21 deletions

View File

@@ -77,7 +77,7 @@ public class FUAActivity extends AppCompatActivity {
all_apps_title = findViewById(R.id.all_app_tile);
fua_sub_title = findViewById(R.id.fua_sub_title);
if (AppUtil.shouldShowFUADialog(this)){
if (AppUtil.shouldShowFUADialog(this) && isFromDashboard){
FuaEduDialogBinding dialogBinding = FuaEduDialogBinding.inflate(getLayoutInflater());
Dialog fuaDialog = new Dialog(this, R.style.BottomSheetDialog);
fuaDialog.setContentView(dialogBinding.getRoot());

View File

@@ -323,13 +323,13 @@ public class BottomNotificationActivity extends AppCompatActivity {
String refill_description = null;
title = "Medicines refill";
title = "Refill medication";
try {
ReminderResult reminder = (ReminderResult) intent.getSerializableExtra(REMINDER_EXTRA_KEY);
if (reminder != null) {
body = reminder.medicine_name + " (" + reminder.dosage + " " + reminder.dosage_unit + ")";
body = reminder.medicine_name;
if (reminder.medication_instruction == null) reminder.medication_instruction = "None";
refill_description = "Quantity to be refilled: " + reminder.medication_quantity;

View File

@@ -1,9 +1,12 @@
package com.app.simplitend.welcome.welcomepatient.fragments;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -29,7 +32,7 @@ public class WelcomeFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = WelcomeFragmentBinding.inflate(inflater, container, false);
initViews(savedInstanceState);
setUpDynamicTextSizes();
clickEvents();
@@ -43,9 +46,28 @@ public class WelcomeFragment extends Fragment {
.popBackStack(R.id.welcomeFragment, false);
}
// Initialize views
private void initViews(Bundle savedInstanceState) {
WelcomeViewModel wv = new ViewModelProvider(requireActivity()).get(WelcomeViewModel.class);
private void setUpDynamicTextSizes() {
// Calculate screen dimensions in pixels
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
int screenWidth = displayMetrics.widthPixels;
int screenHeight = displayMetrics.heightPixels;
// Calculate aspect ratio
float aspectRatio = (float) screenHeight / (float) screenWidth;
if (aspectRatio > 2.1){
// screen is taller
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.welcome_title_tall));
binding.subTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.welcome_sub_title_tall));
}else if (aspectRatio > 2){
// screen is normal size
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.welcome_title_tall_medium));
binding.subTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.welcome_sub_title_tall_medium));
}else {
// screen is smaller
binding.title.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.welcome_title_small));
binding.subTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.welcome_sub_title_small));
}
}
// Register click events

View File

@@ -12,7 +12,6 @@ import androidx.recyclerview.widget.RecyclerView;
import com.app.simplitend.R;
import com.app.simplitend.databinding.ContactViewHolderBinding;
import com.app.simplitend.welcome.welcomepatient.fragments.contacts.mvvm.Contact;
import com.bumptech.glide.Glide;
import java.util.ArrayList;