Add full screen intent permissions banner (#3024)

* Add full screen intent permissions banner, creating `:libraries:fullscreenintent` modules.
* Add it to notification settings too:
    - Create `libraries:fullscreenintent` modules for the permission presenter and associated data.
    - Add the presenter and states to `NotificationSettingsPresenter` and `NotificationSettingsView`.
* Use the right API to check for full screen intent permissions.
- Use the right package name for `:libraries:permission` contents.
* Fix broken tests (flaky?)
* Ignore coverage verification for fake and small presenters

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2024-06-18 09:41:10 +02:00 committed by GitHub
parent 7322c75a67
commit feef0f6976
163 changed files with 867 additions and 48 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2024 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("io.element.android-compose-library")
}
android {
namespace = "io.element.android.libraries.fullscreenintent.test"
}
dependencies {
api(projects.libraries.fullscreenintent.api)
implementation(projects.libraries.architecture)
}

View file

@ -0,0 +1,34 @@
/*
* Copyright (c) 2024 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.libraries.fullscreenintent.test
import androidx.compose.runtime.Composable
import io.element.android.libraries.fullscreenintent.api.FullScreenIntentPermissionsPresenter
import io.element.android.libraries.fullscreenintent.api.FullScreenIntentPermissionsState
class FakeFullScreenIntentPermissionsPresenter : FullScreenIntentPermissionsPresenter {
var state = FullScreenIntentPermissionsState(
permissionGranted = true,
shouldDisplayBanner = false,
dismissFullScreenIntentBanner = {},
openFullScreenIntentSettings = {},
)
@Composable
override fun present(): FullScreenIntentPermissionsState {
return state
}
}