|
|
|
@ -1,7 +1,6 @@ |
|
|
|
|
package io.legado.app.ui.book.source.manage |
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
|
|
import android.content.Intent |
|
|
|
|
import android.os.Bundle |
|
|
|
|
import android.view.Menu |
|
|
|
|
import android.view.MenuItem |
|
|
|
@ -9,13 +8,11 @@ import android.view.SubMenu |
|
|
|
|
import androidx.activity.viewModels |
|
|
|
|
import androidx.appcompat.widget.PopupMenu |
|
|
|
|
import androidx.appcompat.widget.SearchView |
|
|
|
|
import androidx.core.content.FileProvider |
|
|
|
|
import androidx.core.os.bundleOf |
|
|
|
|
import androidx.recyclerview.widget.ItemTouchHelper |
|
|
|
|
import com.google.android.material.snackbar.Snackbar |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
|
import io.legado.app.constant.AppConst |
|
|
|
|
import io.legado.app.constant.AppPattern |
|
|
|
|
import io.legado.app.constant.EventBus |
|
|
|
|
import io.legado.app.data.appDb |
|
|
|
@ -124,18 +121,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV |
|
|
|
|
R.id.menu_add_book_source -> startActivity<BookSourceEditActivity>() |
|
|
|
|
R.id.menu_import_qr -> qrResult.launch(null) |
|
|
|
|
R.id.menu_share_source -> viewModel.saveToFile(adapter.selection) { |
|
|
|
|
val fileUri = FileProvider.getUriForFile(this, AppConst.authority, it) |
|
|
|
|
val intent = Intent(Intent.ACTION_SEND) |
|
|
|
|
intent.type = "text/*" |
|
|
|
|
intent.putExtra(Intent.EXTRA_STREAM, fileUri) |
|
|
|
|
intent.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION |
|
|
|
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) |
|
|
|
|
startActivity( |
|
|
|
|
Intent.createChooser( |
|
|
|
|
intent, |
|
|
|
|
getString(R.string.share_selected_source) |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
share(it) |
|
|
|
|
} |
|
|
|
|
R.id.menu_group_manage -> showDialogFragment<GroupManageDialog>() |
|
|
|
|
R.id.menu_import_local -> importDoc.launch { |
|
|
|
|