.
This commit is contained in:
@@ -5,9 +5,8 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /><!-- permissions for app blocking -->
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" /> <!-- permissions for app blocking -->
|
||||
<uses-permission
|
||||
android:name="android.permission.PACKAGE_USAGE_STATS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
@@ -32,9 +31,13 @@
|
||||
android:theme="@style/Theme.SimpliTend"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".patient_dashboard.fragments.CallsActivity"
|
||||
android:name=".patient_dashboard.PatSettingsActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".patient_dashboard.fragments.CallsActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".patient_dashboard.DirectionToHomeActivity"
|
||||
android:exported="false"
|
||||
@@ -138,6 +141,7 @@
|
||||
android:name=".cg_subscription.CgSubscriptionActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait">
|
||||
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
@@ -145,7 +149,8 @@
|
||||
<activity android:name=".appblocking.FUAActivity" />
|
||||
<activity android:name=".appblocking.BlockApp" />
|
||||
|
||||
<meta-data android:name="com.onesignal.NotificationServiceExtension"
|
||||
<meta-data
|
||||
android:name="com.onesignal.NotificationServiceExtension"
|
||||
android:value="com.ssb.simplitend.apputils.NotificationService" />
|
||||
|
||||
<service
|
||||
@@ -161,7 +166,7 @@
|
||||
android:resource="@xml/accessibility_service_config" />
|
||||
</service>
|
||||
|
||||
<receiver android:name=".patientgeofencing.GeoFenceBroadcastReceiver"/>
|
||||
<receiver android:name=".patientgeofencing.GeoFenceBroadcastReceiver" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
||||
@@ -2,15 +2,19 @@ package com.ssb.simplitend.apputils;
|
||||
|
||||
import static com.ssb.simplitend.apputils.Constants.ACTIVITY_EXTRA_KEY;
|
||||
import static com.ssb.simplitend.apputils.Constants.REMINDER_EXTRA_KEY;
|
||||
import static com.ssb.simplitend.articles.ArticleShowerActivity.ARTICLE_TITLE;
|
||||
import static com.ssb.simplitend.articles.ArticleShowerActivity.ARTICLE_URL_KEY;
|
||||
import static com.ssb.simplitend.patientgeofencing.GeoFenceHelper.GEOFENCE_ID;
|
||||
import static com.ssb.simplitend.patientgeofencing.GeoFenceHelper.GEOFENCE_TAG;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
@@ -28,6 +32,7 @@ import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.appblocking.MySharedPref;
|
||||
import com.ssb.simplitend.articles.ArticleShowerActivity;
|
||||
import com.ssb.simplitend.databinding.BottomSheetAlertBinding;
|
||||
import com.ssb.simplitend.databinding.DecisionBottomsheetBinding;
|
||||
import com.ssb.simplitend.databinding.DoneBottomsheetBinding;
|
||||
@@ -223,6 +228,15 @@ public abstract class AppUtil {
|
||||
return returnString.toString();
|
||||
}
|
||||
|
||||
public static void callPhone(Activity activity, String phone_number){
|
||||
if (activity.checkSelfPermission(Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED){
|
||||
Intent intent = new Intent(Intent.ACTION_CALL, Uri.fromParts("tel",
|
||||
phone_number, null));
|
||||
activity.startActivity(intent);
|
||||
}else{
|
||||
dialPhone(activity, phone_number);
|
||||
}
|
||||
}
|
||||
|
||||
public static void dialPhone(Context activity, String phone_number) {
|
||||
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel",
|
||||
@@ -408,6 +422,18 @@ public abstract class AppUtil {
|
||||
binding.btn.setOnClickListener(btn_clickListener);
|
||||
}
|
||||
|
||||
public static void openLink(Activity activity,
|
||||
@NonNull String link, @NonNull String title){
|
||||
try {
|
||||
Intent intent = new Intent(activity, ArticleShowerActivity.class);
|
||||
intent.putExtra(ARTICLE_URL_KEY, link);
|
||||
intent.putExtra(ARTICLE_TITLE, title);
|
||||
activity.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ********************* USER DATA UTILS ******************************************
|
||||
|
||||
|
||||
@@ -64,6 +64,17 @@ public class CaregiverSettingsActivity extends AppCompatActivity implements CgHo
|
||||
Intent intent = new Intent(this, DeActivateAccountActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
binding.tNC.setOnClickListener(v -> {
|
||||
AppUtil.openLink(this, getString(R.string.terms_n_conditions_link),
|
||||
getString(R.string.terms_conditions_));
|
||||
});
|
||||
|
||||
binding.privacy.setOnClickListener(v -> {
|
||||
AppUtil.openLink(this, getString(R.string.privacy_policy_link),
|
||||
getString(R.string.privacy_policy));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,4 +25,7 @@ public interface AccountApiService {
|
||||
Call<CallResponse<Object>> contactAdmin(@PartMap Map<String, RequestBody> body,
|
||||
@Header("Authorization") String token);
|
||||
|
||||
@POST("api/logout")
|
||||
Call<CallResponse<Object>> signOut(@Header("Authorization") String token);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.ssb.simplitend.caregiverdashboard.activities.deactivateacc;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.ssb.simplitend.apputils.RetrofitHelper;
|
||||
import com.ssb.simplitend.caregiverdashboard.mvvm.CgHomeContracts;
|
||||
import com.ssb.simplitend.patient_dashboard.PatSettingsActivity;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.CallResponse;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -96,6 +98,29 @@ public class AccountPresenter {
|
||||
|
||||
}
|
||||
|
||||
public void signOut(String token, @NonNull CgHomeContracts.SignOutCallback signOutCallback) {
|
||||
apiService.signOut(token).enqueue(new Callback<CallResponse<Object>>() {
|
||||
@Override
|
||||
public void onResponse(Call<CallResponse<Object>> call, Response<CallResponse<Object>> response) {
|
||||
if (response.body() != null) {
|
||||
if (response.body().status != 200) {
|
||||
signOutCallback.onSignOutFailed(new Exception(), response.body().message);
|
||||
return;
|
||||
}
|
||||
|
||||
signOutCallback.onSignOutSuccess();
|
||||
} else {
|
||||
signOutCallback.onSignOutFailed(new Exception(), "Please try again later.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<CallResponse<Object>> call, Throwable t) {
|
||||
signOutCallback.onSignOutFailed(new Exception(), "Please try again later.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface AccountReDeActivateCallback{
|
||||
void onAccountDeReActivate();
|
||||
|
||||
|
||||
@@ -12,9 +12,11 @@ import android.widget.Toast;
|
||||
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.apputils.PatientDataCache;
|
||||
import com.ssb.simplitend.databinding.ActivityDeactivateAccBinding;
|
||||
import com.ssb.simplitend.welcome.activities.WelcomeActivity;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
|
||||
|
||||
public class DeActivateAccountActivity extends AppCompatActivity implements AccountPresenter.AccountReDeActivateCallback {
|
||||
|
||||
@@ -25,15 +27,28 @@ public class DeActivateAccountActivity extends AppCompatActivity implements Acco
|
||||
|
||||
private CareGiverData careGiverData;
|
||||
|
||||
private PatientData patientData;
|
||||
|
||||
private boolean isPatient;
|
||||
public static final String IS_PATIENT_KEY = "is_patient_key";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityDeactivateAccBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
}), true);
|
||||
isPatient = getIntent().getBooleanExtra(IS_PATIENT_KEY, false);
|
||||
|
||||
if (isPatient){
|
||||
PatientDataCache.getPatientData(this, (patientData1 -> {
|
||||
this.patientData = patientData1;
|
||||
}), true);
|
||||
}else {
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
}), true);
|
||||
}
|
||||
|
||||
accountPresenter = AccountPresenter.getAccountPresenter();
|
||||
progressDialog = new ProgressDialog(this);
|
||||
@@ -63,19 +78,41 @@ public class DeActivateAccountActivity extends AppCompatActivity implements Acco
|
||||
});
|
||||
|
||||
binding.confirmDeactivate.setOnClickListener(v -> {
|
||||
if (careGiverData == null){
|
||||
Toast.makeText(this, "Couldn't load data", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
|
||||
int id;
|
||||
String token;
|
||||
|
||||
if (isPatient){
|
||||
if (patientData == null){
|
||||
Toast.makeText(this, "Couldn't load data", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we de-activate your account");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
id = patientData.patientId;
|
||||
token = AppUtil.getPatientToken(this);
|
||||
}else{
|
||||
if (careGiverData == null){
|
||||
Toast.makeText(this, "Couldn't load data", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we de-activate your account");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
id = careGiverData.caregiver_xid;
|
||||
token = AppUtil.getCgToken(this);
|
||||
}
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we de-activate your account");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
accountPresenter.accountReDeActivate(AccountPresenter.ACC_DEACTIVATE_BY_USER,
|
||||
careGiverData.caregiver_xid,
|
||||
"Bearer " + AppUtil.getCgToken(this),
|
||||
id,
|
||||
"Bearer " + token,
|
||||
this);
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
@@ -16,9 +17,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.google.firebase.crashlytics.internal.common.CrashlyticsCore;
|
||||
import com.google.firebase.crashlytics.internal.model.CrashlyticsReport;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
@@ -32,6 +30,8 @@ import com.stripe.android.PaymentConfiguration;
|
||||
import com.stripe.android.paymentsheet.PaymentSheet;
|
||||
import com.stripe.android.paymentsheet.PaymentSheetResult;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -104,10 +104,12 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
contactMail();
|
||||
});
|
||||
|
||||
binding.retry.setOnClickListener(v -> loadPlans());
|
||||
|
||||
}
|
||||
|
||||
private void payForSubscription() {
|
||||
if (careGiverData == null) {
|
||||
if (careGiverData == null || subscriptionPlans == null) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
@@ -146,48 +148,36 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
// important part
|
||||
String plan_price;
|
||||
try {
|
||||
float plan_price_float = Float.parseFloat(plan.plan_value);
|
||||
plan_price_float *= 100; // converting from dollars to cents
|
||||
BigDecimal plan_price_d = new BigDecimal(plan.plan_value);
|
||||
plan_price = plan_price_d.multiply(new BigDecimal(100)).toBigInteger().toString(); // converting to cents
|
||||
|
||||
if (position == 1){
|
||||
// yearly plan
|
||||
// adding 25% off
|
||||
plan_price_float = plan_price_float * 0.75f;
|
||||
}
|
||||
RequestBody price_body = RequestBody.create(plan_price, MediaType.parse("text/plain"));
|
||||
body.put("price", price_body);
|
||||
|
||||
plan_price = "" + (int) plan_price_float; // converting to int to remove leading ".0"
|
||||
RequestBody subscription_xid_body = RequestBody.create(plan.id + "", MediaType.parse("text/plain"));
|
||||
body.put("subscription_xid", subscription_xid_body);
|
||||
|
||||
RequestBody caregiver_xid_body = RequestBody.create("" + careGiverData.caregiver_xid, MediaType.parse("text/plain"));
|
||||
body.put("caregiver_xid", caregiver_xid_body);
|
||||
|
||||
String token = "Bearer " + AppUtil.getCgToken(this);
|
||||
|
||||
this.stripe_price_id = plan.stripe_price_id;
|
||||
|
||||
presenter.getPaymentCred(token, body, this);
|
||||
} catch (Exception e) {
|
||||
plan_price = getString(R.string.default_price);
|
||||
progressDialog.dismiss();
|
||||
Toast.makeText(this, "Invalid price", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
RequestBody price_body = RequestBody.create(plan_price, MediaType.parse("text/plain"));
|
||||
body.put("price", price_body);
|
||||
|
||||
RequestBody subscription_xid_body = RequestBody.create(plan.id + "", MediaType.parse("text/plain"));
|
||||
body.put("subscription_xid", subscription_xid_body);
|
||||
|
||||
RequestBody caregiver_xid_body = RequestBody.create("" + careGiverData.caregiver_xid, MediaType.parse("text/plain"));
|
||||
body.put("caregiver_xid", caregiver_xid_body);
|
||||
|
||||
String token = "Bearer " + AppUtil.getCgToken(this);
|
||||
|
||||
this.stripe_price_id = plan.stripe_price_id;
|
||||
|
||||
presenter.getPaymentCred(token, body, this);
|
||||
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
// loading subscription plans
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we fetch subscription plans for you.");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
String token = "Bearer " + AppUtil.getCgToken(this);
|
||||
presenter.getSubscriptionPlans(token, this);
|
||||
loadPlans();
|
||||
|
||||
paymentSheet = new PaymentSheet(this, this::onPaymentSheetResult);
|
||||
|
||||
@@ -214,6 +204,20 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
private void loadPlans() {
|
||||
CaregiverDataCache.getCaregiverData(this, (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
|
||||
progressDialog.setTitle("Please wait....");
|
||||
progressDialog.setMessage("while we fetch subscription plans for you.");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
String token = "Bearer " + AppUtil.getCgToken(this);
|
||||
presenter.getSubscriptionPlans(token, this);
|
||||
}), true);
|
||||
}
|
||||
|
||||
private void contactMail() {
|
||||
String contact_email = getString(R.string.contact_email);
|
||||
|
||||
@@ -270,6 +274,56 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
|
||||
}
|
||||
|
||||
private void inflatePlans() {
|
||||
try {
|
||||
String monthly_price = null;
|
||||
String yearly_price = null;
|
||||
|
||||
for (SubscriptionPlan plan: subscriptionPlans){
|
||||
if (getString(R.string.monthly).equals(plan.plan_name)){
|
||||
// monthly
|
||||
binding.monthlyName.setText(plan.plan_name);
|
||||
monthly_price = plan.plan_value;
|
||||
}else if (getString(R.string.year).equals(plan.plan_name)){
|
||||
// yearly
|
||||
binding.yearlyName.setText(plan.plan_name);
|
||||
yearly_price = plan.plan_value;
|
||||
}
|
||||
}
|
||||
|
||||
if (monthly_price == null || yearly_price == null) throw new Exception();
|
||||
|
||||
binding.yearDiscountedPrice.setText(yearly_price);
|
||||
binding.monthlyPrice.setText(monthly_price);
|
||||
|
||||
BigDecimal TWELVE = new BigDecimal(12);
|
||||
|
||||
BigDecimal year_price_d = new BigDecimal(yearly_price);
|
||||
BigDecimal month_price_d = new BigDecimal(monthly_price);
|
||||
|
||||
BigDecimal actual_year_price = month_price_d.multiply(TWELVE);
|
||||
|
||||
String strike_actual_year_price = "<strike>$" + actual_year_price + "</strike>";
|
||||
binding.yearActualPrice.setText(Html.fromHtml(strike_actual_year_price));
|
||||
|
||||
String yearly_month_price = year_price_d.divide(TWELVE, RoundingMode.DOWN).toString();
|
||||
yearly_month_price = "$" + yearly_month_price;
|
||||
binding.yearlyMonthPrice.setText(yearly_month_price);
|
||||
|
||||
try {
|
||||
String discount = (actual_year_price.subtract(year_price_d)).divide(actual_year_price, RoundingMode.DOWN).multiply(new BigDecimal(100)).toBigInteger().toString() + "% OFF";
|
||||
binding.yearDiscount.setText(discount);
|
||||
} catch (Exception e) {
|
||||
binding.yearDiscount.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
binding.plansView.setVisibility(View.VISIBLE);
|
||||
|
||||
}catch (Exception e){
|
||||
binding.plansView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
// get payment credentials callback
|
||||
@Override
|
||||
public void onPaymentCredFetched(SubscriptionCredentials credentials) {
|
||||
@@ -311,13 +365,14 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
@Override
|
||||
public void onSubscriptionFetched(ArrayList<SubscriptionPlan> subscriptionPlans) {
|
||||
this.subscriptionPlans = subscriptionPlans;
|
||||
inflatePlans();
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubsFetchFailed(Throwable t, String message) {
|
||||
progressDialog.dismiss();
|
||||
Toast.makeText(this, "" + message, Toast.LENGTH_SHORT).show();
|
||||
binding.plansView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// subscription create callback
|
||||
|
||||
@@ -103,7 +103,8 @@ public class DirectionToHomeActivity extends AppCompatActivity
|
||||
String cur_location = pat_cur_lat + "," + pat_cur_lng;
|
||||
String pat_location = pat_lat + "," + pat_lng;
|
||||
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
|
||||
Uri.parse("http://maps.google.com/maps?saddr=" + cur_location + "&daddr=" + pat_location));
|
||||
Uri.parse("https://www.google.com/maps/dir/?api=1&destination=" + pat_location + "&travelmode=walking"));
|
||||
|
||||
startActivity(intent);
|
||||
|
||||
viewModel.notifyRequestedDirections(AppUtil.getPatientUid(this)+"",
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.ssb.simplitend.patient_dashboard;
|
||||
|
||||
import static com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.DeActivateAccountActivity.IS_PATIENT_KEY;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.onesignal.OneSignal;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.AccountPresenter;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.deactivateacc.DeActivateAccountActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.mvvm.CgHomeContracts;
|
||||
import com.ssb.simplitend.databinding.ActivityPatSettingsBinding;
|
||||
import com.ssb.simplitend.welcome.activities.WelcomeActivity;
|
||||
|
||||
public class PatSettingsActivity extends AppCompatActivity implements CgHomeContracts.SignOutCallback {
|
||||
|
||||
private ActivityPatSettingsBinding binding;
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
private AccountPresenter accountPresenter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = ActivityPatSettingsBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
progressDialog = new ProgressDialog(this);
|
||||
accountPresenter = AccountPresenter.getAccountPresenter();
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
binding.notificationCheck.setChecked(OneSignal.getUser().getPushSubscription().getOptedIn());
|
||||
binding.notificationCheck.setOnCheckedChangeListener((compoundButton, check) -> {
|
||||
if (check){
|
||||
OneSignal.getUser().getPushSubscription().optIn();
|
||||
}else{
|
||||
OneSignal.getUser().getPushSubscription().optOut();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
|
||||
binding.deActivate.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(this, DeActivateAccountActivity.class);
|
||||
intent.putExtra(IS_PATIENT_KEY, true);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
binding.tNC.setOnClickListener(v -> {
|
||||
AppUtil.openLink(this, getString(R.string.terms_n_conditions_link),
|
||||
getString(R.string.terms_conditions_));
|
||||
});
|
||||
|
||||
binding.privacy.setOnClickListener(v -> {
|
||||
AppUtil.openLink(this, getString(R.string.privacy_policy_link),
|
||||
getString(R.string.privacy_policy));
|
||||
});
|
||||
|
||||
binding.logout.setOnClickListener(v -> {
|
||||
AppUtil.showAlert(this,
|
||||
"Are you sure?", "Do you want to sign out?",
|
||||
getString(R.string.no),
|
||||
((dialogInterface, i) -> {}),
|
||||
getString(R.string.yes),
|
||||
((dialogInterface, i) -> {
|
||||
progressDialog.setTitle("Please wait...");
|
||||
progressDialog.setMessage("while we sign you out");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
accountPresenter.signOut("Bearer " + AppUtil.getCgToken(this),
|
||||
this);
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSignOutSuccess() {
|
||||
progressDialog.dismiss();
|
||||
|
||||
AppUtil.patientSignOut(this);
|
||||
|
||||
Intent intent = new Intent(this, WelcomeActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSignOutFailed(Throwable t, String message) {
|
||||
progressDialog.dismiss();
|
||||
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -145,13 +146,15 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
|
||||
private void setDetails() {
|
||||
if (patientData == null) return;
|
||||
|
||||
Glide.with(requireContext())
|
||||
.load(AppUtil.IMAGE_BASE_URL + patientData.profile_photo)
|
||||
.diskCacheStrategy(DiskCacheStrategy.DATA)
|
||||
.fitCenter()
|
||||
.placeholder(android.R.color.darker_gray)
|
||||
.error(R.drawable.senior_img)
|
||||
.into(binding.profile);
|
||||
if (patientData.profile_photo != null){
|
||||
Glide.with(requireContext())
|
||||
.load(AppUtil.IMAGE_BASE_URL + patientData.profile_photo)
|
||||
.diskCacheStrategy(DiskCacheStrategy.DATA)
|
||||
.fitCenter()
|
||||
.placeholder(android.R.color.darker_gray)
|
||||
.error(R.drawable.senior_img)
|
||||
.into(binding.profile);
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
@@ -187,22 +190,24 @@ public class PatientDashboardFragment extends Fragment implements ProfileContrac
|
||||
);
|
||||
|
||||
binding.sosBtn.setOnClickListener(v -> {
|
||||
// fake sign out
|
||||
PatientDataCache.getContactList(requireContext(),
|
||||
"Bearer " + AppUtil.getPatientToken(requireContext()), (contactList1 -> {
|
||||
this.contactList = contactList1;
|
||||
|
||||
// TODO: 08-08-2023 remove this
|
||||
viewModel.notifyRequestedSOS(AppUtil.getPatientUid(requireContext())+"",
|
||||
AppUtil.getPatientToken(requireContext()));
|
||||
viewModel.notifyRequestedSOS(AppUtil.getPatientUid(requireContext())+"",
|
||||
AppUtil.getPatientToken(requireContext()));
|
||||
|
||||
AppUtil.showAlert(requireContext(),
|
||||
"Test mode", "Do you want to log out?",
|
||||
"LOG OUT", ((dialogInterface, i) -> {
|
||||
AppUtil.patientSignOut(requireContext());
|
||||
String phone_number = "911";
|
||||
|
||||
Intent intent = new Intent(requireActivity(), WelcomeActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
}), "Cancel", ((dialogInterface, i) -> {}));
|
||||
for (ContactData contactData: contactList1){
|
||||
if (contactData.is_sos.equals("1")){
|
||||
phone_number = contactData.phone_number;
|
||||
}
|
||||
}
|
||||
|
||||
AppUtil.callPhone(requireActivity(), phone_number);
|
||||
|
||||
}), true);
|
||||
});
|
||||
|
||||
binding.closeReminder.setOnClickListener(v -> removeReminder());
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.ssb.simplitend.apputils.PatientDataCache;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.EditProfileInfoActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.activities.PatientProfileShowerActivity;
|
||||
import com.ssb.simplitend.databinding.ActivityPatProfileInfoBinding;
|
||||
import com.ssb.simplitend.patient_dashboard.PatSettingsActivity;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
|
||||
|
||||
public class PatientProfileInfoFragment extends Fragment {
|
||||
@@ -115,6 +116,11 @@ public class PatientProfileInfoFragment extends Fragment {
|
||||
intent.putExtra(IS_FROM_PATIENT, true);
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
binding.settings.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(requireActivity(), PatSettingsActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
|
||||
@@ -218,7 +218,7 @@ public class CgRegisterFragment extends Fragment implements WelcomeContracts.Reg
|
||||
|
||||
binding.tncBtn.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://www.google.com"));
|
||||
intent.setData(Uri.parse(getString(R.string.terms_n_conditions_link)));
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ public class RegisterFragment extends Fragment implements WelcomeContracts.Verif
|
||||
|
||||
binding.tncBtn.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://www.google.com"));
|
||||
intent.setData(Uri.parse(getString(R.string.terms_n_conditions_link)));
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
|
||||
14
app/src/main/res/drawable/ic_privacy.xml
Normal file
14
app/src/main/res/drawable/ic_privacy.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64">
|
||||
<path
|
||||
android:pathData="M27.6,3.1c-4.2,3.1 -12.1,5.9 -17,5.9 -1.7,-0 -4.2,0.3 -5.5,0.7l-2.3,0.6 0.4,14.6c0.4,13.4 0.6,15 3,19.6 1.4,2.8 4.7,7 7.3,9.4 4.5,4.2 15.4,10.1 18.6,10.1 3.5,-0 15.8,-7.2 19.9,-11.6 7.1,-7.8 8.4,-11.8 8.8,-28.1l0.4,-14.1 -4.9,-0.7c-10.9,-1.4 -19.3,-4.4 -22.2,-7.9 -1.7,-2 -1.9,-2 -6.5,1.5zM33.9,5.4c1.9,2.2 10.1,5.4 17.5,6.7l6.9,1.2 -0.5,12.1c-0.6,14.2 -2.3,19.1 -8.8,25.5 -2.4,2.3 -7.2,5.5 -10.7,7.2l-6.5,3.1 -6.1,-3.1c-8.5,-4.1 -12.7,-7.9 -16.2,-14.2 -2.7,-5 -3,-6.3 -3.3,-18l-0.4,-12.7 6.8,-1.1c7.4,-1.3 15.6,-4.5 17.5,-6.7 0.6,-0.8 1.5,-1.4 1.9,-1.4 0.4,-0 1.3,0.6 1.9,1.4z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M28.2,20.6c-1.4,1 -2.2,2.5 -2.2,4.4 0,1.9 -0.7,3.3 -2,4 -1.9,1 -2.1,1.9 -1.8,8.3l0.3,7.2 8.9,0.3c6.5,0.2 9.2,-0.1 9.8,-1 0.4,-0.7 0.8,-4.2 0.8,-7.6 0,-5.6 -0.3,-6.5 -2,-6.9 -1.5,-0.4 -2,-1.4 -2,-3.9 0,-3.4 -2.8,-6.4 -6,-6.4 -0.9,-0 -2.6,0.7 -3.8,1.6zM33.8,23.2c0.7,0.7 1.2,2.2 1.2,3.5 0,1.9 -0.5,2.3 -3,2.3 -2.5,-0 -3,-0.4 -3,-2.3 0,-2.1 1.6,-4.7 3,-4.7 0.3,-0 1.1,0.5 1.8,1.2zM38,37l0,5 -6,-0 -6,-0 0,-5 0,-5 6,-0 6,-0 0,5z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/ic_settings_outline.xml
Normal file
14
app/src/main/res/drawable/ic_settings_outline.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64">
|
||||
<path
|
||||
android:pathData="M26,6c-1.1,1.1 -2,3.1 -2,4.4 0,3.8 -2.5,5.2 -6.6,3.7 -4.4,-1.6 -6.8,-0.8 -9.4,3.3 -2.8,4.6 -2.5,7.3 1,10.4 3.8,3.3 3.8,5.1 0,8.4 -3.5,3.1 -3.8,5.8 -1,10.3 2.6,4.2 4.3,4.8 9.1,3.4 4.5,-1.4 6.9,-0.1 6.9,3.7 0,3.7 3.4,6.4 8,6.4 4.6,-0 8,-2.7 8,-6.4 0,-3.8 2.4,-5.1 6.9,-3.7 4.8,1.4 6.5,0.8 9.1,-3.4 2.8,-4.5 2.5,-7.2 -1,-10.3 -1.6,-1.5 -3,-3.3 -3,-4.2 0,-0.9 1.4,-2.7 3,-4.2 3.5,-3.1 3.8,-5.8 1,-10.4 -2.6,-4.1 -5,-4.9 -9.4,-3.3 -4.1,1.5 -6.6,0.1 -6.6,-3.7 0,-3.7 -3.4,-6.4 -8,-6.4 -2.7,-0 -4.7,0.7 -6,2zM36.1,12c0.4,1.9 1.8,4.3 3,5.3 2.2,1.8 3.2,1.8 10.2,0.5 1.1,-0.2 2.4,0.7 3.4,2.4 1.6,2.6 1.6,2.7 -1.5,5.6 -4.4,4.1 -4.4,8.3 0,12.4 3.1,2.9 3.1,3 1.5,5.6 -1,1.7 -2.3,2.6 -3.4,2.4 -7,-1.3 -8,-1.3 -10.2,0.5 -1.2,1 -2.6,3.4 -3,5.3 -0.6,3.2 -1,3.5 -4.1,3.5 -3.1,-0 -3.5,-0.3 -4.1,-3.5 -0.4,-1.9 -1.8,-4.3 -3,-5.3 -2.2,-1.8 -3.2,-1.8 -10.2,-0.5 -1.1,0.2 -2.4,-0.7 -3.4,-2.4 -1.6,-2.6 -1.6,-2.7 1.5,-5.6 4.4,-4.1 4.4,-8.3 0,-12.4 -3.1,-2.9 -3.1,-3 -1.5,-5.6 1,-1.7 2.3,-2.6 3.4,-2.4 7.7,1.5 8.2,1.4 10.7,-1.2 1.4,-1.4 2.6,-3.6 2.6,-4.9 0,-3.2 0.9,-3.9 4.4,-3.5 2.6,0.3 3.1,0.8 3.7,3.8z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M27.1,23.4c-8.7,4.8 -5,18.6 4.9,18.6 5.1,-0 10,-4.9 10,-9.9 0,-7.5 -8.3,-12.4 -14.9,-8.7zM36,28c1.1,1.1 2,2.9 2,4 0,2.6 -3.4,6 -6,6 -2.6,-0 -6,-3.4 -6,-6 0,-1.1 0.9,-2.9 2,-4 1.1,-1.1 2.9,-2 4,-2 1.1,-0 2.9,0.9 4,2z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
58
app/src/main/res/drawable/ic_t_n_c.xml
Normal file
58
app/src/main/res/drawable/ic_t_n_c.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64">
|
||||
<path
|
||||
android:pathData="M1,30.3c0,28.2 0.1,30.5 1.8,32 1.6,1.5 5.2,1.7 29.4,1.7 25.4,-0 27.6,-0.1 29.1,-1.8 1.5,-1.6 1.7,-4.9 1.7,-25.5l0,-23.7 -4.5,-0 -4.4,-0 -0.3,-6.3 -0.3,-6.2 -26.2,-0.3 -26.3,-0.2 0,30.3zM51,14c0,9.1 0.3,11 1.5,11 1.1,-0 1.5,-1.2 1.5,-5l0,-5 3.5,-0 3.5,-0 0,21.7c0,12 -0.4,22.4 -0.9,23.1 -0.4,0.8 -1.9,1.2 -3.2,1 -2.4,-0.3 -2.4,-0.5 -2.9,-13.3 -0.7,-17.4 -2.5,-16.4 -2.5,1.3l0,13.3 -23.3,-0.3c-19.4,-0.2 -23.4,-0.6 -24.2,-1.8 -0.6,-0.8 -1,-13.5 -1,-29.3l0,-27.7 24,-0 24,-0 0,11z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M7,8.9c0,0.6 0.5,1.3 1,1.6 0.6,0.3 1,2.6 1,5.1 0,2.4 0.5,4.4 1,4.4 0.6,-0 1,-2.3 1,-5 0,-2.8 0.5,-5 1,-5 0.6,-0 1,-0.5 1,-1 0,-0.6 -1.3,-1 -3,-1 -1.6,-0 -3,0.4 -3,0.9z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M14.4,9.4c-0.3,0.7 -0.4,3.3 -0.2,5.7 0.3,4.2 0.5,4.4 3.6,4.7 1.8,0.2 3.2,-0.1 3.2,-0.7 0,-0.6 -0.9,-1.1 -2,-1.1 -1.1,-0 -2,-0.7 -2,-1.5 0,-0.8 0.7,-1.5 1.5,-1.5 0.8,-0 1.5,-0.5 1.5,-1 0,-0.6 -0.7,-1 -1.5,-1 -0.8,-0 -1.5,-0.7 -1.5,-1.5 0,-0.8 0.9,-1.5 2,-1.5 1.1,-0 2,-0.5 2,-1 0,-1.5 -6,-1.2 -6.6,0.4z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M23,14c0,3.3 0.4,6 1,6 0.6,-0 1,-1.2 1,-2.8l0.1,-2.7 1.5,2.7c0.8,1.6 1.8,2.8 2.3,2.8 0.6,-0 0.8,-7.6 0.2,-11.3 0,-0.4 -1.4,-0.7 -3.1,-0.7l-3,-0 0,6zM27.2,11.5c0,0.5 -0.5,1.1 -1.1,1.3 -0.6,0.2 -1.1,-0.4 -1.1,-1.3 0,-0.9 0.5,-1.5 1.1,-1.3 0.6,0.2 1.1,0.8 1.1,1.3z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M31.4,9.4c-0.3,0.7 -0.4,3.3 -0.2,5.7 0.4,5.2 2.8,6.7 2.8,1.7 0,-2.7 0.4,-3.4 2,-3.4 1.6,-0 2,0.7 2,3.3 0,1.8 0.5,3.3 1,3.3 0.6,-0 1,-2.7 1,-6 0,-6 -0.6,-7 -2.8,-4.8 -0.9,0.9 -1.5,0.9 -2.4,-0 -1.6,-1.6 -2.7,-1.5 -3.4,0.2z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M42.2,9.2c-1.8,1.8 -1.5,3.6 0.8,5 2.3,1.5 2.7,4 0.5,3.2 -1,-0.4 -1.5,-0 -1.5,1.1 0,2.2 3.9,1.6 5.4,-0.8 0.9,-1.5 0.7,-2.2 -1.1,-3.7 -2.6,-2 -3,-4.2 -0.9,-3.8 0.8,0.2 1.6,-0.2 1.8,-0.7 0.5,-1.5 -3.5,-1.8 -5,-0.3z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M8,31.9l0,5.1 4.5,-0c3.9,-0 4.5,-0.3 5.1,-2.4 0.3,-1.3 0.4,-3.5 0.2,-4.7 -0.3,-2.1 -0.9,-2.4 -5,-2.7l-4.8,-0.3 0,5zM15,31.5c0,2 -0.5,2.5 -2.5,2.5 -2,-0 -2.5,-0.5 -2.5,-2.5 0,-2 0.5,-2.5 2.5,-2.5 2,-0 2.5,0.5 2.5,2.5z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M20,28c0,0.6 5.2,1 13.5,1 8.3,-0 13.5,-0.4 13.5,-1 0,-0.6 -5.2,-1 -13.5,-1 -8.3,-0 -13.5,0.4 -13.5,1z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M51.6,28.9c-0.4,0.5 -0.2,1.2 0.3,1.5 0.5,0.4 1.2,0.2 1.5,-0.3 0.4,-0.5 0.2,-1.2 -0.3,-1.5 -0.5,-0.4 -1.2,-0.2 -1.5,0.3z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M20.7,32.6c-1.7,1.7 1.3,2.4 10.4,2.4 8.1,-0 9.9,-0.3 9.9,-1.5 0,-1.2 -1.8,-1.5 -9.8,-1.5 -5.4,-0 -10.2,0.3 -10.5,0.6z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M8,46.9l0,5.1 4.5,-0c3.9,-0 4.5,-0.3 5.1,-2.4 0.3,-1.3 0.4,-3.5 0.2,-4.7 -0.3,-2.1 -0.9,-2.4 -5,-2.7l-4.8,-0.3 0,5zM15,46.5c0,2 -0.5,2.5 -2.5,2.5 -2,-0 -2.5,-0.5 -2.5,-2.5 0,-2 0.5,-2.5 2.5,-2.5 2,-0 2.5,0.5 2.5,2.5z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M20,43c0,0.6 5.2,1 13.5,1 8.3,-0 13.5,-0.4 13.5,-1 0,-0.6 -5.2,-1 -13.5,-1 -8.3,-0 -13.5,0.4 -13.5,1z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
<path
|
||||
android:pathData="M20.7,47.6c-1.7,1.7 1.3,2.4 10.4,2.4 8.1,-0 9.9,-0.3 9.9,-1.5 0,-1.2 -1.8,-1.5 -9.8,-1.5 -5.4,-0 -10.2,0.3 -10.5,0.6z"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"/>
|
||||
</vector>
|
||||
@@ -81,6 +81,80 @@
|
||||
android:drawablePadding="15dp"
|
||||
app:drawableStartCompat="@drawable/ic_alert" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/privacy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:elevation="3dp"
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="25dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_privacy"
|
||||
android:contentDescription="@string/terms_n_conditions"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/privacy_policy"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/t_n_c"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:elevation="3dp"
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="25dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_t_n_c"
|
||||
android:contentDescription="@string/terms_n_conditions"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/terms_conditions_"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/logout"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -15,16 +15,37 @@
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="35sp"
|
||||
android:layout_height="35sp"
|
||||
android:layout_margin="15dp"
|
||||
android:contentDescription="@string/back_button"
|
||||
android:padding="5dp"
|
||||
android:paddingStart="-15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:src="@drawable/arrow_back" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="35sp"
|
||||
android:layout_height="35sp"
|
||||
android:layout_margin="15dp"
|
||||
android:contentDescription="@string/back_button"
|
||||
android:padding="5dp"
|
||||
android:paddingStart="-15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:src="@drawable/arrow_back" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/settings"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
|
||||
android:src="@drawable/ic_settings_outline"
|
||||
android:contentDescription="@string/settings"
|
||||
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
|
||||
app:tint="@android:color/black" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
189
app/src/main/res/layout/activity_pat_settings.xml
Normal file
189
app/src/main/res/layout/activity_pat_settings.xml
Normal file
@@ -0,0 +1,189 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none"
|
||||
android:background="@color/white"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="35sp"
|
||||
android:layout_height="35sp"
|
||||
android:layout_margin="15dp"
|
||||
android:contentDescription="@string/back_button"
|
||||
android:padding="5dp"
|
||||
android:paddingStart="-15dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:src="@drawable/arrow_back" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:text="@string/settings"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/de_activate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/delete_account"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
|
||||
android:elevation="3dp"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
app:drawableStartCompat="@drawable/ic_alert" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/privacy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:elevation="3dp"
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="25dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_privacy"
|
||||
android:contentDescription="@string/terms_n_conditions"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/privacy_policy"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/t_n_c"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:elevation="3dp"
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="25dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_t_n_c"
|
||||
android:contentDescription="@string/terms_n_conditions"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/terms_conditions_"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/notification_check"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
|
||||
android:text="@string/notification_"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
app:drawableStartCompat="@drawable/ic_notification"
|
||||
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
|
||||
android:elevation="3dp"
|
||||
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
app:switchMinWidth="60dp"
|
||||
app:track="@drawable/switch_track_1"
|
||||
app:thumbTint="@color/color_primary"
|
||||
app:showText="false"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/logout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/logout"
|
||||
android:fontFamily="@font/nunito_medium"
|
||||
android:textColor="#EA3829"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
|
||||
android:layout_marginVertical="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
|
||||
android:background="@drawable/edit_text_bg_2"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingVertical="15dp"
|
||||
|
||||
android:elevation="3dp"
|
||||
|
||||
android:drawablePadding="15dp"
|
||||
app:drawableStartCompat="@drawable/ic_log_out" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
@@ -33,6 +33,7 @@
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/plans_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@@ -101,11 +102,12 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/yearly_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:text="@string/year"
|
||||
tools:text="@string/year"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
@@ -116,6 +118,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/year_discount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
@@ -123,7 +126,7 @@
|
||||
android:background="@drawable/edit_text_bg"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:text="@string/_25"
|
||||
tools:text="@string/_25"
|
||||
|
||||
android:textColor="@color/black"
|
||||
|
||||
@@ -131,6 +134,8 @@
|
||||
|
||||
android:visibility="visible"
|
||||
|
||||
android:maxLines="1"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
@@ -143,26 +148,31 @@
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/year_actual_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:text="@string/_71_4"
|
||||
tools:text="@string/_71_4"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
|
||||
android:maxLines="1"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/year_discounted_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:text="@string/_53_5"
|
||||
tools:text="@string/_53_5"
|
||||
android:textColor="@color/color_primary_dark"
|
||||
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:maxLines="1"
|
||||
|
||||
/>
|
||||
|
||||
@@ -189,12 +199,13 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/yearly_month_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:text="@string/_4_46"
|
||||
tools:text="@string/_4_46"
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:textSize="@dimen/_18ssp"
|
||||
@@ -258,11 +269,12 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monthly_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:text="@string/monthly"
|
||||
tools:text="@string/monthly"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
@@ -280,12 +292,13 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monthly_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
android:fontFamily="@font/nunito_bold"
|
||||
android:text="@string/_5_95"
|
||||
tools:text="@string/_5_95"
|
||||
android:textColor="@color/black"
|
||||
|
||||
android:textSize="@dimen/_18ssp"
|
||||
@@ -373,6 +386,41 @@
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/error_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/couldn_t_load_plans"
|
||||
android:fontFamily="@font/nunito_regular"
|
||||
android:textColor="@color/black"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/retry"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/retry"
|
||||
android:fontFamily="@font/nunito_semibold"
|
||||
android:textColor="@color/color_primary_dark"
|
||||
android:textAppearance="@style/TextAppearance.Material3.TitleLarge"
|
||||
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="5dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!--last code in the commit of 21st august 2023-->
|
||||
@@ -387,7 +387,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/default_sos"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
<string name="_25">-25% OFF</string>
|
||||
<string name="_71_4"><strike>$71.4</strike></string>
|
||||
<string name="_53_5">$53.55</string>
|
||||
<string name="mo">mo</string>
|
||||
<string name="mo">/mo</string>
|
||||
<string name="_4_46">$4.46</string>
|
||||
<string name="monthly">Monthly</string>
|
||||
<string name="_5_95">$5.95</string>
|
||||
@@ -423,5 +423,12 @@
|
||||
<string name="no_frequently_used_apps">No frequently used apps added\nPlease select an app from below list to unlock.</string>
|
||||
<string name="refresh">refresh</string>
|
||||
<string name="illustration">illustration</string>
|
||||
<string name="privacy_policy">Privacy Policy</string>
|
||||
<string name="terms_conditions_"><![CDATA[Terms & Conditions]]></string>
|
||||
<string name="notification_">Notification</string>
|
||||
|
||||
<string name="privacy_policy_link">https://www.simplitend.com/privacy-policy</string>
|
||||
<string name="terms_n_conditions_link">https://www.simplitend.com/terms-and-conditions</string>
|
||||
<string name="couldn_t_load_plans">Couldn\'t load plans</string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user