Skip to content

Commit

Permalink
Improve refreshing settings fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
igrek51 committed Feb 19, 2020
1 parent b7bc95c commit 99fdc62
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/main/java/igrek/songbook/settings/SettingsFragment.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package igrek.songbook.settings

import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentTransaction
import androidx.preference.*
import igrek.songbook.R
import igrek.songbook.dagger.DaggerIoc
Expand Down Expand Up @@ -235,6 +237,15 @@ class SettingsFragment : PreferenceFragmentCompat() {
}
)

refreshFragment()
}

private fun refreshFragment() {
val ft: FragmentTransaction = fragmentManager!!.beginTransaction()
if (Build.VERSION.SDK_INT >= 26) {
ft.setReorderingAllowed(false)
}
ft.detach(this).attach(this).commit()
}

private fun toggleAllMultiPreference(excludeLanguagesPreference: MultiSelectListPreference) {
Expand Down

0 comments on commit 99fdc62

Please sign in to comment.