pull/66/head
parent
d3541b7e53
commit
b972679f6a
@ -1,27 +0,0 @@ |
|||||||
package io.legado.app.base |
|
||||||
|
|
||||||
import android.os.Bundle |
|
||||||
import androidx.preference.PreferenceFragmentCompat |
|
||||||
import kotlinx.coroutines.CoroutineScope |
|
||||||
import kotlinx.coroutines.Dispatchers |
|
||||||
import kotlinx.coroutines.Job |
|
||||||
import kotlin.coroutines.CoroutineContext |
|
||||||
|
|
||||||
|
|
||||||
abstract class BasePreferenceFragment : PreferenceFragmentCompat(), CoroutineScope { |
|
||||||
|
|
||||||
lateinit var job: Job |
|
||||||
|
|
||||||
override val coroutineContext: CoroutineContext |
|
||||||
get() = job + Dispatchers.Main |
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) { |
|
||||||
job = Job() |
|
||||||
super.onCreate(savedInstanceState) |
|
||||||
} |
|
||||||
|
|
||||||
override fun onDestroy() { |
|
||||||
super.onDestroy() |
|
||||||
job.cancel() |
|
||||||
} |
|
||||||
} |
|
@ -1,20 +1,18 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
android:orientation="vertical" |
android:orientation="vertical" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content" |
android:layout_height="wrap_content" |
||||||
android:padding="16dp"> |
android:padding="16dp"> |
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView |
<androidx.appcompat.widget.Toolbar |
||||||
android:id="@+id/recycler_view" |
android:id="@+id/tool_bar" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content" /> |
android:layout_height="wrap_content" /> |
||||||
|
|
||||||
<TextView |
<androidx.recyclerview.widget.RecyclerView |
||||||
android:id="@+id/tv_no_data" |
android:id="@+id/recycler_view" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content" |
android:layout_height="match_parent" /> |
||||||
android:padding="16dp" |
|
||||||
android:text="@string/fonts_folder" /> |
|
||||||
|
|
||||||
</FrameLayout> |
</LinearLayout> |
Loading…
Reference in new issue