.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package com.ssb.simplitend.articles;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.webkit.WebSettings;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.ssb.simplitend.databinding.ActivityArticleShowerBinding;
|
||||
|
||||
public class ArticleShowerActivity extends AppCompatActivity {
|
||||
@@ -52,11 +52,19 @@ public class ArticleShowerActivity extends AppCompatActivity {
|
||||
return;
|
||||
}
|
||||
|
||||
binding.progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
binding.webView.getSettings().setJavaScriptEnabled(true);
|
||||
binding.webView.getSettings().setBuiltInZoomControls(true);
|
||||
binding.webView.getSettings().setDisplayZoomControls(false);
|
||||
|
||||
binding.webView.setWebViewClient(new WebViewClient());
|
||||
binding.webView.setWebViewClient(new WebViewClient(){
|
||||
@Override
|
||||
public void onPageCommitVisible(WebView view, String url) {
|
||||
super.onPageCommitVisible(view, url);
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
binding.webView.loadUrl(url);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
@@ -25,8 +26,6 @@ public class ArticlesActivity extends AppCompatActivity
|
||||
|
||||
private ArticlesAdapter articlesAdapter;
|
||||
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -44,18 +43,14 @@ public class ArticlesActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private void getArticles() {
|
||||
progressDialog.setTitle("Please wait...");
|
||||
progressDialog.setMessage("while we fetch the articles");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
binding.noArticles.setVisibility(View.GONE);
|
||||
binding.progressBar.setVisibility(View.VISIBLE);
|
||||
binding.search.setVisibility(View.GONE);
|
||||
|
||||
presenter.getArticles(this);
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
binding.articlesRv.setLayoutManager(new LinearLayoutManager(this));
|
||||
articlesAdapter = new ArticlesAdapter(this);
|
||||
binding.articlesRv.setAdapter(articlesAdapter);
|
||||
@@ -77,14 +72,24 @@ public class ArticlesActivity extends AppCompatActivity
|
||||
|
||||
@Override
|
||||
public void onArticlesFetched(ArrayList<ArticleResult> articleResults) {
|
||||
progressDialog.dismiss();
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
binding.noArticles.setVisibility(View.GONE);
|
||||
binding.search.setVisibility(View.VISIBLE);
|
||||
|
||||
if (articleResults.isEmpty()){
|
||||
binding.noArticles.setVisibility(View.VISIBLE);
|
||||
binding.search.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
articlesAdapter.submitList(articleResults);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArticleFetchFailed(Throwable t, String message) {
|
||||
progressDialog.dismiss();
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
binding.noArticles.setVisibility(View.VISIBLE);
|
||||
binding.search.setVisibility(View.GONE);
|
||||
|
||||
|
||||
Toast.makeText(this, "" + message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@@ -1,21 +1,58 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.fragments;
|
||||
|
||||
import static com.ssb.simplitend.articles.ArticleShowerActivity.ARTICLE_TITLE;
|
||||
import static com.ssb.simplitend.articles.ArticleShowerActivity.ARTICLE_URL_KEY;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||
import com.google.android.gms.maps.GoogleMap;
|
||||
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||
import com.google.android.gms.maps.SupportMapFragment;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.apputils.CaregiverDataCache;
|
||||
import com.ssb.simplitend.articles.ArticleContracts;
|
||||
import com.ssb.simplitend.articles.ArticleResult;
|
||||
import com.ssb.simplitend.articles.ArticleShowerActivity;
|
||||
import com.ssb.simplitend.articles.ArticlesActivity;
|
||||
import com.ssb.simplitend.caregiverdashboard.mvvm.CaregiverMainViewModel;
|
||||
import com.ssb.simplitend.cg_geofencing.CgGeoFencingActivity;
|
||||
import com.ssb.simplitend.databinding.CaregiverDashFragmentBinding;
|
||||
import com.ssb.simplitend.welcome.welcomecg.mvvm.CareGiverData;
|
||||
import com.ssb.simplitend.welcome.welcomepatient.mvvm.models.PatientData;
|
||||
|
||||
public class DashBoardFragment extends Fragment {
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class DashBoardFragment extends Fragment implements
|
||||
OnMapReadyCallback, ArticleContracts.GetArticleCallback {
|
||||
|
||||
// view binding
|
||||
protected CaregiverDashFragmentBinding binding;
|
||||
|
||||
private CaregiverMainViewModel viewModel;
|
||||
|
||||
private CareGiverData careGiverData;
|
||||
|
||||
private PatientData patientData;
|
||||
|
||||
public DashBoardFragment(){
|
||||
// required empty
|
||||
}
|
||||
@@ -24,7 +61,174 @@ public class DashBoardFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = CaregiverDashFragmentBinding.inflate(inflater, container, false);
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(CaregiverMainViewModel.class);
|
||||
|
||||
CaregiverDataCache.getCaregiverData(requireActivity(), (careGiverData1 -> {
|
||||
this.careGiverData = careGiverData1;
|
||||
|
||||
setDetails();
|
||||
}), true);
|
||||
|
||||
initViews();
|
||||
|
||||
clickEvents();
|
||||
|
||||
loadArticles();
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void loadArticles() {
|
||||
viewModel.getArticles(this);
|
||||
}
|
||||
|
||||
private void setDetails() {
|
||||
if (careGiverData == null || careGiverData.patientDetails == null){
|
||||
Toast.makeText(requireActivity(), "Couldn't load data", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
patientData = careGiverData.patientDetails;
|
||||
|
||||
binding.patientName.setText(patientData.first_name);
|
||||
|
||||
setUpMap();
|
||||
}
|
||||
|
||||
private void setUpMap() {
|
||||
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
|
||||
SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager()
|
||||
.findFragmentById(R.id.home_map);
|
||||
if (mapFragment != null) {
|
||||
mapFragment.getMapAsync(this);
|
||||
}else{
|
||||
Toast.makeText(requireActivity(), "Couldn't load map. Please try again.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
Glide.with(requireActivity())
|
||||
.asGif()
|
||||
.load(R.raw.anim_pulse)
|
||||
.into(binding.activityGif);
|
||||
|
||||
Glide.with(requireActivity())
|
||||
.asGif()
|
||||
.load(R.raw.anim_pulse)
|
||||
.into(binding.upComingGif);
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.viewMoreArticle.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(requireActivity(), ArticlesActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
public void setArticleDetails(ArticleResult articleResult){
|
||||
if (articleResult == null) return;
|
||||
|
||||
Glide.with(requireActivity())
|
||||
.load(AppUtil.IMAGE_BASE_URL + articleResult.large_image)
|
||||
.centerCrop()
|
||||
.placeholder(android.R.color.darker_gray)
|
||||
.error(android.R.color.darker_gray)
|
||||
.into(binding.articleImg);
|
||||
|
||||
if (articleResult.article_title == null){
|
||||
articleResult.article_title = "No title";
|
||||
}
|
||||
|
||||
binding.articleTitle.setText(articleResult.article_title);
|
||||
|
||||
if (articleResult.article_author == null){
|
||||
articleResult.article_author = "No author";
|
||||
}
|
||||
|
||||
binding.articleAuthorName.setText(articleResult.article_author);
|
||||
|
||||
try {
|
||||
if (articleResult.created_at == null) throw new Exception();
|
||||
// parsing time of created at
|
||||
SimpleDateFormat format = new SimpleDateFormat(
|
||||
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.US);
|
||||
format.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
||||
Date date = format.parse(articleResult.created_at);
|
||||
if (date == null) throw new Exception();
|
||||
|
||||
SimpleDateFormat pretty_format = new SimpleDateFormat("dd MMM yy, HH:mm a", Locale.getDefault());
|
||||
String time = pretty_format.format(date);
|
||||
|
||||
binding.articleCreatedAt.setText(time);
|
||||
|
||||
}catch (Exception e){
|
||||
// do nothing
|
||||
String none = "None";
|
||||
binding.articleCreatedAt.setText(none);
|
||||
}
|
||||
|
||||
binding.articleCard.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(requireActivity(), ArticleShowerActivity.class);
|
||||
intent.putExtra(ARTICLE_URL_KEY, articleResult.article_link);
|
||||
intent.putExtra(ARTICLE_TITLE, articleResult.article_title);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArticlesFetched(ArrayList<ArticleResult> articleResults) {
|
||||
if (articleResults == null) return;
|
||||
|
||||
// saving in view model
|
||||
viewModel.setArticleResults(articleResults);
|
||||
|
||||
if (articleResults.size() > 0){
|
||||
binding.articleView.setVisibility(View.VISIBLE);
|
||||
|
||||
setArticleDetails(articleResults.get(0));
|
||||
|
||||
}else{
|
||||
// no articles
|
||||
binding.articleView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArticleFetchFailed(Throwable t, String message) {
|
||||
// do nothing
|
||||
binding.articleView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapReady(@NonNull GoogleMap googleMap) {
|
||||
LatLng latLng;
|
||||
|
||||
// loading patient's location
|
||||
try {
|
||||
if (patientData == null) throw new Exception();
|
||||
|
||||
double lat = Double.parseDouble(patientData.lat);
|
||||
double lng = Double.parseDouble(patientData.lng);
|
||||
|
||||
latLng = new LatLng(lat, lng);
|
||||
}catch (Exception e){
|
||||
// near marine drive
|
||||
latLng = new LatLng(18.93294274664527, 72.82806102186441);
|
||||
}
|
||||
|
||||
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16));
|
||||
|
||||
MarkerOptions markerOptions = new MarkerOptions()
|
||||
.position(latLng)
|
||||
.title(patientData.first_name + "");
|
||||
|
||||
googleMap.addMarker(markerOptions);
|
||||
googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16));;
|
||||
|
||||
googleMap.setOnMapClickListener(latLng1 -> {
|
||||
Intent intent = new Intent(requireActivity(), CgGeoFencingActivity.class);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,38 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.mvvm;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.ssb.simplitend.articles.ArticleContracts;
|
||||
import com.ssb.simplitend.articles.ArticleResult;
|
||||
import com.yarolegovich.slidingrootnav.SlidingRootNav;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CaregiverMainViewModel extends ViewModel {
|
||||
|
||||
public SlidingRootNav slidingRootNav;
|
||||
|
||||
public CaregiverMainViewModel(){}
|
||||
private final HomeRepository homeRepository;
|
||||
|
||||
private ArrayList<ArticleResult> articleResults;
|
||||
|
||||
public CaregiverMainViewModel(){
|
||||
this.homeRepository = HomeRepository.getHomeRepository();
|
||||
}
|
||||
|
||||
public void setArticleResults(ArrayList<ArticleResult> articleResults) {
|
||||
this.articleResults = articleResults;
|
||||
}
|
||||
|
||||
public void getArticles(@NonNull ArticleContracts.GetArticleCallback articleCallback){
|
||||
if (articleResults == null){
|
||||
homeRepository.getArticles(articleCallback);
|
||||
}else{
|
||||
articleCallback.onArticlesFetched(articleResults);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.mvvm;
|
||||
|
||||
public interface DashboardApiService {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ssb.simplitend.caregiverdashboard.mvvm;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.ssb.simplitend.articles.ArticleContracts;
|
||||
import com.ssb.simplitend.articles.ArticlePresenter;
|
||||
|
||||
public class HomeRepository {
|
||||
|
||||
private static HomeRepository homeRepository;
|
||||
|
||||
private HomeRepository(){}
|
||||
|
||||
public static synchronized HomeRepository getHomeRepository(){
|
||||
if (homeRepository == null){
|
||||
homeRepository = new HomeRepository();
|
||||
}
|
||||
|
||||
return homeRepository;
|
||||
}
|
||||
|
||||
public void getArticles(@NonNull ArticleContracts.GetArticleCallback getArticleCallback){
|
||||
ArticlePresenter articlePresenter = ArticlePresenter.getArticlePresenter();
|
||||
|
||||
articlePresenter.getArticles(getArticleCallback);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,28 +66,54 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
|
||||
clickEvents();
|
||||
|
||||
// selecting default yearly pack
|
||||
binding.yearCheck.setSelected(true);
|
||||
}
|
||||
|
||||
private void clickEvents() {
|
||||
binding.makePayment.setOnClickListener(view -> {
|
||||
payForSubscription();
|
||||
});
|
||||
|
||||
binding.yearCard.setOnClickListener(v -> {
|
||||
if (!binding.yearCheck.isSelected()){
|
||||
// not selected
|
||||
binding.monthCheck.setSelected(false);
|
||||
binding.yearCheck.setSelected(true);
|
||||
}
|
||||
});
|
||||
|
||||
binding.monthCard.setOnClickListener(v -> {
|
||||
if (!binding.monthCheck.isActivated()){
|
||||
binding.yearCheck.setSelected(false);
|
||||
binding.monthCheck.setSelected(true);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void payForSubscription() {
|
||||
if (careGiverData == null){
|
||||
if (careGiverData == null) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
// int position = binding.viewPager.getCurrentItem();
|
||||
// if (subscriptionPlans == null || position < 0 || position >= subscriptionPlans.size()) {
|
||||
// Toast.makeText(this, "Couldn't load plan.", Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
if (!binding.monthCheck.isSelected() && !binding.yearCheck.isSelected()){
|
||||
Toast.makeText(this, "Please select a plan", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
int position = 0;
|
||||
|
||||
if (binding.yearCheck.isSelected()){
|
||||
position = 1;
|
||||
}
|
||||
|
||||
if (position >= subscriptionPlans.size()){
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
progressDialog.setTitle("Please wait...");
|
||||
progressDialog.setMessage("while we take you to the payment gateway.");
|
||||
progressDialog.setCancelable(false);
|
||||
@@ -132,18 +158,6 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
// binding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||
// @Override
|
||||
// public void onPageSelected(int position) {
|
||||
// super.onPageSelected(position);
|
||||
// if (subscriptionPlans == null
|
||||
// || position < 0 || position >= subscriptionPlans.size()) return;
|
||||
//
|
||||
// String btn_text = "Make payment $" + subscriptionPlans.get(position).plan_value;
|
||||
// binding.makePayment.setText(btn_text);
|
||||
// }
|
||||
// });
|
||||
|
||||
// loading subscription plans
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
@@ -152,7 +166,6 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
|
||||
|
||||
String token = "Bearer " + AppUtil.getCgToken(this);
|
||||
presenter.getSubscriptionPlans(token, this);
|
||||
|
||||
@@ -179,7 +192,7 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private void createSubscription() {
|
||||
if (this.stripe_price_id == null || this.payment_intent_id == null){
|
||||
if (this.stripe_price_id == null || this.payment_intent_id == null) {
|
||||
// something went wrong
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
@@ -246,11 +259,6 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
public void onSubscriptionFetched(ArrayList<SubscriptionPlan> subscriptionPlans) {
|
||||
this.subscriptionPlans = subscriptionPlans;
|
||||
progressDialog.dismiss();
|
||||
|
||||
// // loading plans
|
||||
// PlanAdapter planAdapter = new PlanAdapter(subscriptionPlans);
|
||||
// binding.viewPager.setAdapter(planAdapter);
|
||||
// binding.circleIndicator.setViewPager(binding.viewPager);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -263,7 +271,7 @@ public class CgSubscriptionActivity extends AppCompatActivity
|
||||
@Override
|
||||
public void onSubscriptionCreated() {
|
||||
// statically changing the flag of subscription to 1
|
||||
if (careGiverData != null){
|
||||
if (careGiverData != null) {
|
||||
careGiverData.isCaregiverTakeSubscription = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.ssb.simplitend.R;
|
||||
@@ -19,8 +20,6 @@ public class FAQ_Activity extends AppCompatActivity implements FAQContracts.GETF
|
||||
|
||||
private FAQsPresenter presenter;
|
||||
|
||||
private ProgressDialog progressDialog;
|
||||
|
||||
private FAQAdapter faqAdapter;
|
||||
|
||||
@Override
|
||||
@@ -40,8 +39,6 @@ public class FAQ_Activity extends AppCompatActivity implements FAQContracts.GETF
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
progressDialog = new ProgressDialog(this);
|
||||
|
||||
binding.faqsRv.setLayoutManager(new LinearLayoutManager(this));
|
||||
faqAdapter = new FAQAdapter();
|
||||
binding.faqsRv.setAdapter(faqAdapter);
|
||||
@@ -54,17 +51,20 @@ public class FAQ_Activity extends AppCompatActivity implements FAQContracts.GETF
|
||||
}
|
||||
|
||||
private void getFAQs() {
|
||||
progressDialog.setTitle("Please wait...");
|
||||
progressDialog.setMessage("while we fetch the FAQs");
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
binding.progressBar.setVisibility(View.VISIBLE);
|
||||
binding.noFaqs.setVisibility(View.GONE);
|
||||
|
||||
presenter.getFAQs(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFAQsFetched(ArrayList<FAQResult> faqResults) {
|
||||
progressDialog.dismiss();
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
binding.noFaqs.setVisibility(View.GONE);
|
||||
|
||||
if (faqResults.isEmpty()){
|
||||
binding.noFaqs.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
faqAdapter.submitList(faqResults);
|
||||
|
||||
@@ -72,7 +72,8 @@ public class FAQ_Activity extends AppCompatActivity implements FAQContracts.GETF
|
||||
|
||||
@Override
|
||||
public void onFAQsFetchedFailed(Throwable t, String message) {
|
||||
progressDialog.dismiss();
|
||||
binding.progressBar.setVisibility(View.GONE);
|
||||
binding.noFaqs.setVisibility(View.VISIBLE);
|
||||
|
||||
Toast.makeText(this, "" + message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user