Move toolbar back to top of app

It seems like very few apps have the toolbar at the bottom, so while it may be more ergonomically sound, it's also a bit unintuitive. It's probably wise to not stray too far from the norms. By having the toolbar at the top, I can also hide it when scrolling in various views, allowing even more of the content to be visible on the screen.

Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
William Brawner 2020-06-11 20:55:33 -07:00
parent e9dc70eed4
commit 367b91ed6d
20 changed files with 149 additions and 231 deletions

View file

@ -1,7 +1,3 @@
# Introduction
***
Markdown is a markup language that allows you to quickly and easily write for the web! Many blogging platforms allow you to use markdown in your posts, WordPress for example. This document has also been written in Markdown :) Markdown is a markup language that allows you to quickly and easily write for the web! Many blogging platforms allow you to use markdown in your posts, WordPress for example. This document has also been written in Markdown :)
Using Markdown is quite simple. There are just a few syntax rules you'll need to remember. Below I have written a few to get you started, followed by their appearance in this app. Using Markdown is quite simple. There are just a few syntax rules you'll need to remember. Below I have written a few to get you started, followed by their appearance in this app.

View file

@ -1,7 +1,3 @@
# Libraries
***
The following libraries were a huge help in the development of SimpleMarkdown. The following libraries were a huge help in the development of SimpleMarkdown.
Big thanks to the developers of them :) Big thanks to the developers of them :)

View file

@ -1,5 +1,3 @@
## Privacy Policy
First and foremost, Simple Markdown DOES NOT collect any personally identifiable information. The First and foremost, Simple Markdown DOES NOT collect any personally identifiable information. The
internet access permission is requested primarily for retrieving images from the internet in internet access permission is requested primarily for retrieving images from the internet in
case you embed them in your markdown, but it also allows me to send automated error and crash case you embed them in your markdown, but it also allows me to send automated error and crash

View file

@ -37,7 +37,6 @@ class SentryErrorHandler : ErrorHandler {
@Suppress("ConstantConditionIf") @Suppress("ConstantConditionIf")
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
Log.e("SentryErrorHandler", "Caught exception: $message", t) Log.e("SentryErrorHandler", "Caught exception: $message", t)
return
} }
Sentry.captureException(t) Sentry.captureException(t)
} }

View file

@ -11,9 +11,11 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import java.io.Reader import java.io.Reader
fun View.showKeyboard() = fun View.showKeyboard() {
(context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager) (context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)
.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0) .toggleSoftInput(InputMethodManager.SHOW_FORCED, 0)
requestFocus()
}
fun View.hideKeyboard() = fun View.hideKeyboard() =
(context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager) (context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)

View file

