1
0
Fork 0
mirror of https://github.com/Corewala/Buran synced 2024-12-21 23:32:40 +00:00

Made local home into about page

This commit is contained in:
Corewala 2022-06-21 15:06:19 -04:00
parent e4cc13bb03
commit f98756bebb
5 changed files with 21 additions and 158 deletions

View file

@ -46,7 +46,6 @@ import corewala.buran.ui.bookmarks.BookmarksDialog
import corewala.buran.ui.content_image.ImageDialog
import corewala.buran.ui.content_text.TextDialog
import corewala.buran.ui.gemtext_adapter.AbstractGemtextAdapter
import corewala.buran.ui.modals_menus.about.AboutDialog
import corewala.buran.ui.modals_menus.history.HistoryDialog
import corewala.buran.ui.modals_menus.overflow.OverflowPopup
import corewala.buran.ui.settings.SettingsActivity
@ -282,7 +281,7 @@ class GemActivity : AppCompatActivity() {
) { historyAddress ->
gemRequest(historyAddress)
}
R.id.overflow_menu_about -> AboutDialog.show(this)
R.id.overflow_menu_about -> gemRequest("")
R.id.overflow_menu_settings -> {
startActivity(Intent(this, SettingsActivity::class.java))
}
@ -840,13 +839,23 @@ class GemActivity : AppCompatActivity() {
loadingView(false)
binding.pullToRefresh.isRefreshing = false
val searchbase = prefs.getString(
"search_base",
Buran.DEFAULT_SEARCH_BASE
)
val searchLink = "=> $searchbase ${getString(R.string.search)}"
val title = "# ${getString(R.string.app_name)}"
adapter.render(listOf(title, searchLink))
val sourceLink = "=> https://github.com/Corewala/Buran ${getString(R.string.source)}"
adapter.render(listOf(
title,
"",
getString(R.string.about_body),
"",
getString(R.string.about_ariane_source),
"",
getString(R.string.about_font),
"",
getString(R.string.about_glyphs),
"",
sourceLink,
getString(R.string.copyright)
))
omniTerm.set("")
}
private fun isHostSigned(uri: URI): Boolean{

View file

@ -1,45 +0,0 @@
package corewala.buran.ui.modals_menus.about
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Handler
import android.os.Looper
import android.view.View
import androidx.appcompat.app.AppCompatDialog
import androidx.appcompat.widget.AppCompatTextView
import kotlinx.android.synthetic.main.dialog_about.view.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import corewala.buran.R
import kotlinx.android.synthetic.main.dialog_content_text.view.*
import java.lang.StringBuilder
import java.security.SecureRandom
import java.security.Security
import javax.net.ssl.SSLContext
import javax.net.ssl.SSLSocket
import javax.net.ssl.SSLSocketFactory
object AboutDialog {
fun show(context: Context){
val dialog = AppCompatDialog(context, R.style.AppTheme)
val view = View.inflate(context, R.layout.dialog_about, null)
dialog.setContentView(view)
view.about_toolbar.setNavigationIcon(R.drawable.vector_close)
view.about_toolbar.setNavigationOnClickListener {
dialog.dismiss()
}
view.source_button.setOnClickListener {
context.startActivity(Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse("https://github.com/Corewala/Buran")
})
}
dialog.show()
}
}

View file

@ -1,103 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.appcompat.widget.Toolbar
android:id="@+id/about_toolbar"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_margin"
android:layout_height="@dimen/bar_height"
app:title="@string/about"/>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/about_toolbar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/default_margin_big"
android:paddingRight="@dimen/default_margin_big"
android:paddingBottom="@dimen/default_margin_big"
android:orientation="vertical">
<!-- Description -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="@dimen/default_margin_big"
android:textColor="@color/stroke"
android:text="@string/about_body"/>
<!-- Version -->
<TextView
android:id="@+id/version_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/stroke"
tools:text="1.0.0 alpha delta"/>
<!-- Copyright -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/default_margin"
android:textColor="@color/stroke"
android:text="@string/copyright"/>
<!-- Source button -->
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/source_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Source"/>
<!-- DIV -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/default_margin"
android:layout_marginTop="@dimen/default_margin"
android:alpha="0.5"
android:background="?attr/colorOnSurface" />
<!-- Ariane source attribution-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/default_margin"
android:textColor="@color/stroke"
android:text="@string/about_ariane_source"/>
<!-- Font Attribution -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/default_margin"
android:textColor="@color/stroke"
android:text="@string/about_font"/>
<!-- Glyph Attribution -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/default_margin"
android:textColor="@color/stroke"
android:text="@string/about_glyphs"/>
<!-- DIV -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="@dimen/default_margin"
android:layout_marginTop="@dimen/default_margin"
android:alpha="0.5"
android:background="?attr/colorOnSurface" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>

View file

@ -11,11 +11,12 @@
<string name="share">Partager</string>
<string name="set_home">Choisir comme Accueil</string>
<string name="settings">Paramètres</string>
<string name="about_body">Bourane: Un navigateur minimaliste pour le protocole Gemini par Corewala</string>
<string name="about_body">Un navigateur minimaliste pour le protocole Gemini par Corewala</string>
<string name="copyright">Copyright © 2022 Corewala</string>
<string name="about_ariane_source">Bourane est basé sur le navigateur Ariane d\'ÖLAB sous la Licence Publique de l\'Union Européenne</string>
<string name="about_font">Les blocs de code sont rendus avec JetBrains Mono de JetBrains</string>
<string name="about_glyphs">Les glyphes utilisés proviennent de Material Icons par Google</string>
<string name="source">Source</string>
<string name="clear_cache">Vider le cache d\'exécution</string>
<string name="history">Historique</string>
<string name="clear_history">Vider l\'historique</string>

View file

@ -11,11 +11,12 @@
<string name="share">Share</string>
<string name="set_home">Set Home</string>
<string name="settings">Settings</string>
<string name="about_body">Buran: A simple Gemini protocol browser from Corewala</string>
<string name="about_body">A simple Gemini protocol browser from Corewala</string>
<string name="copyright">Copyright © 2022 Corewala</string>
<string name="about_ariane_source">Buran is based on the Ariane browser by ÖLAB under the European Union Public Licence</string>
<string name="about_font">Code blocks are rendered using JetBrains Mono by JetBrains</string>
<string name="about_glyphs">Glyphs used are from Material Icons by Google</string>
<string name="source">Source</string>
<string name="clear_cache">Clear runtime cache</string>
<string name="history">History</string>
<string name="clear_history">Clear history</string>