diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt index 73293a824..6e1c98db2 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt @@ -11,7 +11,6 @@ import io.legado.app.help.http.HttpHelper import io.legado.app.help.storage.OldRule import io.legado.app.help.storage.Restore.jsonPath import io.legado.app.utils.* -import kotlinx.coroutines.Dispatchers import java.io.File class BookSourceViewModel(application: Application) : BaseViewModel(application) { @@ -131,7 +130,7 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) } fun importSource(text: String) { - execute(context = Dispatchers.Main) { + execute { val text1 = text.trim() if (text1.isJsonObject()) { val json = JsonPath.parse(text1) diff --git a/app/src/main/res/layout/item_1line_text_and_del.xml b/app/src/main/res/layout/item_1line_text_and_del.xml index 1b43e8d27..9bb5e9c2a 100644 --- a/app/src/main/res/layout/item_1line_text_and_del.xml +++ b/app/src/main/res/layout/item_1line_text_and_del.xml @@ -12,7 +12,8 @@ android:id="@+id/text_view" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" /> + android:layout_weight="1" + android:singleLine="true" />