Skip to content

Commit

Permalink
Miscellaneous minor bug fixes (#353)
Browse files Browse the repository at this point in the history
* Use fullName instead of shortName for courses

TTD has asked us to use fullNames of courses instead of shortNames as they only put in course IDs in shortName, hence the change was necessary

* Add pptx mimeType to render PPT drawable for pptx files

* Remove bottom constraint in forum attachment row

This change was made to keep consistency with the textView which is also not constrained to the barrier below
  • Loading branch information
JustAGhost23 authored Feb 24, 2024
1 parent 1f52507 commit b849ebf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/crux/bphc/cms/models/course/Course.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ open class Course(
@Ignore var courseName: Array<String> = emptyArray() // The entire courseName
get() {
if (_courseName == null) {
val courseName = shortName
val courseName = fullName
// Specifies the string pattern which is to be searched
val pattern = Pattern.compile(NAME_REGEX, Pattern.MULTILINE)
val matcher = pattern.matcher(courseName)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/crux/bphc/cms/utils/FileUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object FileUtils {
"application/pdf" -> R.drawable.file_pdf
"application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -> R.drawable.file_excel
"application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" -> R.drawable.file_word
"application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.template", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "application/vnd.oasis.opendocument.presentation" -> R.drawable.file_powerpoint
"application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.presentationml.template", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "application/vnd.oasis.opendocument.presentation" -> R.drawable.file_powerpoint
else -> R.drawable.ic_document_unknown_type
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/row_attachment_detail_forum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@

app:layout_constraintStart_toEndOf="@id/name"
app:layout_constraintEnd_toStartOf="@+id/more"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="@id/barrier"/>
app:layout_constraintTop_toTopOf="parent" />

<View
android:id="@+id/click_wrapper"
Expand Down

0 comments on commit b849ebf

Please sign in to comment.