File tree Expand file tree Collapse file tree
src/main/java/info/hannes/logcat/base Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ android {
1616}
1717
1818dependencies {
19+ implementation " androidx.core:core-ktx:1.3.2"
1920 implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version "
2021 implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3"
2122 implementation " androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import android.view.*
1212import android.widget.CompoundButton
1313import androidx.appcompat.widget.SearchView
1414import androidx.core.content.FileProvider
15+ import androidx.core.view.doOnLayout
1516import androidx.fragment.app.Fragment
1617import androidx.lifecycle.coroutineScope
1718import androidx.recyclerview.widget.LinearLayoutManager
@@ -50,6 +51,11 @@ abstract class LogBaseFragment : Fragment() {
5051 it.layoutManager = LinearLayoutManager (it.context)
5152 it.recycledViewPool.setMaxRecycledViews(R .layout.item_log, DEFAULT_MAX_SCRAP )
5253 }
54+
55+ logsRecycler.doOnLayout {
56+ it.minimumWidth = (it.parent as ViewGroup ).width
57+ }
58+
5359 // empty adapter to avoid "E/RecyclerView﹕ No adapter attached; skipping layou..."
5460 logListAdapter = LogListAdapter (mutableListOf (), currentFilter).also {
5561 it.stateRestorationPolicy = RecyclerView .Adapter .StateRestorationPolicy .PREVENT_WHEN_EMPTY
You can’t perform that action at this time.
0 commit comments