Compare commits
9 commits
1f2be8cdee
...
636a096d6f
Author | SHA1 | Date | |
---|---|---|---|
dece | 636a096d6f | ||
dece | 3190d608ca | ||
dece | 30d7ce72b8 | ||
dece | 117c70100f | ||
dece | 9c0603cf67 | ||
dece | e8283d2ed4 | ||
dece | 2b694a0bc1 | ||
dece | 54db4e17a6 | ||
dece | caa6f03e20 |
|
@ -47,9 +47,10 @@ android {
|
||||||
dependencies {
|
dependencies {
|
||||||
def nav_version = "2.3.5"
|
def nav_version = "2.3.5"
|
||||||
def room_version = "2.4.1"
|
def room_version = "2.4.1"
|
||||||
implementation 'androidx.core:core-ktx:1.7.0'
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
implementation "androidx.cardview:cardview:1.0.0"
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||||
|
implementation 'androidx.core:core-ktx:1.7.0'
|
||||||
implementation 'androidx.fragment:fragment-ktx:1.4.0'
|
implementation 'androidx.fragment:fragment-ktx:1.4.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
@ -59,7 +60,6 @@ dependencies {
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation "androidx.room:room-runtime:$room_version"
|
implementation "androidx.room:room-runtime:$room_version"
|
||||||
implementation "androidx.room:room-ktx:$room_version"
|
implementation "androidx.room:room-ktx:$room_version"
|
||||||
implementation "androidx.cardview:cardview:1.0.0"
|
|
||||||
implementation 'com.google.android.material:material:1.5.0'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
kapt "androidx.room:room-compiler:$room_version"
|
kapt "androidx.room:room-compiler:$room_version"
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
|
@ -55,17 +55,16 @@ fun parseData(
|
||||||
/** Parse a single line into a Line object. */
|
/** Parse a single line into a Line object. */
|
||||||
private fun parseLine(line: CharBuffer, isPreformatted: Boolean): Line =
|
private fun parseLine(line: CharBuffer, isPreformatted: Boolean): Line =
|
||||||
when {
|
when {
|
||||||
|
line.startsWith("```") -> PreFenceLine(getCharsFrom(line, 3))
|
||||||
|
isPreformatted -> PreTextLine(line.toString())
|
||||||
line.startsWith("###") -> TitleLine(3, getCharsFrom(line, 3))
|
line.startsWith("###") -> TitleLine(3, getCharsFrom(line, 3))
|
||||||
line.startsWith("##") -> TitleLine(2, getCharsFrom(line, 2))
|
line.startsWith("##") -> TitleLine(2, getCharsFrom(line, 2))
|
||||||
line.startsWith("#") -> TitleLine(1, getCharsFrom(line, 1))
|
line.startsWith("#") -> TitleLine(1, getCharsFrom(line, 1))
|
||||||
line.startsWith("```") -> PreFenceLine(getCharsFrom(line, 3))
|
|
||||||
line.startsWith("* ") -> ListItemLine(getCharsFrom(line, 2))
|
line.startsWith("* ") -> ListItemLine(getCharsFrom(line, 2))
|
||||||
line.startsWith(">") -> getCharsFrom(line, 1) // eh empty lines in quotes…
|
line.startsWith(">") -> BlockquoteLine(getCharsFrom(line, 1))
|
||||||
.run { if (isBlank()) EmptyLine() else BlockquoteLine(this) }
|
|
||||||
line.startsWith("=>") -> getCharsFrom(line, 2)
|
line.startsWith("=>") -> getCharsFrom(line, 2)
|
||||||
.split(" ", "\t", limit = 2)
|
.split(" ", "\t", limit = 2)
|
||||||
.run { LinkLine(get(0), if (size == 2) get(1).trimStart() else "") }
|
.run { LinkLine(get(0), if (size == 2) get(1).trimStart() else "") }
|
||||||
isPreformatted -> PreTextLine(line.toString())
|
|
||||||
line.isEmpty() -> EmptyLine()
|
line.isEmpty() -> EmptyLine()
|
||||||
else -> ParagraphLine(line.toString())
|
else -> ParagraphLine(line.toString())
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import dev.lowrespalmtree.comet.History.HistoryEntry
|
import dev.lowrespalmtree.comet.History.HistoryEntry
|
||||||
import dev.lowrespalmtree.comet.databinding.FragmentHistoryItemBinding
|
import dev.lowrespalmtree.comet.databinding.FragmentHistoryItemBinding
|
||||||
|
|
||||||
class HistoryItemAdapter(private val listener: HistoryItemAdapterListener) :
|
class HistoryAdapter(private val listener: HistoryItemAdapterListener) :
|
||||||
RecyclerView.Adapter<HistoryItemAdapter.ViewHolder>() {
|
RecyclerView.Adapter<HistoryAdapter.ViewHolder>() {
|
||||||
private var items = listOf<HistoryEntry>()
|
private var items = listOf<HistoryEntry>()
|
||||||
|
|
||||||
interface HistoryItemAdapterListener {
|
interface HistoryItemAdapterListener {
|
|
@ -14,7 +14,7 @@ import androidx.lifecycle.viewModelScope
|
||||||
import androidx.navigation.fragment.findNavController
|
import androidx.navigation.fragment.findNavController
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import dev.lowrespalmtree.comet.History.HistoryEntry
|
import dev.lowrespalmtree.comet.History.HistoryEntry
|
||||||
import dev.lowrespalmtree.comet.HistoryItemAdapter.HistoryItemAdapterListener
|
import dev.lowrespalmtree.comet.HistoryAdapter.HistoryItemAdapterListener
|
||||||
import dev.lowrespalmtree.comet.databinding.FragmentHistoryListBinding
|
import dev.lowrespalmtree.comet.databinding.FragmentHistoryListBinding
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
@ -24,7 +24,7 @@ import kotlinx.coroutines.launch
|
||||||
class HistoryFragment : Fragment(), HistoryItemAdapterListener {
|
class HistoryFragment : Fragment(), HistoryItemAdapterListener {
|
||||||
private val vm: HistoryViewModel by viewModels()
|
private val vm: HistoryViewModel by viewModels()
|
||||||
private lateinit var binding: FragmentHistoryListBinding
|
private lateinit var binding: FragmentHistoryListBinding
|
||||||
private lateinit var adapter: HistoryItemAdapter
|
private lateinit var adapter: HistoryAdapter
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
|
@ -36,7 +36,7 @@ class HistoryFragment : Fragment(), HistoryItemAdapterListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
adapter = HistoryItemAdapter(this)
|
adapter = HistoryAdapter(this)
|
||||||
binding.list.layoutManager = LinearLayoutManager(requireContext())
|
binding.list.layoutManager = LinearLayoutManager(requireContext())
|
||||||
binding.list.adapter = adapter
|
binding.list.adapter = adapter
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,17 @@ package dev.lowrespalmtree.comet
|
||||||
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import dev.lowrespalmtree.comet.Identities.Identity
|
||||||
import dev.lowrespalmtree.comet.databinding.FragmentIdentityBinding
|
import dev.lowrespalmtree.comet.databinding.FragmentIdentityBinding
|
||||||
|
|
||||||
class IdentityAdapter : RecyclerView.Adapter<HistoryItemAdapter.ViewHolder>() {
|
class IdentitiesAdapter : RecyclerView.Adapter<HistoryAdapter.ViewHolder>() {
|
||||||
private var identities = listOf<Unit>()
|
private var identities = listOf<Identity>()
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HistoryItemAdapter.ViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HistoryAdapter.ViewHolder {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: HistoryItemAdapter.ViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: HistoryAdapter.ViewHolder, position: Int) {
|
||||||
TODO("Not yet implemented")
|
TODO("Not yet implemented")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package dev.lowrespalmtree.comet
|
package dev.lowrespalmtree.comet
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.text.SpannableString
|
|
||||||
import android.text.style.UnderlineSpan
|
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -37,7 +35,7 @@ class PageAdapter(private val listener: ContentAdapterListener) :
|
||||||
class Title(val text: String, val level: Int) : ContentBlock()
|
class Title(val text: String, val level: Int) : ContentBlock()
|
||||||
class Link(val url: String, val label: String) : ContentBlock()
|
class Link(val url: String, val label: String) : ContentBlock()
|
||||||
class Pre(val caption: String, var content: String, var closed: Boolean) : ContentBlock()
|
class Pre(val caption: String, var content: String, var closed: Boolean) : ContentBlock()
|
||||||
class Blockquote(val text: String) : ContentBlock()
|
class Blockquote(var text: String) : ContentBlock()
|
||||||
class ListItem(val text: String) : ContentBlock()
|
class ListItem(val text: String) : ContentBlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +55,6 @@ class PageAdapter(private val listener: ContentAdapterListener) :
|
||||||
is EmptyLine -> blocks.add(ContentBlock.Empty)
|
is EmptyLine -> blocks.add(ContentBlock.Empty)
|
||||||
is ParagraphLine -> blocks.add(ContentBlock.Paragraph(line.text))
|
is ParagraphLine -> blocks.add(ContentBlock.Paragraph(line.text))
|
||||||
is LinkLine -> blocks.add(ContentBlock.Link(line.url, line.label))
|
is LinkLine -> blocks.add(ContentBlock.Link(line.url, line.label))
|
||||||
is BlockquoteLine -> blocks.add(ContentBlock.Blockquote(line.text))
|
|
||||||
is ListItemLine -> blocks.add(ContentBlock.ListItem(line.text))
|
is ListItemLine -> blocks.add(ContentBlock.ListItem(line.text))
|
||||||
is TitleLine -> blocks.add(ContentBlock.Title(line.text, line.level))
|
is TitleLine -> blocks.add(ContentBlock.Title(line.text, line.level))
|
||||||
is PreFenceLine -> {
|
is PreFenceLine -> {
|
||||||
|
@ -74,12 +71,21 @@ class PageAdapter(private val listener: ContentAdapterListener) :
|
||||||
}
|
}
|
||||||
is PreTextLine -> {
|
is PreTextLine -> {
|
||||||
val lastBlock = blocks.last()
|
val lastBlock = blocks.last()
|
||||||
if (lastBlock is ContentBlock.Pre && !lastBlock.closed)
|
if (lastBlock is ContentBlock.Pre && !lastBlock.closed) {
|
||||||
lastBlock.content += line.text + "\n"
|
if (lastBlock.content.isNotEmpty())
|
||||||
else
|
lastBlock.content += "\n"
|
||||||
|
lastBlock.content += line.text
|
||||||
|
} else {
|
||||||
Log.e(TAG, "setLines: unexpected preformatted line")
|
Log.e(TAG, "setLines: unexpected preformatted line")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
is BlockquoteLine -> {
|
||||||
|
if (blocks.isNotEmpty() && blocks.last() is ContentBlock.Blockquote)
|
||||||
|
(blocks.last() as ContentBlock.Blockquote).text += "\n" + line.text
|
||||||
|
else
|
||||||
|
blocks.add(ContentBlock.Blockquote(line.text))
|
||||||
|
}
|
||||||
|
}
|
||||||
currentLine++
|
currentLine++
|
||||||
}
|
}
|
||||||
val numAdded = blocks.size - lastBlockCount
|
val numAdded = blocks.size - lastBlockCount
|
||||||
|
@ -148,9 +154,7 @@ class PageAdapter(private val listener: ContentAdapterListener) :
|
||||||
}
|
}
|
||||||
is ContentBlock.Link -> {
|
is ContentBlock.Link -> {
|
||||||
val label = if (block.label.isNotBlank()) block.label else block.url
|
val label = if (block.label.isNotBlank()) block.label else block.url
|
||||||
val underlinedLabel = SpannableString(label)
|
(holder as ContentViewHolder.Link).binding.textView.text = label
|
||||||
underlinedLabel.setSpan(UnderlineSpan(), 0, underlinedLabel.length, 0)
|
|
||||||
(holder as ContentViewHolder.Link).binding.textView.text = underlinedLabel
|
|
||||||
holder.binding.root.setOnClickListener { listener.onLinkClick(block.url) }
|
holder.binding.root.setOnClickListener { listener.onLinkClick(block.url) }
|
||||||
}
|
}
|
||||||
is ContentBlock.Pre ->
|
is ContentBlock.Pre ->
|
||||||
|
|
|
@ -32,14 +32,6 @@ class PageFragment : Fragment(), ContentAdapterListener {
|
||||||
private lateinit var binding: FragmentPageViewBinding
|
private lateinit var binding: FragmentPageViewBinding
|
||||||
private lateinit var adapter: PageAdapter
|
private lateinit var adapter: PageAdapter
|
||||||
|
|
||||||
/** Property to access and set the current address bar URL value. */
|
|
||||||
private var currentUrl: String
|
|
||||||
get() = vm.currentUrl
|
|
||||||
set(value) {
|
|
||||||
vm.currentUrl = value
|
|
||||||
binding.addressBar.setText(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
|
@ -58,7 +50,7 @@ class PageFragment : Fragment(), ContentAdapterListener {
|
||||||
|
|
||||||
binding.addressBar.setOnEditorActionListener { v, id, _ -> onAddressBarAction(v, id) }
|
binding.addressBar.setOnEditorActionListener { v, id, _ -> onAddressBarAction(v, id) }
|
||||||
|
|
||||||
binding.contentSwipeLayout.setOnRefreshListener { openUrl(currentUrl) }
|
binding.contentSwipeLayout.setOnRefreshListener { openUrl(vm.currentUrl) }
|
||||||
|
|
||||||
vm.state.observe(viewLifecycleOwner, { updateState(it) })
|
vm.state.observe(viewLifecycleOwner, { updateState(it) })
|
||||||
vm.lines.observe(viewLifecycleOwner, { updateLines(it) })
|
vm.lines.observe(viewLifecycleOwner, { updateLines(it) })
|
||||||
|
@ -79,7 +71,7 @@ class PageFragment : Fragment(), ContentAdapterListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLinkClick(url: String) {
|
override fun onLinkClick(url: String) {
|
||||||
openUrl(url, base = if (currentUrl.isNotEmpty()) currentUrl else null)
|
openUrl(url, base = if (vm.currentUrl.isNotEmpty()) vm.currentUrl else null)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onBackPressed() {
|
private fun onBackPressed() {
|
||||||
|
@ -144,12 +136,16 @@ class PageFragment : Fragment(), ContentAdapterListener {
|
||||||
PageViewModel.State.IDLE -> {
|
PageViewModel.State.IDLE -> {
|
||||||
binding.contentProgressBar.hide()
|
binding.contentProgressBar.hide()
|
||||||
binding.contentSwipeLayout.isRefreshing = false
|
binding.contentSwipeLayout.isRefreshing = false
|
||||||
|
binding.addressBar.setText(vm.currentUrl)
|
||||||
|
binding.addressBar.setTextColor(resources.getColor(R.color.url_bar, null))
|
||||||
}
|
}
|
||||||
PageViewModel.State.CONNECTING -> {
|
PageViewModel.State.CONNECTING -> {
|
||||||
|
binding.appBarLayout.setExpanded(true, true)
|
||||||
binding.contentProgressBar.show()
|
binding.contentProgressBar.show()
|
||||||
|
binding.addressBar.setText(vm.loadingUrl?.toString() ?: "")
|
||||||
|
binding.addressBar.setTextColor(resources.getColor(R.color.url_bar_loading, null))
|
||||||
}
|
}
|
||||||
PageViewModel.State.RECEIVING -> {
|
PageViewModel.State.RECEIVING -> {
|
||||||
binding.appBarLayout.setExpanded(true, true)
|
|
||||||
binding.contentSwipeLayout.isRefreshing = false
|
binding.contentSwipeLayout.isRefreshing = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,11 +165,12 @@ class PageFragment : Fragment(), ContentAdapterListener {
|
||||||
askForInput(event.prompt, event.uri)
|
askForInput(event.prompt, event.uri)
|
||||||
}
|
}
|
||||||
is PageViewModel.SuccessEvent -> {
|
is PageViewModel.SuccessEvent -> {
|
||||||
currentUrl = event.uri
|
vm.currentUrl = event.uri
|
||||||
vm.visitedUrls.add(event.uri)
|
vm.visitedUrls.add(event.uri)
|
||||||
|
binding.addressBar.setText(event.uri)
|
||||||
}
|
}
|
||||||
is PageViewModel.RedirectEvent -> {
|
is PageViewModel.RedirectEvent -> {
|
||||||
openUrl(event.uri, base = currentUrl, redirections = event.redirects)
|
openUrl(event.uri, base = vm.currentUrl, redirections = event.redirects)
|
||||||
}
|
}
|
||||||
is PageViewModel.FailureEvent -> {
|
is PageViewModel.FailureEvent -> {
|
||||||
var message = event.details
|
var message = event.details
|
||||||
|
@ -215,7 +212,7 @@ class PageFragment : Fragment(), ContentAdapterListener {
|
||||||
.setView(inputView)
|
.setView(inputView)
|
||||||
.setPositiveButton(android.R.string.ok) { _, _ ->
|
.setPositiveButton(android.R.string.ok) { _, _ ->
|
||||||
val newUri = uri.buildUpon().query(editText.text.toString()).build()
|
val newUri = uri.buildUpon().query(editText.text.toString()).build()
|
||||||
openUrl(newUri.toString(), base = currentUrl)
|
openUrl(newUri.toString(), base = vm.currentUrl)
|
||||||
}
|
}
|
||||||
.setOnDismissListener { updateState(PageViewModel.State.IDLE) }
|
.setOnDismissListener { updateState(PageViewModel.State.IDLE) }
|
||||||
.create()
|
.create()
|
||||||
|
|
|
@ -18,6 +18,8 @@ class PageViewModel(@Suppress("unused") private val savedStateHandle: SavedState
|
||||||
ViewModel() {
|
ViewModel() {
|
||||||
/** Currently viewed page URL. */
|
/** Currently viewed page URL. */
|
||||||
var currentUrl: String = ""
|
var currentUrl: String = ""
|
||||||
|
/** Latest Uri requested using `sendGeminiRequest`. */
|
||||||
|
var loadingUrl: Uri? = null
|
||||||
/** Observable page viewer state. */
|
/** Observable page viewer state. */
|
||||||
val state: MutableLiveData<State> by lazy { MutableLiveData<State>(State.IDLE) }
|
val state: MutableLiveData<State> by lazy { MutableLiveData<State>(State.IDLE) }
|
||||||
/** Observable page viewer lines (backed up by `linesList` but updated less often). */
|
/** Observable page viewer lines (backed up by `linesList` but updated less often). */
|
||||||
|
@ -52,6 +54,7 @@ class PageViewModel(@Suppress("unused") private val savedStateHandle: SavedState
|
||||||
*/
|
*/
|
||||||
fun sendGeminiRequest(uri: Uri, connectionTimeout: Int, readTimeout: Int, redirects: Int = 0) {
|
fun sendGeminiRequest(uri: Uri, connectionTimeout: Int, readTimeout: Int, redirects: Int = 0) {
|
||||||
Log.d(TAG, "sendRequest: URI \"$uri\"")
|
Log.d(TAG, "sendRequest: URI \"$uri\"")
|
||||||
|
loadingUrl = uri
|
||||||
state.postValue(State.CONNECTING)
|
state.postValue(State.CONNECTING)
|
||||||
requestJob?.apply { if (isActive) cancel() }
|
requestJob?.apply { if (isActive) cancel() }
|
||||||
requestJob = viewModelScope.launch(Dispatchers.IO) {
|
requestJob = viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:inputType="textUri"
|
android:inputType="textUri"
|
||||||
android:text=""
|
android:text=""
|
||||||
|
android:textColor="@color/url_bar"
|
||||||
tools:ignore="TextContrastCheck" />
|
tools:ignore="TextContrastCheck" />
|
||||||
|
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout
|
||||||
android:id="@+id/text_view"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="16dp">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
style="@style/CometText"
|
style="@style/CometText"
|
||||||
android:textStyle="italic"
|
android:background="@color/background_emph"
|
||||||
android:paddingStart="32dp"
|
android:textStyle="italic" />
|
||||||
android:paddingEnd="16dp" />
|
</FrameLayout>
|
||||||
|
|
|
@ -4,5 +4,5 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/CometText"
|
style="@style/CometText"
|
||||||
android:textColor="@color/teal_700"
|
android:textColor="@color/link"
|
||||||
android:textIsSelectable="false" />
|
android:textIsSelectable="false" />
|
|
@ -12,8 +12,6 @@
|
||||||
android:textColor="@color/text"
|
android:textColor="@color/text"
|
||||||
android:fontFamily="@font/preformatted"
|
android:fontFamily="@font/preformatted"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:paddingStart="16dp"
|
android:padding="4dp"
|
||||||
android:paddingEnd="8dp"
|
android:background="@color/background_emph" />
|
||||||
android:paddingTop="4dp"
|
|
||||||
android:paddingBottom="4dp" />
|
|
||||||
</HorizontalScrollView>
|
</HorizontalScrollView>
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="text">#D4D4D4</color>
|
<color name="background">#002b36</color>
|
||||||
|
<color name="background_emph">#073642</color>
|
||||||
|
<color name="text_light">#93a1a1</color>
|
||||||
|
<color name="text">#839496</color>
|
||||||
|
<color name="main_accent">#d33682</color>
|
||||||
|
<color name="main_accent_dark">#073642</color>
|
||||||
|
<color name="second_accent">#2aa198</color>
|
||||||
|
<color name="second_accent_dark">#073642</color>
|
||||||
|
<color name="link">#2aa198</color>
|
||||||
|
<color name="url_bar">#fdf6e3</color>
|
||||||
|
<color name="url_bar_loading">#586e75</color>
|
||||||
</resources>
|
</resources>
|
|
@ -1,16 +0,0 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="Theme.Comet" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
|
||||||
<!-- Primary brand color. -->
|
|
||||||
<item name="colorPrimary">@color/purple_200</item>
|
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
|
||||||
<item name="colorOnPrimary">@color/black</item>
|
|
||||||
<!-- Secondary brand color. -->
|
|
||||||
<item name="colorSecondary">@color/teal_200</item>
|
|
||||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
|
||||||
<item name="colorOnSecondary">@color/black</item>
|
|
||||||
<!-- Status bar color. -->
|
|
||||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
|
@ -1,17 +1,36 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="purple_200">#FFBB86FC</color>
|
<color name="black">#000000</color>
|
||||||
<color name="purple_500">#FF6200EE</color>
|
|
||||||
<color name="purple_700">#FF3700B3</color>
|
|
||||||
<color name="teal_200">#FF03DAC5</color>
|
|
||||||
<color name="teal_700">#FF018786</color>
|
|
||||||
<color name="black">#FF000000</color>
|
|
||||||
|
|
||||||
<color name="bright">#F3F4ED</color>
|
<color name="background">#fdf6e3</color>
|
||||||
<color name="text_light">#536162</color>
|
<color name="background_emph">#eee8d5</color>
|
||||||
<color name="text">#424642</color>
|
<color name="text_light">#93a1a1</color>
|
||||||
<color name="orange">#C06014</color>
|
<color name="text">#657b83</color>
|
||||||
<color name="orange_dark">#683C19</color>
|
<color name="main_accent">#d33682</color>
|
||||||
<color name="teal">#14C0B2</color>
|
<color name="main_accent_dark">#6c71c4</color>
|
||||||
<color name="teal_dark">#147169</color>
|
<color name="second_accent">#6c71c4</color>
|
||||||
|
<color name="second_accent_dark">#073642</color>
|
||||||
|
<color name="link">#268bd2</color>
|
||||||
|
<color name="url_bar">#002b36</color>
|
||||||
|
<color name="url_bar_loading">#fdf6e3</color>
|
||||||
|
<!--
|
||||||
|
Based on Solarized
|
||||||
|
SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
|
||||||
|
base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21
|
||||||
|
base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26
|
||||||
|
base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46
|
||||||
|
base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51
|
||||||
|
base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59
|
||||||
|
base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63
|
||||||
|
base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93
|
||||||
|
base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99
|
||||||
|
yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71
|
||||||
|
orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80
|
||||||
|
red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86
|
||||||
|
magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83
|
||||||
|
violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77
|
||||||
|
blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82
|
||||||
|
cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63
|
||||||
|
green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60
|
||||||
|
-->
|
||||||
</resources>
|
</resources>
|
|
@ -2,17 +2,17 @@
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Comet" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.Comet" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/orange</item>
|
<item name="colorPrimary">@color/main_accent</item>
|
||||||
<item name="colorPrimaryVariant">@color/orange_dark</item>
|
<item name="colorPrimaryVariant">@color/main_accent_dark</item>
|
||||||
<item name="colorOnPrimary">@color/bright</item>
|
<item name="colorOnPrimary">@color/background</item>
|
||||||
<!-- Secondary brand color. -->
|
<!-- Secondary brand color. -->
|
||||||
<item name="colorSecondary">@color/teal</item>
|
<item name="colorSecondary">@color/second_accent</item>
|
||||||
<item name="colorSecondaryVariant">@color/teal_dark</item>
|
<item name="colorSecondaryVariant">@color/second_accent_dark</item>
|
||||||
<item name="colorOnSecondary">@color/text</item>
|
<item name="colorOnSecondary">@color/text</item>
|
||||||
<!-- Status bar color. -->
|
<!-- Status bar color. -->
|
||||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="android:windowBackground">@color/bright</item>
|
<item name="android:windowBackground">@color/background</item>
|
||||||
<item name="android:progressBackgroundTint">?attr/colorSecondaryVariant</item>
|
<item name="android:progressBackgroundTint">?attr/colorSecondaryVariant</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
Reference in a new issue