diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ATEStockSwitch.kt b/app/src/main/java/io/legado/app/lib/theme/view/ATEStockSwitch.kt deleted file mode 100644 index d80e3a766..000000000 --- a/app/src/main/java/io/legado/app/lib/theme/view/ATEStockSwitch.kt +++ /dev/null @@ -1,35 +0,0 @@ -package io.legado.app.lib.theme.view - -import android.content.Context -import android.util.AttributeSet -import android.view.View -import android.widget.Switch -import androidx.appcompat.widget.SwitchCompat -import io.legado.app.lib.theme.ATH -import io.legado.app.lib.theme.ThemeStore - -/** - * @author Aidan Follestad (afollestad) - */ -class ATEStockSwitch : SwitchCompat { - - constructor(context: Context) : super(context) { - init(context, null) - } - - constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { - init(context, attrs) - } - - constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) { - init(context, attrs) - } - - private fun init(context: Context, attrs: AttributeSet?) { - ATH.setTint(this, ThemeStore.accentColor(context)) - } - - override fun isShown(): Boolean { - return parent != null && visibility == View.VISIBLE - } -} diff --git a/app/src/main/java/io/legado/app/ui/main/booksource/BookSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/main/booksource/BookSourceAdapter.kt index 50d830706..110adea2c 100644 --- a/app/src/main/java/io/legado/app/ui/main/booksource/BookSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/booksource/BookSourceAdapter.kt @@ -1,8 +1,10 @@ package io.legado.app.ui.main.booksource import android.view.LayoutInflater +import android.view.Menu import android.view.View import android.view.ViewGroup +import android.widget.PopupMenu import androidx.paging.PagedListAdapter import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView @@ -52,6 +54,30 @@ class BookSourceAdapter : PagedListAdapter{ + callback?.edit(bookSource) + true} + R.id.menu_del ->{ + callback?.del(bookSource) + true} + R.id.menu_top ->{ true} + else -> {false} + } + } + popupMenu.show() + } } } diff --git a/app/src/main/res/layout/item_book_source.xml b/app/src/main/res/layout/item_book_source.xml index deadf724c..0c185faf5 100644 --- a/app/src/main/res/layout/item_book_source.xml +++ b/app/src/main/res/layout/item_book_source.xml @@ -1,73 +1,35 @@ - - + + - - - - - - - - - - - - - - - - + android:layout_gravity="center" + android:layout_weight="1" + android:singleLine="true" + android:text="" + android:textColor="@color/tv_text_default"/> + + + + \ No newline at end of file diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml index 0d2c4cc40..341c5b250 100644 --- a/app/src/main/res/values/ids.xml +++ b/app/src/main/res/values/ids.xml @@ -1,4 +1,7 @@ + + + \ No newline at end of file