mirror of
https://github.com/izzy2lost/Super3.git
synced 2026-07-05 15:18:38 -07:00
add about to app
This commit is contained in:
@@ -3,6 +3,8 @@ package com.izzy2lost.super3
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.text.method.LinkMovementMethod
|
||||
import android.text.util.Linkify
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -40,6 +42,7 @@ class MainActivity : AppCompatActivity() {
|
||||
private lateinit var searchBar: SearchBar
|
||||
private lateinit var searchView: SearchView
|
||||
private lateinit var btnViewMode: ImageButton
|
||||
private lateinit var btnAbout: MaterialButton
|
||||
|
||||
private lateinit var gamesFolderText: TextView
|
||||
private lateinit var userFolderText: TextView
|
||||
@@ -130,6 +133,7 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
// Get views from the navigation header
|
||||
val headerView = navigationView.getHeaderView(0)
|
||||
btnAbout = headerView.findViewById(R.id.btn_about)
|
||||
gamesFolderText = headerView.findViewById(R.id.games_folder_text)
|
||||
userFolderText = headerView.findViewById(R.id.user_folder_text)
|
||||
statusText = headerView.findViewById(R.id.status_text)
|
||||
@@ -159,6 +163,11 @@ class MainActivity : AppCompatActivity() {
|
||||
drawerLayout.openDrawer(GravityCompat.START)
|
||||
}
|
||||
|
||||
btnAbout.setOnClickListener {
|
||||
drawerLayout.closeDrawer(GravityCompat.START)
|
||||
showAboutDialog()
|
||||
}
|
||||
|
||||
btnPickGamesFolder.setOnClickListener { pickGamesFolder.launch(null) }
|
||||
btnPickUserFolder.setOnClickListener { pickUserFolder.launch(null) }
|
||||
btnRescan.setOnClickListener { refreshUi() }
|
||||
@@ -233,6 +242,38 @@ class MainActivity : AppCompatActivity() {
|
||||
refreshUi()
|
||||
}
|
||||
|
||||
private fun showAboutDialog() {
|
||||
val view = layoutInflater.inflate(R.layout.dialog_about, null)
|
||||
val aboutText: TextView = view.findViewById(R.id.about_text)
|
||||
aboutText.text =
|
||||
"""
|
||||
SUPER3 is an open-source Sega Model 3 emulator for Android.
|
||||
|
||||
Sources used:
|
||||
https://github.com/trzy/Supermodel
|
||||
https://github.com/DirtBagXon/model3emu-code-sinden/tree/arm
|
||||
|
||||
License (GPLv3):
|
||||
https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
|
||||
App source code:
|
||||
https://github.com/izzy2lost/Super3
|
||||
|
||||
Disclaimers:
|
||||
- No games/ROMs/BIOS included.
|
||||
- Not affiliated with or endorsed by SEGA.
|
||||
""".trimIndent()
|
||||
|
||||
Linkify.addLinks(aboutText, Linkify.WEB_URLS)
|
||||
aboutText.movementMethod = LinkMovementMethod.getInstance()
|
||||
|
||||
MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.about_title)
|
||||
.setView(view)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
applyImmersiveMode()
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="20dp">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/about_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:linksClickable="true"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:textAppearance="?attr/textAppearanceBodyMedium"
|
||||
android:textColor="?attr/colorOnSurface"
|
||||
android:textIsSelectable="true" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -157,5 +157,13 @@
|
||||
android:textColor="?attr/colorOnPrimary"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_about"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/about"
|
||||
style="?attr/materialButtonElevatedStyle" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<resources>
|
||||
<string name="app_name">SUPER3</string>
|
||||
<string name="about">About</string>
|
||||
<string name="about_title">About SUPER3</string>
|
||||
<string name="game_menu_save_state">Save state</string>
|
||||
<string name="game_menu_exit_game">Exit game</string>
|
||||
<string name="save_state_dialog_title">Save states</string>
|
||||
|
||||
Reference in New Issue
Block a user