@@ -17,17 +17,27 @@ import com.facebook.yoga.YogaEdge
17
17
import com.maubis.markdown.Markdown
18
18
import com.maubis.scarlet.base.R
19
19
import com.maubis.scarlet.base.config.ApplicationBase
20
+ import com.maubis.scarlet.base.config.ApplicationBase.Companion.instance
20
21
import com.maubis.scarlet.base.config.CoreConfig
21
22
import com.maubis.scarlet.base.config.CoreConfig.Companion.FONT_MONSERRAT
22
23
import com.maubis.scarlet.base.support.sheets.LithoBottomSheet
23
24
import com.maubis.scarlet.base.support.sheets.getLithoBottomSheetTitle
24
25
import com.maubis.scarlet.base.support.specs.*
25
26
import com.maubis.scarlet.base.support.ui.LithoCircleDrawable
26
27
import com.maubis.scarlet.base.support.ui.ThemeColorType
28
+ import com.maubis.scarlet.base.support.utils.Flavor
27
29
28
30
class WhatsNewBottomSheet : LithoBottomSheet () {
29
31
30
32
override fun getComponent (componentContext : ComponentContext , dialog : Dialog ): Component {
33
+ val options = listOf (
34
+ if (instance.appFlavor() == Flavor .NONE ) null else GridSectionOptionItem (R .drawable.gdrive_icon, R .string.whats_new_sheet_google_drive, {}),
35
+ if (instance.appFlavor() == Flavor .NONE ) null else GridSectionOptionItem (R .drawable.ic_image_gallery, R .string.whats_new_sheet_photo_sync, {}),
36
+ GridSectionOptionItem (R .drawable.ic_action_lock, R .string.whats_new_sheet_app_lock, {}),
37
+ GridSectionOptionItem (R .drawable.ic_action_select, R .string.whats_new_sheet_selection, {}),
38
+ GridSectionOptionItem (R .drawable.icon_widget, R .string.whats_new_sheet_widget, {}),
39
+ GridSectionOptionItem (R .drawable.ic_image_gallery, R .string.whats_new_sheet_more_languages, {}))
40
+
31
41
val component = Column .create(componentContext)
32
42
.widthPercent(100f )
33
43
.paddingDip(YogaEdge .VERTICAL , 8f )
@@ -45,14 +55,7 @@ class WhatsNewBottomSheet : LithoBottomSheet() {
45
55
.maxLines(3 )
46
56
.numColumns(2 )
47
57
.iconSizeRes(R .dimen.ultra_large_round_icon_size)
48
- .section(GridSectionItem (options = listOf (
49
- GridSectionOptionItem (R .drawable.gdrive_icon, R .string.whats_new_sheet_google_drive, {}),
50
- GridSectionOptionItem (R .drawable.ic_image_gallery, R .string.whats_new_sheet_photo_sync, {}),
51
- GridSectionOptionItem (R .drawable.ic_action_lock, R .string.whats_new_sheet_app_lock, {}),
52
- GridSectionOptionItem (R .drawable.ic_action_select, R .string.whats_new_sheet_selection, {}),
53
- GridSectionOptionItem (R .drawable.icon_widget, R .string.whats_new_sheet_widget, {}),
54
- GridSectionOptionItem (R .drawable.ic_image_gallery, R .string.whats_new_sheet_more_languages, {})
55
- )))
58
+ .section(GridSectionItem (options = options.filterNotNull()))
56
59
.showSeparator(false ))
57
60
.child(BottomSheetBar .create(componentContext)
58
61
.primaryActionRes(R .string.import_export_layout_exporting_done)
0 commit comments