Fill the Finish tab (5) of the tutorial

This commit is contained in:
Finn M Glas 2020-06-23 09:54:22 +02:00
parent e1f88e546d
commit 9213d8241e
No known key found for this signature in database
GPG key ID: 902A30146014DFBF
2 changed files with 44 additions and 2 deletions

View file

@ -29,9 +29,23 @@ class TutorialFragmentFinish(): Fragment(), UIObject {
override fun applyTheme() { override fun applyTheme() {
tutorial_finish_container.setBackgroundColor(dominantColor) tutorial_finish_container.setBackgroundColor(dominantColor)
setButtonColor(tutorial_finish_button_start, vibrantColor)
} }
fun go() { override fun setOnClicks() {
super.setOnClicks()
tutorial_finish_button_start.setOnClickListener{ finishTutorial() }
}
override fun adjustLayout() {
super.adjustLayout()
// Different text if opened again later (from settings)
if (launcherPreferences.getBoolean("startedBefore", false))
tutorial_finish_button_start.text = "Back to Settings"
}
private fun finishTutorial() {
if (!launcherPreferences.getBoolean("startedBefore", false)){ if (!launcherPreferences.getBoolean("startedBefore", false)){
launcherPreferences.edit() launcherPreferences.edit()
.putBoolean("startedBefore", true) // never auto run this again .putBoolean("startedBefore", true) // never auto run this again

View file

@ -2,9 +2,37 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" 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:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tutorial_finish_container" android:id="@+id/tutorial_finish_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
tools:context=".tutorial.tab.TutorialFragmentFinish"/> tools:context=".tutorial.tab.TutorialFragmentFinish">
<TextView
android:id="@+id/tutorial_finish_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="You are ready to get started!\n\n I hope this provides great value to you!\n\n- Finn M Glas (alias 'the developer')"
android:textSize="15sp"
app:layout_constraintBottom_toTopOf="@id/tutorial_finish_button_start"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.8" />
<Button
android:id="@+id/tutorial_finish_button_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="32sp"
android:text="Start Launcher"
android:textAllCaps="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.6" />
</androidx.constraintlayout.widget.ConstraintLayout>