Fix details ui
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package org.koitharu.kotatsu.core.util.ext
|
||||
|
||||
import org.koitharu.kotatsu.core.io.NullOutputStream
|
||||
import java.io.ObjectOutputStream
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun <T> Class<T>.castOrNull(obj: Any?): T? {
|
||||
if (obj == null || !isInstance(obj)) {
|
||||
@@ -7,3 +10,9 @@ fun <T> Class<T>.castOrNull(obj: Any?): T? {
|
||||
}
|
||||
return obj as T
|
||||
}
|
||||
|
||||
fun Any.isSerializable() = runCatching {
|
||||
val oos = ObjectOutputStream(NullOutputStream())
|
||||
oos.writeObject(this)
|
||||
oos.flush()
|
||||
}.isSuccess
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.koitharu.kotatsu.core.exceptions.UnsupportedSourceException
|
||||
import org.koitharu.kotatsu.core.exceptions.WrapperIOException
|
||||
import org.koitharu.kotatsu.core.exceptions.WrongPasswordException
|
||||
import org.koitharu.kotatsu.core.exceptions.resolve.ExceptionResolver
|
||||
import org.koitharu.kotatsu.core.io.NullOutputStream
|
||||
import org.koitharu.kotatsu.parsers.ErrorMessages.FILTER_BOTH_LOCALE_GENRES_NOT_SUPPORTED
|
||||
import org.koitharu.kotatsu.parsers.ErrorMessages.FILTER_BOTH_STATES_GENRES_NOT_SUPPORTED
|
||||
import org.koitharu.kotatsu.parsers.ErrorMessages.FILTER_MULTIPLE_GENRES_NOT_SUPPORTED
|
||||
@@ -40,7 +39,6 @@ import org.koitharu.kotatsu.parsers.exception.ParseException
|
||||
import org.koitharu.kotatsu.parsers.exception.TooManyRequestExceptions
|
||||
import org.koitharu.kotatsu.parsers.util.ifNullOrEmpty
|
||||
import org.koitharu.kotatsu.scrobbling.common.domain.ScrobblerAuthRequiredException
|
||||
import java.io.ObjectOutputStream
|
||||
import java.net.ConnectException
|
||||
import java.net.NoRouteToHostException
|
||||
import java.net.SocketException
|
||||
@@ -223,9 +221,3 @@ fun Throwable.isWebViewUnavailable(): Boolean {
|
||||
|
||||
@Suppress("FunctionName")
|
||||
fun NoSpaceLeftException() = IOException(MSG_NO_SPACE_LEFT)
|
||||
|
||||
fun Throwable.isSerializable() = runCatching {
|
||||
val oos = ObjectOutputStream(NullOutputStream())
|
||||
oos.writeObject(this)
|
||||
oos.flush()
|
||||
}.isSuccess
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
android:padding="4dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textAppearanceBodyMedium"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_source_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/card_details"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
@@ -69,6 +70,7 @@
|
||||
android:padding="4dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textAppearanceBodyMedium"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_author_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/card_details"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
@@ -96,6 +98,7 @@
|
||||
android:drawablePadding="4dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textAppearanceBodyMedium"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_translation_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/card_details"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
@@ -153,6 +156,7 @@
|
||||
android:layout_marginEnd="@dimen/screen_padding"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textAppearanceBodyMedium"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_state_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/card_details"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
@@ -179,6 +183,7 @@
|
||||
android:layout_marginEnd="@dimen/screen_padding"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textAppearanceBodyMedium"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_chapters_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/card_details"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
@@ -207,6 +212,7 @@
|
||||
android:padding="4dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?textAppearanceBodyMedium"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/textView_local_label"
|
||||
app:layout_constraintEnd_toEndOf="@id/card_details"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
|
||||
Reference in New Issue
Block a user