fix crash in SearchFragment
This commit is contained in:
parent
5b8b8d9fe0
commit
41743b0dca
1 changed files with 9 additions and 6 deletions
|
@ -29,7 +29,6 @@ import com.keylesspalace.tusky.R
|
||||||
import com.keylesspalace.tusky.ViewTagActivity
|
import com.keylesspalace.tusky.ViewTagActivity
|
||||||
import com.keylesspalace.tusky.adapter.SearchResultsAdapter
|
import com.keylesspalace.tusky.adapter.SearchResultsAdapter
|
||||||
import com.keylesspalace.tusky.di.Injectable
|
import com.keylesspalace.tusky.di.Injectable
|
||||||
import com.keylesspalace.tusky.entity.Attachment
|
|
||||||
import com.keylesspalace.tusky.entity.SearchResults
|
import com.keylesspalace.tusky.entity.SearchResults
|
||||||
import com.keylesspalace.tusky.entity.Status
|
import com.keylesspalace.tusky.entity.Status
|
||||||
import com.keylesspalace.tusky.interfaces.StatusActionListener
|
import com.keylesspalace.tusky.interfaces.StatusActionListener
|
||||||
|
@ -58,7 +57,7 @@ class SearchFragment : SFragment(), StatusActionListener, Injectable {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
val preferences = PreferenceManager.getDefaultSharedPreferences(activity)
|
val preferences = PreferenceManager.getDefaultSharedPreferences(view.context)
|
||||||
alwaysShowSensitiveMedia = preferences.getBoolean("alwaysShowSensitiveMedia", false)
|
alwaysShowSensitiveMedia = preferences.getBoolean("alwaysShowSensitiveMedia", false)
|
||||||
mediaPreviewEnabled = preferences.getBoolean("mediaPreviewEnabled", true)
|
mediaPreviewEnabled = preferences.getBoolean("mediaPreviewEnabled", true)
|
||||||
|
|
||||||
|
@ -106,13 +105,17 @@ class SearchFragment : SFragment(), StatusActionListener, Injectable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun displayNoResults() {
|
private fun displayNoResults() {
|
||||||
searchProgressBar.visibility = View.GONE
|
if(isAdded) {
|
||||||
searchNoResultsText.visibility = View.VISIBLE
|
searchProgressBar.visibility = View.GONE
|
||||||
|
searchNoResultsText.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hideFeedback() {
|
private fun hideFeedback() {
|
||||||
searchProgressBar.visibility = View.GONE
|
if(isAdded) {
|
||||||
searchNoResultsText.visibility = View.GONE
|
searchProgressBar.visibility = View.GONE
|
||||||
|
searchNoResultsText.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun timelineCases(): TimelineCases {
|
override fun timelineCases(): TimelineCases {
|
||||||
|
|
Loading…
Reference in a new issue