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

Commit 47e0cff6 authored by Michael Enoma's avatar Michael Enoma
Browse files

REMOVE ONBOarding

parent 17309383
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1384,6 +1384,11 @@ public class MessagingController {
                        message.setFlag(Flag.X_SEND_IN_PROGRESS, true);
                        Timber.i("Sending message with UID %s", message.getUid());
                        backend.sendMessage(message);

                        if (K9.isSentSoundEnabled()) {
                            MessageSentAudio.play(context);
                        }

                        message.setFlag(Flag.X_SEND_IN_PROGRESS, false);
                        message.setFlag(Flag.SEEN, true);
                        progress++;
+0 −40
Original line number Diff line number Diff line
package com.fsck.k9.ui.onboarding

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import androidx.navigation.NavController
import com.fsck.k9.ui.R
import com.fsck.k9.ui.base.K9Activity

class OnboardingActivity : K9Activity() {
    private lateinit var navController: NavController

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setLayout(R.layout.activity_onboarding)
        setTitle(R.string.account_setup_basics_title)

        // initializeActionBar()
    }

//    private fun initializeActionBar() {
//        val appBarConfiguration = AppBarConfiguration(topLevelDestinationIds = setOf(R.id.welcomeScreen))
//
//        navController = findNavController(R.id.nav_host_fragment)
//        setupActionBarWithNavController(navController, appBarConfiguration)
//    }

    override fun onSupportNavigateUp(): Boolean {
        return navController.navigateUp() || super.onSupportNavigateUp()
    }

    companion object {
        @JvmStatic fun launch(activity: Activity) {
            val intent = Intent(activity, OnboardingActivity::class.java).apply {
                flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
            }
            activity.startActivity(intent)
        }
    }
}
+0 −56
Original line number Diff line number Diff line
package com.fsck.k9.ui.onboarding

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.fsck.k9.ui.R
import com.fsck.k9.ui.helper.HtmlToSpanned
import com.fsck.k9.ui.settings.import.SettingsImportResultViewModel
import org.koin.android.ext.android.inject
import org.koin.androidx.viewmodel.ext.android.sharedViewModel

class WelcomeFragment : Fragment() {
    private val htmlToSpanned: HtmlToSpanned by inject()
    private val importResultViewModel: SettingsImportResultViewModel by sharedViewModel()

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_welcome_message, container, false)
    }
//
//    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
//        super.onViewCreated(view, savedInstanceState)
//
//        val welcome: TextView = view.findViewById(R.id.welcome_message)
//        welcome.text = htmlToSpanned.convert(getString(R.string.accounts_welcome))
//        welcome.movementMethod = LinkMovementMethod.getInstance()
//
//        view.findViewById<View>(R.id.next).setOnClickListener { launchAccountSetup() }
//        view.findViewById<View>(R.id.import_settings).setOnClickListener { launchImportSettings() }
//
//        importResultViewModel.settingsImportResult.observeNotNull(this) {
//            if (it == SettingsImportSuccess) {
//                launchMessageList()
//            }
//        }
//    }

//    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)
//    }
//
//    private fun launchMessageList() {
//        findNavController().navigate(R.id.action_welcomeScreen_to_messageListScreen)
//        requireActivity().finish()
//    }
}
+0 −21
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".onboarding.OnboardingActivity">

    <include layout="@layout/toolbar" />

    <androidx.fragment.app.FragmentContainerView
        android:id="@+id/nav_host_fragment"
        android:name="androidx.navigation.fragment.NavHostFragment"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        app:defaultNavHost="true" />

</LinearLayout>
+0 −38
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".onboarding.WelcomeFragment" >

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:fadingEdge="none" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/welcome_message"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="8dp"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="14sp"
                tools:text="[Welcome message]" />

            <View
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1" />
        </LinearLayout>
    </ScrollView>

    <include layout="@layout/wizard_welcome" />

</LinearLayout>