mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Delabs polls.
This commit is contained in:
parent
b0b92c062e
commit
749194b27c
5 changed files with 3 additions and 22 deletions
|
@ -48,8 +48,4 @@ class UserPreferencesProvider @Inject constructor(private val vectorPreferences:
|
||||||
fun shouldShowAvatarDisplayNameChanges(): Boolean {
|
fun shouldShowAvatarDisplayNameChanges(): Boolean {
|
||||||
return vectorPreferences.showAvatarDisplayNameChangeMessages()
|
return vectorPreferences.showAvatarDisplayNameChangeMessages()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun shouldShowPolls(): Boolean {
|
|
||||||
return vectorPreferences.labsEnablePolls()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1373,7 +1373,6 @@ class RoomDetailFragment @Inject constructor(
|
||||||
override fun onAddAttachment() {
|
override fun onAddAttachment() {
|
||||||
if (!::attachmentTypeSelector.isInitialized) {
|
if (!::attachmentTypeSelector.isInitialized) {
|
||||||
attachmentTypeSelector = AttachmentTypeSelectorView(vectorBaseActivity, vectorBaseActivity.layoutInflater, this@RoomDetailFragment)
|
attachmentTypeSelector = AttachmentTypeSelectorView(vectorBaseActivity, vectorBaseActivity.layoutInflater, this@RoomDetailFragment)
|
||||||
attachmentTypeSelector.setAttachmentVisibility(AttachmentTypeSelectorView.Type.POLL, vectorPreferences.labsEnablePolls())
|
|
||||||
}
|
}
|
||||||
attachmentTypeSelector.show(views.composerLayout.views.attachmentButton)
|
attachmentTypeSelector.show(views.composerLayout.views.attachmentButton)
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,8 +119,6 @@ class TimelineEventVisibilityHelper @Inject constructor(private val userPreferen
|
||||||
val diff = computeMembershipDiff()
|
val diff = computeMembershipDiff()
|
||||||
if ((diff.isJoin || diff.isPart) && !userPreferencesProvider.shouldShowJoinLeaves()) return true
|
if ((diff.isJoin || diff.isPart) && !userPreferencesProvider.shouldShowJoinLeaves()) return true
|
||||||
if ((diff.isAvatarChange || diff.isDisplaynameChange) && !userPreferencesProvider.shouldShowAvatarDisplayNameChanges()) return true
|
if ((diff.isAvatarChange || diff.isDisplaynameChange) && !userPreferencesProvider.shouldShowAvatarDisplayNameChanges()) return true
|
||||||
} else if (root.getClearType() == EventType.POLL_START && !userPreferencesProvider.shouldShowPolls()) {
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,8 +196,6 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||||
|
|
||||||
private const val TAKE_PHOTO_VIDEO_MODE = "TAKE_PHOTO_VIDEO_MODE"
|
private const val TAKE_PHOTO_VIDEO_MODE = "TAKE_PHOTO_VIDEO_MODE"
|
||||||
|
|
||||||
private const val SETTINGS_LABS_ENABLE_POLLS = "SETTINGS_LABS_ENABLE_POLLS"
|
|
||||||
|
|
||||||
// Possible values for TAKE_PHOTO_VIDEO_MODE
|
// Possible values for TAKE_PHOTO_VIDEO_MODE
|
||||||
const val TAKE_PHOTO_VIDEO_MODE_ALWAYS_ASK = 0
|
const val TAKE_PHOTO_VIDEO_MODE_ALWAYS_ASK = 0
|
||||||
const val TAKE_PHOTO_VIDEO_MODE_PHOTO = 1
|
const val TAKE_PHOTO_VIDEO_MODE_PHOTO = 1
|
||||||
|
@ -991,8 +989,4 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
||||||
putInt(TAKE_PHOTO_VIDEO_MODE, mode)
|
putInt(TAKE_PHOTO_VIDEO_MODE, mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun labsEnablePolls(): Boolean {
|
|
||||||
return defaultPrefs.getBoolean(SETTINGS_LABS_ENABLE_POLLS, false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,14 +53,8 @@
|
||||||
|
|
||||||
<im.vector.app.core.preference.VectorSwitchPreference
|
<im.vector.app.core.preference.VectorSwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="SETTINGS_LABS_ENABLE_POLLS"
|
android:key="SETTINGS_LABS_AUTO_REPORT_UISI"
|
||||||
android:title="@string/labs_enable_polls" />
|
android:summary="@string/labs_auto_report_uisi_desc"
|
||||||
|
android:title="@string/labs_auto_report_uisi" />
|
||||||
|
|
||||||
<im.vector.app.core.preference.VectorSwitchPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="SETTINGS_LABS_AUTO_REPORT_UISI"
|
|
||||||
android:title="@string/labs_auto_report_uisi"
|
|
||||||
android:summary="@string/labs_auto_report_uisi_desc"/>
|
|
||||||
|
|
||||||
</androidx.preference.PreferenceScreen>
|
</androidx.preference.PreferenceScreen>
|
Loading…
Reference in a new issue