From 74dae33e4076533a73d3cdf4d0f02e9f1f7f7ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?mustafa=20ic=CC=A7men?= Date: Mon, 10 Aug 2020 23:46:47 +0300 Subject: [PATCH] hide coupon codes if empty --- .idea/caches/build_file_checksums.ser | Bin 542 -> 542 bytes .../android/fragment/ProfileFragment.java | 9 +++++++++ app/src/main/res/layout/fragment_profile.xml | 1 + 3 files changed, 10 insertions(+) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 4417c880d975871df56eca7701028525fb22e922..a62c29bf654bc33f8ccb12933081b7bbd8798992 100644 GIT binary patch delta 15 XcmbQoGLL1#43=9myW%&_X<`HbF>3}; delta 15 XcmbQoGLL1#43?WW6CZ7y)5Hh>HwOnc diff --git a/app/src/main/java/ch/pizzacucina/android/fragment/ProfileFragment.java b/app/src/main/java/ch/pizzacucina/android/fragment/ProfileFragment.java index 34667a9..3d9bcd1 100644 --- a/app/src/main/java/ch/pizzacucina/android/fragment/ProfileFragment.java +++ b/app/src/main/java/ch/pizzacucina/android/fragment/ProfileFragment.java @@ -10,6 +10,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.CompoundButton; +import android.widget.TextView; import com.afollestad.materialdialogs.DialogAction; import com.afollestad.materialdialogs.MaterialDialog; @@ -62,6 +63,7 @@ public class ProfileFragment extends BaseFragment { @BindView(R.id.emailPizzalinkInfoLayout) AppInfoView emailPizzalinkInfoLayout; @BindView(R.id.phonePizzalinkInfoLayout) AppInfoView phonePizzalinkInfoLayout; @BindView(R.id.enableNotificationsSwitch) SwitchCompat enableNotificationsSwitch; + @BindView(R.id.personalCouponCodesTextView) TextView personalCouponCodesTextView; @BindView(R.id.personalCouponCodesRecyclerView) RecyclerView personalCouponCodesRecyclerView; @BindString(R.string.bottom_nav_menu_item_profile) String fragmentTitle; @@ -297,6 +299,13 @@ public class ProfileFragment extends BaseFragment { } private void initPersonalCouponCodesRecyclerView(ArrayList personalCouponList){ + if(personalCouponList == null || personalCouponList.isEmpty()){ + personalCouponCodesTextView.setVisibility(View.GONE); + personalCouponCodesRecyclerView.setVisibility(View.GONE); + return; + } + personalCouponCodesTextView.setVisibility(View.VISIBLE); + personalCouponCodesRecyclerView.setVisibility(View.VISIBLE); personalCouponCodesRecyclerAdapter = new PersonalCouponCodesRecyclerAdapter(BaseActivity.currentActivity, personalCouponList); personalCouponCodesRecyclerView.setLayoutManager(new LinearLayoutManager(BaseActivity.currentActivity)); personalCouponCodesRecyclerView.setNestedScrollingEnabled(false); diff --git a/app/src/main/res/layout/fragment_profile.xml b/app/src/main/res/layout/fragment_profile.xml index 0f5589c..31a9bae 100644 --- a/app/src/main/res/layout/fragment_profile.xml +++ b/app/src/main/res/layout/fragment_profile.xml @@ -47,6 +47,7 @@ app:description="@string/kebap_pass" />