|
|
|
@ -5,11 +5,8 @@ import android.net.Uri |
|
|
|
|
import android.os.Bundle |
|
|
|
|
import android.view.Menu |
|
|
|
|
import android.view.MenuItem |
|
|
|
|
import androidx.lifecycle.AndroidViewModel |
|
|
|
|
import io.legado.app.R |
|
|
|
|
import io.legado.app.base.BaseActivity |
|
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
|
import org.jetbrains.anko.toast |
|
|
|
|
|
|
|
|
|
class AboutActivity : BaseActivity(R.layout.activity_about) { |
|
|
|
@ -31,15 +28,15 @@ class AboutActivity : BaseActivity(R.layout.activity_about) { |
|
|
|
|
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { |
|
|
|
|
when (item.itemId) { |
|
|
|
|
R.id.menu_scoring -> { |
|
|
|
|
openIntent(Intent.ACTION_VIEW, "market://details?id=$packageName") |
|
|
|
|
openIntent("market://details?id=$packageName") |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return super.onCompatOptionsItemSelected(item) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun openIntent(intentName: String, address: String) { |
|
|
|
|
private fun openIntent(address: String) { |
|
|
|
|
try { |
|
|
|
|
val intent = Intent(intentName) |
|
|
|
|
val intent = Intent(Intent.ACTION_VIEW) |
|
|
|
|
intent.data = Uri.parse(address) |
|
|
|
|
startActivity(intent) |
|
|
|
|
} catch (e: Exception) { |
|
|
|
|