mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
fix: submit segment dialog closes when there are no segments yet
This commit is contained in:
parent
81bdd71558
commit
a47eac5352
@ -5,9 +5,9 @@ import android.os.Bundle
|
|||||||
import android.text.format.DateUtils
|
import android.text.format.DateUtils
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import androidx.core.view.isGone
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import com.github.libretube.BuildConfig
|
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
import com.github.libretube.api.JsonHelper
|
import com.github.libretube.api.JsonHelper
|
||||||
import com.github.libretube.api.RetrofitInstance
|
import com.github.libretube.api.RetrofitInstance
|
||||||
@ -148,7 +148,7 @@ class SubmitSegmentDialog : DialogFragment() {
|
|||||||
val binding = _binding ?: return@withContext
|
val binding = _binding ?: return@withContext
|
||||||
|
|
||||||
if (segments.isEmpty()) {
|
if (segments.isEmpty()) {
|
||||||
dismiss()
|
binding.voteSegmentContainer.isGone = true
|
||||||
Toast.makeText(context, R.string.no_segments_found, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, R.string.no_segments_found, Toast.LENGTH_SHORT).show()
|
||||||
return@withContext
|
return@withContext
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,12 @@
|
|||||||
android:paddingHorizontal="15dp"
|
android:paddingHorizontal="15dp"
|
||||||
android:paddingTop="15dp">
|
android:paddingTop="15dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/create_segment_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -63,10 +69,18 @@
|
|||||||
android:drawableStart="@drawable/ic_copy"
|
android:drawableStart="@drawable/ic_copy"
|
||||||
android:text="@string/sb_create_segment" />
|
android:text="@string/sb_create_segment" />
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/vote_segment_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/vote_for_segment"
|
android:text="@string/vote_for_segment"
|
||||||
android:textSize="24sp" />
|
android:textSize="24sp" />
|
||||||
|
|
||||||
@ -115,3 +129,5 @@
|
|||||||
android:text="@string/vote_for_segment" />
|
android:text="@string/vote_for_segment" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user