-
Notifications
You must be signed in to change notification settings - Fork 824
Conversation
@iamareebjamal @srv-twry @mayank8318 @nikit19 Is this a good way to show discount-codes also this is initial steps (the indentation and refactors will be done later, UI will be improved etc ) |
812d84b
to
fdf63df
Compare
@iamareebjamal would that be okay if discount codes are shown here, if yes I would proceed further finalizing everything (UI will be changed a little and some more details of discount codes will be added) |
I think AboutFragment has lost its actual use case, don't add it there. Create a new section |
fdf63df
to
6680349
Compare
|
Show the fields which only have non null values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the download lazy i.e. Download should be done after the user enters the fragment.
Also remove the dependency on the event bus pattern.
@srv-twry yeah that i will do also because in order to view dicount codes Authentication is necessary ie user should be logged in, so that check and downloading part will be moved to fragment |
6680349
to
bb46cbf
Compare
bb46cbf
to
597046c
Compare
Hi @simarsingh24! It looks like one or more of your builds have failed.
|
597046c
to
7cb5dfb
Compare
@iamareebjamal please review |
Toast.makeText(getContext(), "User need to be logged in!", Toast.LENGTH_SHORT).show(); | ||
Intent intent = new Intent(getActivity(), LoginActivity.class); | ||
startActivity(intent); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several formatting related issues, please resolve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made some formatting changes, but couldn't find anything in this highlighted area
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamareebjamal could you please confirm?
setUpRecyclerView(); | ||
Utils.registerIfUrlValid(swipeRefreshLayout, this, this::refresh); | ||
discountFragmentViewModel = ViewModelProviders.of(this).get(DiscountFragmentViewModel.class); | ||
if(AuthUtil.isUserLoggedIn()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
Utils.registerIfUrlValid(swipeRefreshLayout, this, this::refresh); | ||
discountFragmentViewModel = ViewModelProviders.of(this).get(DiscountFragmentViewModel.class); | ||
if(AuthUtil.isUserLoggedIn()) { | ||
if(NetworkUtils.haveNetworkConnection(getContext())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
downloadDiscountCodes(); | ||
} | ||
loadData(); | ||
}else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
9d793d7
to
d6ecf50
Compare
made requested changes and squashed commits |
if (!TextUtils.isEmpty(field.trim())) { | ||
textView.setVisibility(View.VISIBLE); | ||
field = prefix + field; | ||
textView.setText(field); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directly set prefix + field in TextView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
|
||
|
||
private void setStringField(TextView textView, String field, String prefix) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the function appropriately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
92e6338
to
64d91d4
Compare
squashed commits |
@@ -44,7 +44,7 @@ | |||
<dimen name="heading_text_size">20sp</dimen> | |||
<dimen name="text_size_expanded_title">22sp</dimen> | |||
<dimen name="text_size_extra_large">18sp</dimen> | |||
<dimen name="text_size_large">16sp</dimen> | |||
<dimen name="text_size_large">20sp</dimen> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is large 20sp and extra large 18 sp?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverting back to 16sp
changed nav icon indentation changes indentation changes indentation changes refactor changes minor change
@iamareebjamal please review |
ButterKnife.bind(this, itemView); | ||
|
||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra lines
|
||
public void bindDiscountCode(DiscountCode discountCode) { | ||
|
||
String code = Utils.checkStringEmpty(discountCode.getCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra lines
setStringFieldWithPrefix(discountUsedFor, usedFor, "Used For : "); | ||
setStringFieldWithPrefix(this.discountUrl, discountUrl, "Discount URL : "); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line
setStringFieldWithPrefix(discountCodeTextView, code, ""); | ||
setStringFieldWithPrefix(discountCodeValue, "Value : "+value, ""); | ||
setStringFieldWithPrefix(discountMinQuantity, "Minimum Quantity : "+minQuantity, ""); | ||
setStringFieldWithPrefix(discountMaxQuantity, "Maximum Quantity :"+maxQuantity, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing between +
I'd recommend using template strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean use of strings.xml
like this :
<string name="MinQuanString">Minimum Quantity : %1$d </string>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
setStringFieldWithPrefix(discountCodeTextView, code, ""); | ||
setStringFieldWithPrefix(discountCodeValue, "Value : "+value, ""); | ||
setStringFieldWithPrefix(discountMinQuantity, "Minimum Quantity : "+minQuantity, ""); | ||
setStringFieldWithPrefix(discountMaxQuantity, "Maximum Quantity :"+maxQuantity, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using ""
empty strings, pass null and check for the same
@iamareebjamal discount codes are not being displayed now! can you point out what went wrong in the last commit ? |
Mentions #2296

Screenshots for the change: