Skip to content

fix: incomprehensible snack bar message in the event details fragment #2833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ff432cf
favouritefragment
VamsiKrishnaCommits Oct 15, 2020
3b0b0d6
firstcommit
VamsiKrishnaCommits Oct 15, 2020
1a2f873
Merge branch 'development' of https://github.com/VamsiKrishnaCommits/…
VamsiKrishnaCommits Oct 15, 2020
4cba6b8
secondcommit
VamsiKrishnaCommits Oct 15, 2020
7c54edc
fix no internet issue
VamsiKrishnaCommits Nov 3, 2020
e0b4cb6
fixed internet issue 2
VamsiKrishnaCommits Nov 3, 2020
53d0ae8
third commit
VamsiKrishnaCommits Nov 3, 2020
7309e07
third commit
VamsiKrishnaCommits Nov 3, 2020
3b7bcf5
third commit
VamsiKrishnaCommits Nov 3, 2020
18b8004
thirDCOMMIT
VamsiKrishnaCommits Nov 3, 2020
b999d4c
Merge branch 'development' of https://github.com/VamsiKrishnaCommits/…
VamsiKrishnaCommits Nov 3, 2020
cb703d4
Merge branch 'development' into development
VamsiKrishnaCommits Nov 3, 2020
79d3c4c
thirdcommit
VamsiKrishnaCommits Nov 3, 2020
056f6e7
Merge branch 'development' of https://github.com/VamsiKrishnaCommits/…
VamsiKrishnaCommits Nov 3, 2020
57dc265
thirdcommit'
VamsiKrishnaCommits Nov 3, 2020
62681c4
thirdcommit
VamsiKrishnaCommits Nov 3, 2020
1e30b56
thirdcommit
VamsiKrishnaCommits Nov 5, 2020
146c0cb
thirdcommit
VamsiKrishnaCommits Nov 5, 2020
6195a5f
thirdcommit
VamsiKrishnaCommits Nov 6, 2020
8650bb9
thirdcommit fixedindentation
VamsiKrishnaCommits Nov 6, 2020
26266eb
thirdcommitfixed
VamsiKrishnaCommits Nov 6, 2020
782974b
thirdcommit
VamsiKrishnaCommits Nov 6, 2020
6b46766
thirdcommitfinal
VamsiKrishnaCommits Nov 6, 2020
190de4f
fix snackbar message
VamsiKrishnaCommits Jan 20, 2021
e600532
Merge branch 'development' of https://github.com/VamsiKrishnaCommits/…
VamsiKrishnaCommits Jan 20, 2021
c366d22
fix snackbar message
VamsiKrishnaCommits Jan 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Resource {

fun getString(@StringRes resId: Int) = context?.getString(resId)

fun getString(@StringRes resId: Int, vararg args: Any?) = context?.getString(resId, args)
fun getString(@StringRes resId: Int, vararg args: Any?) = context?.getString(resId, args[0])

fun getColor(@ColorRes resId: Int) = context?.resources?.getColor(resId)
}
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ class EventDetailsFragment : Fragment() {
.nonNull()
.observe(viewLifecycleOwner, Observer { similarEvents ->
similarEventsAdapter.submitList(similarEvents)
})
})
}

private fun loadEvent(event: Event) {
Expand Down Expand Up @@ -462,10 +462,10 @@ class EventDetailsFragment : Fragment() {
rootView.eventLocationLinearLayout.setOnClickListener(mapClickListener)

Picasso.get()
.load(eventViewModel.loadMap(event))
.placeholder(R.drawable.ic_map_black)
.error(R.drawable.ic_map_black)
.into(rootView.imageMap)
.load(eventViewModel.loadMap(event))
.placeholder(R.drawable.ic_map_black)
.error(R.drawable.ic_map_black)
.into(rootView.imageMap)
} else {
rootView.imageMap.isVisible = false
}
Expand Down Expand Up @@ -529,7 +529,9 @@ class EventDetailsFragment : Fragment() {

val currentSocialLinks = eventViewModel.socialLinks.value
if (currentSocialLinks == null) {
currentEvent?.let { eventViewModel.fetchSocialLink(it.id) }
currentEvent?.let {
eventViewModel.fetchSocialLink(it.id)
}
} else {
socialLinkAdapter.addAll(currentSocialLinks)
rootView.socialLinkContainer.isVisible = currentSocialLinks.isNotEmpty()
Expand Down Expand Up @@ -602,7 +604,10 @@ class EventDetailsFragment : Fragment() {
currentEvent = it
} else {
EventUtils.showLoginToLikeDialog(requireContext(), layoutInflater, object : RedirectToLogin {
override fun goBackToLogin() { redirectToLogin() } }, it.originalImageUrl, it.name)
override fun goBackToLogin() {
redirectToLogin()
}
}, it.originalImageUrl, it.name)
}
}
true
Expand All @@ -620,8 +625,8 @@ class EventDetailsFragment : Fragment() {
}
R.id.code_of_conduct -> {
currentEvent?.let { event ->
findNavController(rootView)
.navigate(EventDetailsFragmentDirections.actionEventDetailsToConductCode(event.id))
findNavController(rootView)
.navigate(EventDetailsFragmentDirections.actionEventDetailsToConductCode(event.id))
}
return true
}
Expand Down Expand Up @@ -758,21 +763,23 @@ class EventDetailsFragment : Fragment() {
.show()
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = false
layout.feedback.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(p0: Editable?) {
override fun afterTextChanged(p0: Editable?) {

if (layout.feedback.text.toString().isNotEmpty()) {
layout.feedbackTextInputLayout.error = null
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true
layout.feedbackTextInputLayout.isErrorEnabled = false
} else {
layout.feedbackTextInputLayout.error = getString(R.string.cant_be_empty)
}
if (layout.feedback.text.toString().isNotEmpty()) {
layout.feedbackTextInputLayout.error = null
alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).isEnabled = true
layout.feedbackTextInputLayout.isErrorEnabled = false
} else {
layout.feedbackTextInputLayout.error = getString(R.string.cant_be_empty)
}
}

override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/ }
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/
}

