Commit 62f4aff 1 parent 9fbeb27 commit 62f4aff Copy full SHA for 62f4aff
File tree 3 files changed +8
-12
lines changed
app/src/main/java/com/infomaniak/mail/ui
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
62
62
import com.infomaniak.mail.databinding.ActivityMainBinding
63
63
import com.infomaniak.mail.firebase.RegisterFirebaseBroadcastReceiver
64
64
import com.infomaniak.mail.ui.alertDialogs.DescriptionAlertDialog
65
- import com.infomaniak.mail.ui.alertDialogs.TitleAlertDialog
66
65
import com.infomaniak.mail.ui.main.SnackbarManager
67
66
import com.infomaniak.mail.ui.main.folder.TwoPaneFragment
68
67
import com.infomaniak.mail.ui.main.menuDrawer.MenuDrawerFragment
@@ -139,9 +138,6 @@ class MainActivity : BaseActivity() {
139
138
@Inject
140
139
lateinit var descriptionDialog: DescriptionAlertDialog
141
140
142
- @Inject
143
- lateinit var titleDialog: TitleAlertDialog
144
-
145
141
@Inject
146
142
lateinit var permissionUtils: PermissionUtils
147
143
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ interface MailboxListFragment {
49
49
)
50
50
}
51
51
52
- fun Fragment.onValidMailboxClicked (mailboxId : Int ) {
53
- lifecycleScope.launch { AccountUtils .switchToMailbox(mailboxId) }
52
+ fun Fragment.onValidMailboxClicked (mailboxId : Int ) = lifecycleScope.launch {
53
+ AccountUtils .switchToMailbox(mailboxId)
54
54
}
55
55
}
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ class FolderAdapter @Inject constructor(
74
74
return this
75
75
}
76
76
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
+
77
83
override fun onCreateViewHolder (parent : ViewGroup , viewType : Int ): FolderViewHolder {
78
84
val layoutInflater = LayoutInflater .from(parent.context)
79
85
val binding = if (viewType == DisplayType .SELECTABLE_FOLDER .layout) {
@@ -105,12 +111,6 @@ class FolderAdapter @Inject constructor(
105
111
}
106
112
}
107
113
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
-
114
114
private fun UnreadFolderItemView.displayMenuDrawerFolder (folder : Folder ) {
115
115
116
116
val unread = when (folder.role) {
You can’t perform that action at this time.
0 commit comments