dsiable scrolling on appbar if no tabs where added to media fragment
fixes #33
This commit is contained in:
		| @ -13,6 +13,7 @@ import androidx.fragment.app.activityViewModels | ||||
| import androidx.viewpager2.adapter.FragmentStateAdapter | ||||
| import com.bumptech.glide.Glide | ||||
| import com.bumptech.glide.request.RequestOptions | ||||
| import com.google.android.material.appbar.AppBarLayout | ||||
| import com.google.android.material.tabs.TabLayoutMediator | ||||
| import jp.wasabeef.glide.transformations.BlurTransformation | ||||
| import kotlinx.coroutines.* | ||||
| @ -23,6 +24,7 @@ import org.mosad.teapod.ui.activity.main.viewmodel.MediaFragmentViewModel | ||||
| import org.mosad.teapod.util.* | ||||
| import org.mosad.teapod.util.DataTypes.MediaType | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * The media detail fragment. | ||||
|  * Note: the fragment is created only once, when selecting a similar title etc. | ||||
| @ -147,6 +149,12 @@ class MediaFragment(private val mediaId: Int) : Fragment() { | ||||
|             pagerAdapter.notifyDataSetChanged() | ||||
|         } | ||||
|  | ||||
|         // disable scrolling on appbar, if no tabs where added | ||||
|         if(fragments.isEmpty()) { | ||||
|             val params = binding.linearMedia.layoutParams as AppBarLayout.LayoutParams | ||||
|             params.scrollFlags = 0 // clear all scroll flags | ||||
|         } | ||||
|  | ||||
|         binding.frameLoading.visibility = View.GONE // hide loading indicator | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -18,6 +18,7 @@ | ||||
|             android:background="?themePrimary"> | ||||
|  | ||||
|             <LinearLayout | ||||
|                 android:id="@+id/linear_media" | ||||
|                 android:layout_width="match_parent" | ||||
|                 android:layout_height="wrap_content" | ||||
|                 android:orientation="vertical" | ||||
|  | ||||
		Reference in New Issue
	
	Block a user