override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/ }
})
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/
}
})
}

private fun moveToSponsorSection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class EventDetailsViewModel(
mutablePopMessage.value = resource.getString(R.string.error_submitting_feedback)
})
}

fun fetchEventSpeakers(id: Long) {
if (id == -1L) return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ class EventsFragment : Fragment(), BottomIconDoubleClick {
showEmptyMessage(eventsListAdapter.currentList?.isEmpty() ?: true)
})

eventsViewModel.progress
.nonNull()
eventsViewModel.progress.nonNull()
.observe(viewLifecycleOwner, Observer {
if (it) {
rootView.shimmerEvents.startShimmer()
Expand All @@ -132,6 +131,7 @@ class EventsFragment : Fragment(), BottomIconDoubleClick {
} else {
rootView.shimmerEvents.stopShimmer()
rootView.swiperefresh.isRefreshing = false
showEmptyMessage(eventsListAdapter.currentList?.isEmpty() ?: true)
}
rootView.shimmerEvents.isVisible = it
})
Expand Down Expand Up @@ -237,7 +237,7 @@ class EventsFragment : Fragment(), BottomIconDoubleClick {
val eventClickListener: EventClickListener = object : EventClickListener {
override fun onClick(eventID: Long, imageView: ImageView) {
findNavController(rootView).navigate(EventsFragmentDirections.actionEventsToEventsDetail(eventID),
FragmentNavigatorExtras(imageView to "eventDetailImage"))
FragmentNavigatorExtras(imageView to "eventDetailImage"))
}
}

Expand Down Expand Up @@ -297,11 +297,11 @@ class EventsFragment : Fragment(), BottomIconDoubleClick {
}

private fun openSearch(hashTag: String) {
findNavController(rootView).navigate(EventsFragmentDirections.actionEventsToSearchResults(
query = "",
location = Preference().getString(SAVED_LOCATION).toString(),
date = getString(R.string.anytime),
type = hashTag))
findNavController(rootView).navigate(EventsFragmentDirections.actionEventsToSearchResults(
query = "",
location = Preference().getString(SAVED_LOCATION).toString(),
date = getString(R.string.anytime),
type = hashTag))
}

private fun showNoInternetScreen(show: Boolean) {
Expand Down Expand Up @@ -363,9 +363,11 @@ class EventsFragment : Fragment(), BottomIconDoubleClick {
}
}

override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/ }
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/
}

override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/ }
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/
}
})

layout.confirmNewPassword.addTextChangedListener(object : TextWatcher {
Expand All @@ -392,9 +394,11 @@ class EventsFragment : Fragment(), BottomIconDoubleClick {
}
}

override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/ }
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/
}

override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/ }
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { /*Implement here*/
}
})
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@
<string name="provide_name_message">Please provide first name and last name!</string>
<string name="user_update_error_message">Error updating user!</string>
<string name="user_update_success_message">User updated successfully!</string>
<string name="error_fetching_event_section_message">"Error fetching %1$s for the event</string>
<string name="error_fetching_event_section_message">Error fetching %1$s for the event</string>
<string name="error_submitting_feedback">Fail on submitting the feedback</string>
<string name="error_fetching_feedback_message">Error getting feedback for this event</string>
<string name="no_feedback_message">There are no feedback for this event.</string>
Expand Down