Commit c822423f authored by wanglei's avatar wanglei

...

parent dc98af32
......@@ -25,7 +25,8 @@ import com.base.browserwhite.databinding.DialogMyAccountBinding
import com.base.browserwhite.databinding.DialogPermissonOpenBinding
import com.base.browserwhite.databinding.DialogSearchEngineBinding
import com.base.browserwhite.ui.adapter.DownloadAdapter
import com.base.browserwhite.ui.views.DialogViews.showMyAccountDialog
import com.base.browserwhite.utils.LogEx
import com.base.browserwhite.utils.XmlEx.inflate
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
......@@ -221,6 +222,7 @@ object DialogViews {
}
fun Context.showDownloadVideoDialog(list: List<DownloadBean>) {
val TAG = "DownloadVideoDialog"
val dialog = BottomSheetDialog(this)
val binding = DialogDownloadVideoBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
......@@ -236,6 +238,15 @@ object DialogViews {
val adapter = DownloadAdapter()
binding.rv.adapter = adapter
adapter.submitList(list)
val itemHeight = resources.getDimensionPixelOffset(R.dimen.dp_97)
LogEx.logDebug(TAG, "itemHeight=$itemHeight")
if (list.size > 3) {
val recyclerViewHeight: Int = 3 * itemHeight
binding.rv.layoutParams.height = recyclerViewHeight
binding.rv.requestLayout()
}
}
}
\ No newline at end of file
......@@ -44,12 +44,12 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginTop="16dp"
android:maxHeight="300dp"
android:layout_height="wrap_content"
android:layout_marginVertical="16dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_download_dir"
tools:itemCount="3"
tools:listitem="@layout/item_download_card" />
......
......@@ -12,4 +12,5 @@
<dimen name="dp_335">335dp</dimen>
<dimen name="dp_9">9dp</dimen>
<dimen name="dp_5">5dp</dimen>
<dimen name="dp_97">97dp</dimen>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment