Skip to content

Commit

Permalink
Merge pull request #8339 from wmontwe/remove-legacy-drawer
Browse files Browse the repository at this point in the history
Remove legacy drawer
  • Loading branch information
wmontwe authored Oct 17, 2024
2 parents 213c0c3 + f16e680 commit 5a6c0b4
Show file tree
Hide file tree
Showing 38 changed files with 18 additions and 1,049 deletions.
1 change: 0 additions & 1 deletion app-k9mail/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ package app.k9mail.featureflag

import app.k9mail.core.featureflag.FeatureFlag
import app.k9mail.core.featureflag.FeatureFlagFactory
import app.k9mail.core.featureflag.FeatureFlagKey

class K9FeatureFlagFactory : FeatureFlagFactory {
override fun createFeatureCatalog(): List<FeatureFlag> {
return listOf(
FeatureFlag(FeatureFlagKey("material3_navigation_drawer"), false),
)
return listOf()
}
}
6 changes: 0 additions & 6 deletions app-k9mail/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
<item name="openpgp_blue">#336699</item>
<item name="openpgp_grey">#bbb</item>
<item name="openpgp_dark_grey">#888</item>

<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Light</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Light</item>
</style>

<style name="Theme.K9.Dark" parent="Theme2.K9.Dark">
Expand Down Expand Up @@ -93,9 +90,6 @@
<item name="openpgp_blue">#6699cc</item>
<item name="openpgp_grey">#888</item>
<item name="openpgp_dark_grey">#bbb</item>

<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Dark</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Dark</item>
</style>

<style name="Theme.K9.Light.Dialog.Translucent" parent="Theme.Material3.Light.Dialog">
Expand Down
1 change: 0 additions & 1 deletion app-thunderbird/dependencies/fossBetaRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
1 change: 0 additions & 1 deletion app-thunderbird/dependencies/fossDailyRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
1 change: 0 additions & 1 deletion app-thunderbird/dependencies/fullBetaRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
1 change: 0 additions & 1 deletion app-thunderbird/dependencies/fullDailyRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:9.0.2
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.9.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import app.k9mail.core.featureflag.FeatureFlagKey
class TbFeatureFlagFactory : FeatureFlagFactory {
override fun createFeatureCatalog(): List<FeatureFlag> {
return listOf(
FeatureFlag(FeatureFlagKey("material3_navigation_drawer"), true),
FeatureFlag(FeatureFlagKey("funding_google_play"), true),
)
}
Expand Down
6 changes: 0 additions & 6 deletions app-thunderbird/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
<item name="openpgp_blue">#336699</item>
<item name="openpgp_grey">#bbb</item>
<item name="openpgp_dark_grey">#888</item>

<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Light</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Light</item>
</style>

<style name="Theme.Thunderbird.Dark" parent="Theme2.Thunderbird.Dark">
Expand Down Expand Up @@ -93,9 +90,6 @@
<item name="openpgp_blue">#6699cc</item>
<item name="openpgp_grey">#888</item>
<item name="openpgp_dark_grey">#bbb</item>

<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Dark</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Dark</item>
</style>

<style name="Theme.Thunderbird.Light.Dialog" parent="Theme.Thunderbird.Light" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ object Icons {
val Add = R.drawable.ic_add
val AddCircle = R.drawable.ic_add_circle
val Adjust = R.drawable.ic_adjust
val AllInbox = R.drawable.ic_all_inbox
val Archive = R.drawable.ic_archive
val ArrowBack = R.drawable.ic_arrow_back
val Attachment = R.drawable.ic_attachment
Expand Down
13 changes: 0 additions & 13 deletions core/ui/legacy/designsystem/src/main/res/drawable/ic_all_inbox.xml

This file was deleted.

14 changes: 7 additions & 7 deletions feature/navigation/drawer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ android {
}

dependencies {
implementation(projects.core.mail.folder.api)

implementation(projects.core.ui.theme.api)
implementation(projects.core.ui.compose.designsystem)

implementation(projects.legacy.core)
implementation(projects.legacy.ui.base)
implementation(projects.legacy.ui.account)
implementation(projects.legacy.account)
implementation(projects.legacy.mailstore)
implementation(projects.legacy.message)
implementation(projects.legacy.search)
implementation(projects.legacy.ui.folder)
implementation(projects.core.ui.legacy.designsystem)

implementation(libs.materialdrawer)
implementation(libs.androidx.swiperefreshlayout)

testImplementation(projects.core.ui.compose.testing)
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package app.k9mail.feature.navigation.drawer

import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.ui.platform.ComposeView
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import app.k9mail.core.ui.theme.api.FeatureThemeProvider
import app.k9mail.feature.navigation.drawer.domain.entity.DisplayUnifiedFolderType
import app.k9mail.feature.navigation.drawer.domain.entity.createDisplayAccountFolderId
import app.k9mail.feature.navigation.drawer.ui.DrawerView
import app.k9mail.legacy.account.Account
import com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.update
import org.koin.core.component.KoinComponent
Expand All @@ -36,19 +33,14 @@ class FolderDrawer(
private val themeProvider: FeatureThemeProvider by inject()

private val drawer: DrawerLayout = parent.findViewById(R.id.navigation_drawer_layout)
private val drawerView: ComposeView = parent.findViewById(R.id.material_drawer_compose_view)
private val sliderView: MaterialDrawerSliderView = parent.findViewById(R.id.material_drawer_slider)
private val swipeRefreshLayout: SwipeRefreshLayout = parent.findViewById(R.id.material_drawer_swipe_refresh)
private val drawerContent: ComposeView = parent.findViewById(R.id.navigation_drawer_content)

private val drawerState = MutableStateFlow(FolderDrawerState())

init {
sliderView.visibility = View.GONE
drawerView.visibility = View.VISIBLE
swipeRefreshLayout.isEnabled = false
drawer.addDrawerListener(createDrawerListener())

drawerView.setContent {
drawerContent.setContent {
themeProvider.WithTheme {
val state = drawerState.collectAsStateWithLifecycle()

Expand Down
Loading

0 comments on commit 5a6c0b4

Please sign in to comment.