Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca2c6b46 authored by cketti's avatar cketti
Browse files

Allow using the new 'add account' screen during onboarding

To enable this add the following line to your global gradle.properties:

k9mail.useNewSetupUi=true
parent 8c953c09
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -74,6 +74,16 @@ android {
        targetSdkVersion buildConfig.robolectricSdk
    }

    buildTypes {
        debug {
            def useNewSetupUi = project.hasProperty('k9mail.useNewSetupUi') ? project.property('k9mail.useNewSetupUi') : "false"
            buildConfigField "boolean", "USE_NEW_SETUP_UI_FOR_ONBOARDING", useNewSetupUi
        }
        release {
            buildConfigField "boolean", "USE_NEW_SETUP_UI_FOR_ONBOARDING", "false"
        }
    }

    lintOptions {
        abortOnError false
        lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
+7 −2
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.fsck.k9.ui.BuildConfig
import com.fsck.k9.ui.R
import com.fsck.k9.ui.helper.HtmlToSpanned
import com.fsck.k9.ui.observeNotNull
@@ -42,9 +43,13 @@ class WelcomeFragment : Fragment() {
    }

    private fun launchAccountSetup() {
        if (BuildConfig.USE_NEW_SETUP_UI_FOR_ONBOARDING) {
            findNavController().navigate(R.id.action_welcomeScreen_to_newAddAccountScreen)
        } else {
            findNavController().navigate(R.id.action_welcomeScreen_to_addAccountScreen)
            requireActivity().finish()
        }
    }

    private fun launchImportSettings() {
        findNavController().navigate(R.id.action_welcomeScreen_to_settingsImportScreen)
+6 −0
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@
    android:id="@+id/navigation_onboarding"
    app:startDestination="@id/welcomeScreen">

    <include app:graph="@navigation/navigation_add_account" />

    <fragment
        android:id="@+id/welcomeScreen"
        android:name="com.fsck.k9.ui.onboarding.WelcomeFragment"
@@ -19,6 +21,10 @@
            android:id="@+id/action_welcomeScreen_to_addAccountScreen"
            app:destination="@id/addAccountScreen" />

        <action
            android:id="@+id/action_welcomeScreen_to_newAddAccountScreen"
            app:destination="@id/navigation_add_account" />

        <action
            android:id="@+id/action_welcomeScreen_to_messageListScreen"
            app:destination="@id/messageListScreen" />