Skip to content

Commit

Permalink
bump material to 1.10.0 & make compiler happy
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff committed Oct 6, 2023
1 parent 628eb43 commit bbc282d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 13 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ android {
}
}

// https://discuss.gradle.org/t/what-is-xlint-deprecation-and-how-to-use-it/40270
tasks.withType<JavaCompile> {
options.compilerArgs.add("-Xlint:deprecation")
}

dependencies {

implementation(libs.core.ktx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import retrofit2.Converter
import retrofit2.Retrofit
import java.lang.reflect.Type

@Suppress("Unchecked_Cast")
class WebAPIResultConverter(
private val gson: Gson,
val type: Type
Expand All @@ -24,7 +25,7 @@ class WebAPIResultConverter(

override fun convert(value: ResponseBody): Any {
val jsonReader = gson.newJsonReader(value.charStream())
return value.use { v ->
return value.use { _ ->
val result = adapter.read(jsonReader)
if (jsonReader.peek() != JsonToken.END_DOCUMENT) {
throw JsonIOException("JSON document was not fully consumed.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ class ForumFragment : BaseFragment() {
binding.forumDesc.text = it.desc
binding.forumAvatar.displayImage(it.avatarUrl)
binding.forumAvatar.setOnClickListener { _ ->
if (it.avatarUrl != null) {
photoViewModel.currentIndex.value = 0
photoViewModel.photos = listOf(Photo(it.avatarUrl, 0, "rotieba"))
findNavController().navigate(MobileNavigationDirections.viewPhotos())
}
photoViewModel.currentIndex.value = 0
photoViewModel.photos = listOf(Photo(it.avatarUrl, 0, "rotieba"))
findNavController().navigate(MobileNavigationDirections.viewPhotos())
}
if (!viewModel.historyAdded) {
updateHistory()
Expand Down Expand Up @@ -182,7 +180,7 @@ class ForumFragment : BaseFragment() {
}
binding.orderButton.apply {
viewModel.forumSortType.observe(viewLifecycleOwner) { sort ->
text = when (sort) {
text = when (sort!!) {
ForumSortType.REPLY_TIME -> getString(R.string.sort_by_reply_time)
ForumSortType.CREATE_TIME -> getString(R.string.sort_by_create_time)
}
Expand Down Expand Up @@ -218,7 +216,7 @@ class ForumFragment : BaseFragment() {
id = forumInfo.id.toString(),
time = System.currentTimeMillis(),
forumName = forumInfo.name,
forumAvatar = forumInfo.avatarUrl!!
forumAvatar = forumInfo.avatarUrl
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class SearchFragment : BaseFragment() {
}

private fun performSearch(t: String, tab: Int) {
binding.searchBar.text = t
binding.searchBar.setText(t)
viewModel.currentKeyword = t
binding.searchView.hide()
if (tab >= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,6 @@ class ThreadFragment : BaseFragment() {
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
}

else -> {}
}
}
addTextView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ object PhotoUtils {
}
}

@Suppress("deprecation")
private fun savePreQ(context: Context, fileName: String, input: InputStream, isVideo: Boolean) {
val imagesDir =
Environment.getExternalStoragePublicDirectory(if (isVideo) Environment.DIRECTORY_MOVIES else Environment.DIRECTORY_PICTURES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.view.View
import android.widget.FrameLayout
import java.lang.ref.WeakReference

@Suppress("Unchecked_Cast")
class ItemView : FrameLayout {
data class ContextMenuInfo(
val data: Any?,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_forum_thread_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/thread_title" />

<androidx.legacy.widget.Space
<Space
android:layout_height="4dp"
android:layout_width="match_parent"
android:id="@+id/image_space"
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
appcompat = "1.6.1"
material = "1.9.0"
material = "1.10.0"
constraintlayout = "2.1.4"
lifecycle-livedata-ktx = "2.6.2"
lifecycle-viewmodel-ktx = "2.6.2"
Expand Down

0 comments on commit bbc282d

Please sign in to comment.