Skip to content
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

Fix: Cancel button in file deletion dialog not visible in dark mode #341

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/src/main/java/crux/bphc/cms/fragments/FilesFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class FilesFragment : Fragment() {
MaterialAlertDialogBuilder(requireContext())
.setTitle(getString(R.string.delete_file_dialog_title, fileType))
.setMessage(getString(R.string.delete_file_dialog_message, fileType, file.getFormattedFileSize(requireContext())))
.setNeutralButton(R.string.delete_file_dialog_neutral) { _, _ -> /* Do nothing */ }
.setNegativeButton(R.string.delete_file_dialog_neutral) { _, _ -> /* Do nothing */ }
.setPositiveButton(R.string.delete_file_dialog_positive) { _, _ -> viewModel.deleteFile(file) }
.show()

Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/crux/bphc/cms/fragments/ForumFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ class ForumFragment : Fragment() {
realm.close()

CoroutineScope(Dispatchers.Main).launch {

if (discussions.size == 0) {
emptyView.text = if (forumId != -1) getString(R.string.no_announcements) else getString(R.string.no_posts_to_display)
emptyView.visibility = View.VISIBLE
} else {
mAdapter.clearDiscussions()
mAdapter.addDiscussions(discussions)
}

mAdapter.clearDiscussions()
mAdapter.addDiscussions(discussions)
swipeRefresh.isRefreshing = false
Expand All @@ -121,7 +130,9 @@ class ForumFragment : Fragment() {
val realmDiscussions = courseDataHandler.getForumDiscussions(forumId)
val discussions = realm.copyFromRealm(realmDiscussions)
CoroutineScope(Dispatchers.Main).launch {

if (discussions.size == 0) {
emptyView.text = if (forumId != -1) getString(R.string.no_announcements) else getString(R.string.no_posts_to_display)
emptyView.visibility = View.VISIBLE
Toast
.makeText(context, getString(R.string.no_cached_data), Toast.LENGTH_SHORT)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<string name="failed_course_content_refresh">Failed to load course content.\nTap to retry.</string>

<!-- Forum posts and Discussions -->
<string name="no_announcements">No Announcements</string>
<string name="no_posts_to_display">No Forum posts to display</string>
<string name="discussion_attachments">Attachment(s)</string>
<string name="pinned_discussion">Pinned Discussion</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@
</style>

<style name="AlertDialog.Button.Positive" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:textColor">?textButtonColor</item>1
<item name="android:textColor">?textButtonColor</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">14sp</item>
</style>

<style name="AlertDialog.Button.Negative" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:textColor">?textButtonColor</item>1
<item name="android:textColor">?textButtonColor</item>
<item name="android:textAllCaps">false</item>
<item name="android:textSize">14sp</item>
</style>
Expand Down