[Feature] Make Title a require field on the CallCompositeNavigationBarViewData (#407)

This commit is contained in:
pavelprystinka 2022-09-02 12:41:50 -07:00 коммит произвёл Mohtasim
Родитель 585d111496
Коммит d7abbfd738
9 изменённых файлов: 57 добавлений и 94 удалений

Просмотреть файл

@ -1,6 +1,3 @@
# Release History
[Communication UI Calling Library CHANGELOG](docs/CHANGELOG_UI_CALLING.md)
### Features
- New error code 'unknownError' introduced for ambiguous errors such as device manager error

Просмотреть файл

@ -31,8 +31,8 @@ class SettingsActivity : AppCompatActivity() {
private lateinit var languageSettingLabelDivider: View
private lateinit var languageAdapterLayout: TextInputLayout
private lateinit var renderDisplayNameTextView: TextView
private lateinit var callTitleTextView: TextView
private lateinit var callSubTitleTextView: TextView
private lateinit var titleTextView: TextView
private lateinit var subtitleTextView: TextView
private lateinit var remoteAvatarInjectionCheckBox: CheckBox
private val sharedPreference by lazy {
@ -50,8 +50,8 @@ class SettingsActivity : AppCompatActivity() {
}
setLanguageInSharedPrefForFirstTime()
updateRenderedDisplayNameText()
updateCallTitle()
updateCallSubTitle()
updateTitle()
updateSubtitle()
}
override fun onResume() {
@ -112,13 +112,13 @@ class SettingsActivity : AppCompatActivity() {
renderDisplayNameTextView.addTextChangedListener {
saveRenderedDisplayName()
}
callTitleTextView = findViewById(R.id.call_title)
callSubTitleTextView = findViewById(R.id.call_subtitle)
callTitleTextView.addTextChangedListener {
saveCallTitle()
titleTextView = findViewById(R.id.call_title)
subtitleTextView = findViewById(R.id.call_subtitle)
titleTextView.addTextChangedListener {
saveTitle()
}
callSubTitleTextView.addTextChangedListener {
saveCallSubTitle()
subtitleTextView.addTextChangedListener {
saveSubtitle()
}
}
@ -175,26 +175,26 @@ class SettingsActivity : AppCompatActivity() {
.putString(RENDERED_DISPLAY_NAME, renderDisplayNameTextView.text.toString()).apply()
}
private fun saveCallTitle() {
private fun saveTitle() {
sharedPreference.edit()
.putString(CALL_TITLE, callTitleTextView.text.toString()).apply()
.putString(CALL_TITLE, titleTextView.text.toString()).apply()
}
private fun saveCallSubTitle() {
private fun saveSubtitle() {
sharedPreference.edit()
.putString(CALL_SUBTITLE, callSubTitleTextView.text.toString()).apply()
.putString(CALL_SUBTITLE, subtitleTextView.text.toString()).apply()
}
private fun updateRenderedDisplayNameText() {
renderDisplayNameTextView.text = sharedPreference.getString(RENDERED_DISPLAY_NAME, "")
}
private fun updateCallTitle() {
callTitleTextView.text = sharedPreference.getString(CALL_TITLE, null)
private fun updateTitle() {
titleTextView.text = sharedPreference.getString(CALL_TITLE, null)
}
private fun updateCallSubTitle() {
callSubTitleTextView.text = sharedPreference.getString(CALL_SUBTITLE, null)
private fun updateSubtitle() {
subtitleTextView.text = sharedPreference.getString(CALL_SUBTITLE, null)
}
private fun updateAvatarInjectionCheckbox() {

Просмотреть файл

@ -91,9 +91,9 @@ class SettingsFeatures {
}
@JvmStatic
fun getCallTitle(): String? = sharedPrefs.getString(CALL_TITLE, null)
fun getTitle(): String? = sharedPrefs.getString(CALL_TITLE, null)
@JvmStatic
fun getCallSubTitle(): String? = sharedPrefs.getString(CALL_SUBTITLE, null)
fun getSubtitle(): String? = sharedPrefs.getString(CALL_SUBTITLE, null)
}
}

Просмотреть файл

@ -80,9 +80,9 @@ public class CallingCompositeJavaLauncher implements CallingCompositeLauncher {
final CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions()
.setParticipantViewData(SettingsFeatures
.getParticipantViewData(callLauncherActivity.getApplicationContext()))
.setNavigationBarViewData(new CallCompositeNavigationBarViewData()
.setCallTitle(SettingsFeatures.getCallTitle())
.setCallSubTitle(SettingsFeatures.getCallSubTitle()));
.setNavigationBarViewData(
new CallCompositeNavigationBarViewData(SettingsFeatures.getTitle())
.setSubtitle(SettingsFeatures.getSubtitle()));
callComposite.launch(callLauncherActivity, remoteOptions, localOptions);
}

Просмотреть файл

@ -19,11 +19,11 @@ import com.azure.android.communication.ui.callingcompositedemoapp.CallLauncherAc
import com.azure.android.communication.ui.callingcompositedemoapp.R
import com.azure.android.communication.ui.callingcompositedemoapp.RemoteParticipantJoinedHandler
import com.azure.android.communication.ui.callingcompositedemoapp.features.AdditionalFeatures
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getCallSubTitle
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getCallTitle
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getLayoutDirection
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getParticipantViewData
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getRemoteParticipantPersonaInjectionSelection
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getSubtitle
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.getTitle
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.initialize
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.language
import com.azure.android.communication.ui.callingcompositedemoapp.features.SettingsFeatures.Companion.locale
@ -76,9 +76,8 @@ class CallingCompositeKotlinLauncher(private val tokenRefresher: Callable<String
val localOptions = CallCompositeLocalOptions()
.setParticipantViewData(getParticipantViewData(callLauncherActivity.applicationContext))
.setNavigationBarViewData(
CallCompositeNavigationBarViewData()
.setCallTitle(getCallTitle())
.setCallSubTitle(getCallSubTitle())
CallCompositeNavigationBarViewData(getTitle())
.setSubtitle(getSubtitle())
)
callComposite.launch(callLauncherActivity, remoteOptions, localOptions)

Просмотреть файл

@ -4,55 +4,56 @@
package com.azure.android.communication.ui.calling.models;
/**
* Provides navigation bar view data to Call Composite including title and subTitle
* Provides navigation bar view data to Call Composite including title and subtitle
*
* Create an instance of CallCompositeNavigationBarViewData and pass it to
* {@link CallCompositeLocalOptions} when launching a new call
*
*/
public final class CallCompositeNavigationBarViewData {
private String callTitle = null;
private String callSubTitle = null;
private String title = null;
private String subtitle = null;
/**
* Constructs an empty {@link CallCompositeNavigationBarViewData}
*/
public CallCompositeNavigationBarViewData() { }
public CallCompositeNavigationBarViewData(final String title) {
this.title = title;
}
/**
* Get the call title
* @return The title of the call
*/
public String getCallTitle() {
return callTitle;
public String getTitle() {
return title;
}
/**
* Set the title of the call setup screen to the supplied String
* @param title Title of the call
* @return The current CallCompositeNavigationBarViewData for Fluent use
*/
public CallCompositeNavigationBarViewData setTitle(final String title) {
this.title = title;
return this;
}
/**
* Get the call sub title
* @return The subtitle of the call
*/
public String getCallSubTitle() {
return callSubTitle;
}
/**
* Set the title of the call setup screen to the supplied String
* @param callTitle Title of the call
* @return The current CallCompositeNavigationBarViewData for Fluent use
*/
public CallCompositeNavigationBarViewData setCallTitle(final String callTitle) {
this.callTitle = callTitle;
return this;
public String getSubtitle() {
return subtitle;
}
/**
* Set the subtitle of the call setup screen to the supplied String
* @param callSubTitle Subtitle of the call
* @param subtitle Subtitle of the call
* @return The current CallCompositeNavigationBarViewData for Fluent use
*/
public CallCompositeNavigationBarViewData setCallSubTitle(final String callSubTitle) {
this.callSubTitle = callSubTitle;
public CallCompositeNavigationBarViewData setSubtitle(final String subtitle) {
this.subtitle = subtitle;
return this;
}
}

Просмотреть файл

@ -131,8 +131,8 @@ internal class SetupFragment :
}
val localOptions = holder.container.configuration.callCompositeLocalOptions
val titleSpan = if (!TextUtils.isEmpty(localOptions?.navigationBarViewData?.callTitle)) {
SpannableString(localOptions?.navigationBarViewData?.callTitle)
val titleSpan = if (!TextUtils.isEmpty(localOptions?.navigationBarViewData?.title)) {
SpannableString(localOptions?.navigationBarViewData?.title)
} else {
SpannableString(getString(R.string.azure_communication_ui_calling_call_setup_action_bar_title))
}
@ -142,10 +142,10 @@ internal class SetupFragment :
callCompositeActivity.supportActionBar?.title = titleSpan
// Only set the subTitle if the title has also been set
if (!TextUtils.isEmpty(localOptions?.navigationBarViewData?.callTitle) &&
!TextUtils.isEmpty(localOptions?.navigationBarViewData?.callSubTitle)
if (!TextUtils.isEmpty(localOptions?.navigationBarViewData?.title) &&
!TextUtils.isEmpty(localOptions?.navigationBarViewData?.subtitle)
) {
val subtitleSpan = SpannableString(localOptions?.navigationBarViewData?.callSubTitle)
val subtitleSpan = SpannableString(localOptions?.navigationBarViewData?.subtitle)
setActionbarTextColor(subtitleSpan, R.color.azure_communication_ui_calling_color_action_bar_subtext)
callCompositeActivity.supportActionBar?.subtitle = subtitleSpan
}

Просмотреть файл

@ -1,36 +0,0 @@
# Release History
## 1.0.0-beta.3 (2022-04-04)
### Bug Fixes
- Fixed crash when internal feature flag API was not initialized
## 1.0.0-beta.2 (2022-04-04)
### New Features
- Status bar color change for light and dark mode
- API 21, 22 support
- Screen share pinch zoom support
- Localization support
- Update joining experience to show call join processing indicator in setup view
- Bluetooth headphones support
### Breaking Changes
- Remove Context from GroupMeetingOptions() and TeamMeetingOptions()
- Add required parameter Context to CallComposite.launch()
- Rename ErrorEvent to CommunicationUIErrorEvent
- Rename `azure_communication_ui_calling_primary_color` to `azure_communication_ui_communication_primary` in Theme.
### Bug Fixes
- Start service is crashing for API 31
- Long display name truncation on local participant display view
- Sort participants, append suffix for local Participant and handle unnamed participant for the Participant List
## 1.0.0-beta.1 (2021-12-08)
This is the initial release of Azure Communication UI Library. For more information, please see the [README][read_me] and [QuickStart][documentation].
This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Issues](https://github.com/Azure/communication-ui-library-android/issues).
<!-- LINKS -->
[read_me]: https://github.com/Azure/communication-ui-library-android/blob/main/README.md
[documentation]: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/ui-library/get-started-call?tabs=kotlin&pivots=platform-android

Просмотреть файл

@ -1,5 +1,7 @@
# Azure Communication UI Calling Release History
## TBA (upcoming release)
### Features
- Setting up Group Call Title and Subtitle is now possible by customizing CallCompositeLocalOptions with CallCompositeNavigationBarViewData
- Implemented new error message `cameraFailure` that can be sent to developers when turning on camera fails.