forked from thunderbird/thunderbird-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request thunderbird#8131 from wmontwe/add-drawer-folder-li…
…st-part2 Add drawer folder list - Part 2
- Loading branch information
Showing
50 changed files
with
330 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id(ThunderbirdPlugins.Library.jvm) | ||
alias(libs.plugins.android.lint) | ||
} | ||
|
||
dependencies { | ||
implementation(projects.mail.common) | ||
|
||
testImplementation(projects.core.testing) | ||
} |
2 changes: 1 addition & 1 deletion
2
...kotlin/app/k9mail/legacy/folder/Folder.kt → ...app/k9mail/core/mail/folder/api/Folder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package app.k9mail.legacy.folder | ||
package app.k9mail.core.mail.folder.api | ||
|
||
data class Folder( | ||
val id: Long, | ||
|
2 changes: 1 addition & 1 deletion
2
...app/k9mail/legacy/folder/FolderDetails.kt → ...ail/core/mail/folder/api/FolderDetails.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package app.k9mail.legacy.folder | ||
package app.k9mail.core.mail.folder.api | ||
|
||
import com.fsck.k9.mail.FolderClass | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...in/app/k9mail/legacy/folder/FolderType.kt → ...k9mail/core/mail/folder/api/FolderType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package app.k9mail.legacy.folder | ||
package app.k9mail.core.mail.folder.api | ||
|
||
enum class FolderType { | ||
REGULAR, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ion/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/NavigationDrawerModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,43 @@ | ||
package app.k9mail.feature.navigation.drawer | ||
|
||
import app.k9mail.feature.navigation.drawer.domain.DomainContract.UseCase | ||
import app.k9mail.feature.navigation.drawer.domain.usecase.GetDisplayAccounts | ||
import app.k9mail.feature.navigation.drawer.legacy.AccountsViewModel | ||
import app.k9mail.feature.navigation.drawer.legacy.FoldersViewModel | ||
import app.k9mail.feature.navigation.drawer.ui.DrawerViewModel | ||
import com.fsck.k9.CoreResourceProvider | ||
import com.fsck.k9.K9 | ||
import org.koin.androidx.viewmodel.dsl.viewModel | ||
import org.koin.core.module.Module | ||
import org.koin.dsl.module | ||
|
||
val navigationDrawerModule: Module = module { | ||
|
||
single<UseCase.GetDisplayAccounts> { | ||
GetDisplayAccounts( | ||
accountManager = get(), | ||
messageCountsProvider = get(), | ||
messageListRepository = get(), | ||
) | ||
} | ||
|
||
viewModel { | ||
AccountsViewModel( | ||
getDisplayAccounts = get(), | ||
) | ||
} | ||
|
||
viewModel { | ||
val coreResourceProvider = get<CoreResourceProvider>() | ||
|
||
FoldersViewModel( | ||
folderRepository = get(), | ||
messageCountsProvider = get(), | ||
isShowUnifiedInbox = { K9.isShowUnifiedInbox }, | ||
getUnifiedInboxTitle = { coreResourceProvider.searchUnifiedInboxTitle() }, | ||
getUnifiedInboxDetail = { coreResourceProvider.searchUnifiedInboxDetail() }, | ||
) | ||
} | ||
|
||
viewModel { DrawerViewModel() } | ||
} |
13 changes: 13 additions & 0 deletions
13
...tion/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/domain/DomainContract.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package app.k9mail.feature.navigation.drawer.domain | ||
|
||
import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface DomainContract { | ||
|
||
interface UseCase { | ||
fun interface GetDisplayAccounts { | ||
fun execute(): Flow<List<DisplayAccount>> | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...9mail/legacy/ui/account/DisplayAccount.kt → ...on/drawer/domain/entity/DisplayAccount.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...n/drawer/src/main/kotlin/app/k9mail/feature/navigation/drawer/legacy/AccountsViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package app.k9mail.feature.navigation.drawer.legacy | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.ViewModel | ||
import androidx.lifecycle.asLiveData | ||
import app.k9mail.feature.navigation.drawer.domain.DomainContract.UseCase | ||
import app.k9mail.feature.navigation.drawer.domain.entity.DisplayAccount | ||
|
||
class AccountsViewModel( | ||
getDisplayAccounts: UseCase.GetDisplayAccounts, | ||
) : ViewModel() { | ||
val displayAccountsLiveData: LiveData<List<DisplayAccount>> = getDisplayAccounts.execute().asLiveData() | ||
} |
2 changes: 1 addition & 1 deletion
2
...l/legacy/ui/folder/DisplayUnifiedInbox.kt → ...tion/drawer/legacy/DisplayUnifiedInbox.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...app/k9mail/legacy/ui/folder/FolderList.kt → ...re/navigation/drawer/legacy/FolderList.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...t/unread/src/test/kotlin/app/k9mail/feature/widget/unread/UnreadWidgetDataProviderTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
legacy/core/src/main/java/com/fsck/k9/mailstore/SpecialFolderSelectionStrategy.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
legacy/core/src/main/java/com/fsck/k9/mailstore/SpecialFolderUpdater.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ android { | |
|
||
dependencies { | ||
implementation(projects.mail.common) | ||
|
||
implementation(projects.core.mail.folder.api) | ||
} |
2 changes: 2 additions & 0 deletions
2
legacy/folder/src/main/kotlin/app/k9mail/legacy/folder/RemoteFolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.