hide coupon codes if empty
This commit is contained in:
@@ -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<PersonalCouponModel> 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);
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
app:description="@string/kebap_pass" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/personalCouponCodesTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
|
||||
Reference in New Issue
Block a user