@ -43,13 +43,6 @@ class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsRes
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_menu_black_24dp) supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_menu_black_24dp)
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
window.decorView.apply {
systemUiVisibility = (
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
)
}
val adapter = EditPagerAdapter(supportFragmentManager, this@MainActivity) val adapter = EditPagerAdapter(supportFragmentManager, this@MainActivity)
pager.adapter = adapter pager.adapter = adapter
pager.addOnPageChangeListener(adapter) pager.addOnPageChangeListener(adapter)
@ -61,7 +54,7 @@ class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsRes
} }
@Suppress("CAST_NEVER_SUCCEEDS") @Suppress("CAST_NEVER_SUCCEEDS")
viewModel.fileName.observe(this, Observer { viewModel.fileName.observe(this, Observer {
title = it toolbar?.title = it
}) })
intent?.data?.let { intent?.data?.let {
launch { launch {

View file

@ -32,6 +32,7 @@ class MarkdownInfoActivity : AppCompatActivity(), CoroutineScope {
return return
} }
setTitle(title)
val isNightMode = AppCompatDelegate.getDefaultNightMode() == val isNightMode = AppCompatDelegate.getDefaultNightMode() ==
AppCompatDelegate.MODE_NIGHT_YES AppCompatDelegate.MODE_NIGHT_YES
|| resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES || resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES

View file

@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.MenuItem import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.wbrawner.simplemarkdown.R import com.wbrawner.simplemarkdown.R
import com.wbrawner.simplemarkdown.view.fragment.SettingsFragment
class SettingsActivity : AppCompatActivity() { class SettingsActivity : AppCompatActivity() {
@ -12,6 +13,11 @@ class SettingsActivity : AppCompatActivity() {
setContentView(R.layout.activity_settings) setContentView(R.layout.activity_settings)
setSupportActionBar(findViewById(R.id.toolbar)) setSupportActionBar(findViewById(R.id.toolbar))
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
if (supportFragmentManager.fragments.isEmpty()) {
supportFragmentManager.beginTransaction()
.add(R.id.fragment_settings, SettingsFragment())
.commit()
}
} }
override fun onOptionsItemSelected(item: MenuItem): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {

View file

@ -5,7 +5,6 @@ import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.MenuItem import android.view.MenuItem
import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.browser.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
@ -19,13 +18,6 @@ class SupportActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_support) setContentView(R.layout.activity_support)
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
window.decorView.apply {
systemUiVisibility = (
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
)
}
setTitle(R.string.support_title) setTitle(R.string.support_title)
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
githubButton.setOnClickListener { githubButton.setOnClickListener {

View file

@ -13,8 +13,8 @@ import android.view.MotionEvent
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.EditText import android.widget.EditText
import android.widget.ScrollView
import android.widget.TextView import android.widget.TextView
import androidx.core.widget.NestedScrollView
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels import androidx.fragment.app.activityViewModels
import androidx.lifecycle.Observer import androidx.lifecycle.Observer
@ -31,7 +31,7 @@ import kotlin.math.abs
class EditFragment : Fragment(), ViewPagerPage, CoroutineScope { class EditFragment : Fragment(), ViewPagerPage, CoroutineScope {
private var markdownEditor: EditText? = null private var markdownEditor: EditText? = null
private var markdownEditorScroller: ScrollView? = null private var markdownEditorScroller: NestedScrollView? = null
private val viewModel: MarkdownViewModel by activityViewModels() private val viewModel: MarkdownViewModel by activityViewModels()
override val coroutineContext: CoroutineContext = Dispatchers.Main override val coroutineContext: CoroutineContext = Dispatchers.Main
private var readabilityWatcher: TextWatcher? = null private var readabilityWatcher: TextWatcher? = null

View file

@ -39,12 +39,12 @@ class MainMenuFragment : BottomSheetDialogFragment() {
R.id.action_libraries -> Triple( R.id.action_libraries -> Triple(
MarkdownInfoActivity::class.java, MarkdownInfoActivity::class.java,
"Libraries.md", "Libraries.md",
R.id.action_libraries R.string.action_libraries
) )
R.id.action_privacy -> Triple( R.id.action_privacy -> Triple(
MarkdownInfoActivity::class.java, MarkdownInfoActivity::class.java,
"Privacy Policy.md", "Privacy Policy.md",
R.id.action_libraries R.string.action_privacy
) )
R.id.action_support -> Triple( R.id.action_support -> Triple(
SupportActivity::class.java, SupportActivity::class.java,
@ -73,9 +73,9 @@ class MainMenuFragment : BottomSheetDialogFragment() {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == MainActivity.REQUEST_DARK_MODE) { if (requestCode == MainActivity.REQUEST_DARK_MODE) {
activity?.recreate() activity?.recreate()
dialog?.dismiss() } else {
return super.onActivityResult(requestCode, resultCode, data)
} }
super.onActivityResult(requestCode, resultCode, data) dialog?.dismiss()
} }
} }

View file

@ -1,75 +1,47 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:clipChildren="false"
android:fitsSystemWindows="true"
android:clipToPadding="false">
<com.wbrawner.simplemarkdown.view.DisableableViewPager <com.wbrawner.simplemarkdown.view.DisableableViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:clipChildren="false" app:layout_behavior="@string/appbar_scrolling_view_behavior" />
android:fitsSystemWindows="true"
android:clipToPadding="false"
android:paddingBottom="40dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
<com.google.android.material.card.MaterialCardView <com.google.android.material.appbar.AppBarLayout
android:id="@+id/bottomSheet" android:id="@+id/bottomSheet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:translationY="16dp"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout <com.google.android.material.appbar.MaterialToolbar
android:orientation="vertical" android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorBackground"
app:layout_scrollFlags="scroll|enterAlways" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="16dp"> android:background="@color/colorBackground"
android:visibility="gone">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabItem
android:id="@+id/tabLayout" android:id="@+id/editTab"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorBackground" android:text="@string/action_edit" />
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/toolbar">
<com.google.android.material.tabs.TabItem <com.google.android.material.tabs.TabItem
android:id="@+id/editTab" android:id="@+id/previewTab"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/action_edit" /> android:text="@string/action_preview" />
</com.google.android.material.tabs.TabLayout>
<com.google.android.material.tabs.TabItem </com.google.android.material.appbar.AppBarLayout>
android:id="@+id/previewTab"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/action_preview" />
</com.google.android.material.tabs.TabLayout>
<androidx.appcompat.widget.Toolbar </androidx.coordinatorlayout.widget.CoordinatorLayout>
android:id="@+id/toolbar"
android:background="@color/colorBackground"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:clipChildren="false"
android:fitsSystemWindows="true"
android:clipToPadding="false" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,73 +1,48 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:clipChildren="false"
android:fitsSystemWindows="true"
android:clipToPadding="false">
<com.wbrawner.simplemarkdown.view.DisableableViewPager <com.wbrawner.simplemarkdown.view.DisableableViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:clipChildren="false" app:layout_behavior="@string/appbar_scrolling_view_behavior" />
android:fitsSystemWindows="true"
android:clipToPadding="false"
android:paddingBottom="90dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
<com.google.android.material.card.MaterialCardView <com.google.android.material.appbar.AppBarLayout
android:id="@+id/bottomSheet" android:id="@+id/bottomSheet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:translationY="16dp" app:liftOnScroll="true">
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout <com.google.android.material.appbar.MaterialToolbar
android:orientation="vertical" android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways|snap"
android:background="@color/colorBackground" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="16dp"> android:layout_gravity="bottom"
android:background="@color/colorBackground">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabItem
android:id="@+id/tabLayout" android:id="@+id/editTab"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorBackground" android:text="@string/action_edit" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@+id/toolbar">
<com.google.android.material.tabs.TabItem <com.google.android.material.tabs.TabItem
android:id="@+id/editTab" android:id="@+id/previewTab"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/action_edit" /> android:text="@string/action_preview" />
</com.google.android.material.tabs.TabLayout>
<com.google.android.material.tabs.TabItem </com.google.android.material.appbar.AppBarLayout>
android:id="@+id/previewTab"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/action_preview" />
</com.google.android.material.tabs.TabLayout>
<androidx.appcompat.widget.Toolbar </androidx.coordinatorlayout.widget.CoordinatorLayout>
android:id="@+id/toolbar"
android:background="@color/colorBackground"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:clipChildren="false"
android:fitsSystemWindows="true"
android:clipToPadding="false" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,41 +1,43 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="com.wbrawner.simplemarkdown.view.activity.MarkdownInfoActivity" tools:context="com.wbrawner.simplemarkdown.view.activity.MarkdownInfoActivity">
android:fitsSystemWindows="true"
android:clipToPadding="false"
android:clipChildren="false">
<WebView <com.google.android.material.appbar.AppBarLayout
android:id="@+id/infoWebview" android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="128dp"
android:background="@color/colorBackground">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="40dp" app:layout_behavior="@string/appbar_scrolling_view_behavior">
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.card.MaterialCardView <WebView
android:id="@+id/bottomSheet" android:id="@+id/infoWebview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:translationY="16dp"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="match_parent"
android:layout_marginBottom="16dp" android:nestedScrollingEnabled="false" />
android:background="@color/colorBackground" /> </androidx.core.widget.NestedScrollView>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -5,34 +5,26 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<fragment <com.google.android.material.appbar.AppBarLayout
android:id="@+id/fragment_settings" android:id="@+id/appBarLayout"
class="com.wbrawner.simplemarkdown.view.fragment.SettingsFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="90dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/bottomSheet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:translationY="16dp" app:layout_constraintTop_toTopOf="parent">
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/colorBackground" android:background="@color/colorBackground" />
android:layout_marginBottom="16dp" /> </com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_settings"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/appBarLayout" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -2,8 +2,14 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorBackground"
app:layout_constraintTop_toTopOf="parent" />
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -11,8 +17,8 @@
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
android:padding="16dp" android:padding="16dp"
app:layout_constraintBottom_toTopOf="@+id/bottomSheet" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toBottomOf="@+id/toolbar">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -69,23 +75,4 @@
</ScrollView> </ScrollView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/bottomSheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:translationY="16dp"
app:cardCornerRadius="16dp"
app:cardElevation="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_marginBottom="16dp"
android:background="@color/colorBackground" />
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,4 +1,4 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/markdown_edit_container" android:id="@+id/markdown_edit_container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -20,4 +20,4 @@
android:paddingBottom="16dp" android:paddingBottom="16dp"
android:scrollHorizontally="false" android:scrollHorizontally="false"
android:importantForAutofill="no" /> android:importantForAutofill="no" />
</ScrollView> </androidx.core.widget.NestedScrollView>

View file

@ -1,4 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -7,6 +7,7 @@
<WebView <WebView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
android:id="@+id/markdown_view" /> android:id="@+id/markdown_view" />
</FrameLayout> </androidx.core.widget.NestedScrollView>

View file

@ -1,10 +1,11 @@
<resources> <resources>
<style name="AppTheme" parent="Theme.MaterialComponents.NoActionBar"> <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item> <item name="android:statusBarColor">@color/colorBackground</item>
<item name="android:navigationBarColor">@color/colorBackground</item>
</style> </style>
</resources> </resources>

View file

@ -6,10 +6,15 @@
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item> <item name="android:statusBarColor">@color/colorBackground</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:navigationBarColor">#FF000000</item>
</style> </style>
<style name="AppTheme.Splash" parent="AppTheme"> <style name="AppTheme.Splash" parent="AppTheme">
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:navigationBarColor">@color/colorPrimary</item>
<item name="android:windowBackground">@drawable/splash_bg</item> <item name="android:windowBackground">@drawable/splash_bg</item>
</style> </style>
</resources> </resources>