File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed
app/src/main/java/com/infomaniak/mail/ui Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ import com.infomaniak.mail.data.models.draft.Draft.DraftAction
6262import com.infomaniak.mail.databinding.ActivityMainBinding
6363import com.infomaniak.mail.firebase.RegisterFirebaseBroadcastReceiver
6464import com.infomaniak.mail.ui.alertDialogs.DescriptionAlertDialog
65- import com.infomaniak.mail.ui.alertDialogs.TitleAlertDialog
6665import com.infomaniak.mail.ui.main.SnackbarManager
6766import com.infomaniak.mail.ui.main.folder.TwoPaneFragment
6867import com.infomaniak.mail.ui.main.menuDrawer.MenuDrawerFragment
@@ -139,9 +138,6 @@ class MainActivity : BaseActivity() {
139138 @Inject
140139 lateinit var descriptionDialog: DescriptionAlertDialog
141140
142- @Inject
143- lateinit var titleDialog: TitleAlertDialog
144-
145141 @Inject
146142 lateinit var permissionUtils: PermissionUtils
147143
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ interface MailboxListFragment {
4949 )
5050 }
5151
52- fun Fragment.onValidMailboxClicked (mailboxId : Int ) {
53- lifecycleScope.launch { AccountUtils .switchToMailbox(mailboxId) }
52+ fun Fragment.onValidMailboxClicked (mailboxId : Int ) = lifecycleScope.launch {
53+ AccountUtils .switchToMailbox(mailboxId)
5454 }
5555}
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ class FolderAdapter @Inject constructor(
7474 return this
7575 }
7676
77+ override fun getItemCount (): Int = runCatchingRealm { folders.size }.getOrDefault(0 )
78+
79+ override fun getItemViewType (position : Int ): Int {
80+ return if (isInMenuDrawer) DisplayType .MENU_DRAWER .layout else DisplayType .SELECTABLE_FOLDER .layout
81+ }
82+
7783 override fun onCreateViewHolder (parent : ViewGroup , viewType : Int ): FolderViewHolder {
7884 val layoutInflater = LayoutInflater .from(parent.context)
7985 val binding = if (viewType == DisplayType .SELECTABLE_FOLDER .layout) {
@@ -105,12 +111,6 @@ class FolderAdapter @Inject constructor(
105111 }
106112 }
107113
108- override fun getItemViewType (position : Int ): Int {
109- return if (isInMenuDrawer) DisplayType .MENU_DRAWER .layout else DisplayType .SELECTABLE_FOLDER .layout
110- }
111-
112- override fun getItemCount (): Int = runCatchingRealm { folders.size }.getOrDefault(0 )
113-
114114 private fun UnreadFolderItemView.displayMenuDrawerFolder (folder : Folder ) {
115115
116116 val unread = when (folder.role) {
You can’t perform that action at this time.
0 commit comments