Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 6f428c16 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #6745 from thundernest/change_log_snackbar

Change "recent changes" snackbar appearance and behavior
parents c642d761 3060e111
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ import timber.log.Timber

private const val MAXIMUM_MESSAGE_SORT_OVERRIDES = 3
private const val MINIMUM_CLICK_INTERVAL = 200L
private const val RECENT_CHANGES_SNACKBAR_DURATION = 10 * 1000

class MessageListFragment :
    Fragment(),
@@ -363,12 +364,12 @@ class MessageListFragment :
        val coordinatorLayout = requireView().findViewById<View>(R.id.message_list_coordinator)

        recentChangesSnackbar = Snackbar
            .make(coordinatorLayout, R.string.changelog_snackbar_text, Snackbar.LENGTH_INDEFINITE)
            .setAction(R.string.okay_action) { launchRecentChangesActivity() }
            .make(coordinatorLayout, R.string.changelog_snackbar_text, RECENT_CHANGES_SNACKBAR_DURATION)
            .setAction(R.string.changelog_snackbar_button_text) { launchRecentChangesActivity() }
            .addCallback(
                object : BaseCallback<Snackbar>() {
                    override fun onDismissed(transientBottomBar: Snackbar?, event: Int) {
                        if (event == DISMISS_EVENT_SWIPE) {
                        if (event == DISMISS_EVENT_SWIPE || event == DISMISS_EVENT_TIMEOUT) {
                            recentChangesViewModel.onRecentChangesHintDismissed()
                        }
                    }
+3 −0
Original line number Diff line number Diff line
@@ -29,7 +29,10 @@
    <string name="changelog_version_title">Version %s</string>
    <string name="changelog_recent_changes_title">What\'s new</string>
    <string name="changelog_show_recent_changes">Show recent changes when app was updated</string>
    <!-- Displayed in a "snack bar" at the bottom of the screen when the app was updated. -->
    <string name="changelog_snackbar_text">Find out what\'s new in this release</string>
    <!-- Button text of the "snack bar" that is displayed when the app was updated. -->
    <string name="changelog_snackbar_button_text">View</string>


    <!-- Welcome message -->
+4 −0
Original line number Diff line number Diff line
@@ -115,5 +115,9 @@
        <item name="actionMenuTextColor">?android:attr/textColorSecondary</item>
    </style>

    <style name="Widget.K9.Button.Snackbar" parent="Widget.MaterialComponents.Button.TextButton.Snackbar">
        <item name="android:textColor">?attr/colorSecondary</item>
    </style>

</resources>
+4 −0
Original line number Diff line number Diff line
@@ -164,6 +164,8 @@
        <item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Light</item>
        <item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Light</item>
        <item name="behindRecyclerView">#F0F0F0</item>

        <item name="snackbarButtonStyle">@style/Widget.K9.Button.Snackbar</item>
    </style>

    <style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
@@ -330,6 +332,8 @@
        <item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Dark</item>

        <item name="behindRecyclerView">#202020</item>

        <item name="snackbarButtonStyle">@style/Widget.K9.Button.Snackbar</item>
    </style>

    <style name="Theme.K9.Dialog.Light" parent="Theme.K9.Light">