added FAQ button
This commit is contained in:
parent
efa9ec7bc6
commit
351f849da8
|
@ -1,8 +1,10 @@
|
|||
package com.vanced.manager.ui
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
@ -111,6 +113,19 @@ class MainActivity : AppCompatActivity() {
|
|||
navHost.navigate(HomeFragmentDirections.toLogFragment())
|
||||
true
|
||||
}
|
||||
R.id.toolbar_faq -> {
|
||||
try {
|
||||
startActivity(
|
||||
Intent(Intent.ACTION_VIEW).apply {
|
||||
data = Uri.parse("https://play.google.com/store/apps/details?id=com.vanced.faq")
|
||||
setPackage("com.android.vending")
|
||||
}
|
||||
)
|
||||
true
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
false
|
||||
}
|
||||
}
|
||||
R.id.toolbar_update_manager -> {
|
||||
ManagerUpdateDialog.newInstance(false).show(supportFragmentManager, "manager_update")
|
||||
true
|
||||
|
|
|
@ -1,28 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/toolbar_settings"
|
||||
android:title="@string/title_settings"
|
||||
android:icon="@drawable/ic_settings_black_24dp"
|
||||
app:showAsAction="withText" />
|
||||
android:title="@string/title_settings" />
|
||||
|
||||
<item
|
||||
android:id="@+id/toolbar_update_manager"
|
||||
android:title="@string/update_manager"
|
||||
app:showAsAction="withText" />
|
||||
android:title="@string/update_manager" />
|
||||
|
||||
<item
|
||||
android:id="@+id/toolbar_about"
|
||||
android:title="@string/title_about"
|
||||
android:icon="@drawable/ic_info_black_24dp"
|
||||
app:showAsAction="withText" />
|
||||
android:title="@string/title_about" />
|
||||
|
||||
<item
|
||||
android:id="@+id/toolbar_log"
|
||||
android:title="@string/title_logs"
|
||||
android:icon="@drawable/ic_info_black_24dp"
|
||||
app:showAsAction="withText" />
|
||||
android:title="@string/title_logs" />
|
||||
|
||||
<item
|
||||
android:id="@+id/toolbar_faq"
|
||||
android:title="@string/title_faq" />
|
||||
|
||||
</menu>
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
<!-- Main Activity -->
|
||||
<string name="title_about">About</string>
|
||||
<string name="title_faq">FAQ</string>
|
||||
<string name="title_logs">Logs</string>
|
||||
<string name="title_home">Manager</string>
|
||||
<string name="title_settings">Settings</string>
|
||||
|
|
Loading…
Reference in New Issue