diff --git a/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt b/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt index 920d2dcb..955cbbb3 100644 --- a/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt +++ b/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt @@ -2232,8 +2232,11 @@ object UiUtil { val tmp = list.toMutableList() tmp.addAll(0, defaultSourceTitles.mapIndexed { index, s -> "${s}___${defaultSourceValues[index]}" }) tmp.forEach { s -> - val title = s.split("___")[0] - val source = s.split("___")[1] + val arr = s.split("___") + if (arr.size < 2) return@forEach + + val title = arr[0] + val source = arr[1] val isEditable = !defaultSourceValues.contains(source) val child = LayoutInflater.from(context).inflate(R.layout.custom_ytdlp_source, null) child.findViewById(R.id.sampleCustomSource).setOnClickListener { diff --git a/app/src/main/res/layout/fragment_history.xml b/app/src/main/res/layout/fragment_history.xml index c8150ee6..75729f3c 100644 --- a/app/src/main/res/layout/fragment_history.xml +++ b/app/src/main/res/layout/fragment_history.xml @@ -28,7 +28,7 @@ android:layout_height="match_parent" android:orientation="vertical" app:layout_scrollFlags="scroll|enterAlways" - android:layout_margin="10dp"> + android:layout_marginHorizontal="10dp">