Skip to content

Commit

Permalink
Release/6.1.0 (#17)
Browse files Browse the repository at this point in the history
Release/6.1.0
  • Loading branch information
ChaseApptentive authored Jul 20, 2023
1 parent b694bb4 commit 0b19f2c
Show file tree
Hide file tree
Showing 138 changed files with 17,725 additions and 1,186 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# 2023-07-20 - v6.1.0
#### New Features
* Survey skip logic

#### Improvements
* Survey terms and conditions can now be added from the dashboard
* Survey disclaimer can now be added from the dashboard
* Various accessibility improvements around Surveys
* Apptentive Logger service retrieval backup

#### Fixes
* SparseArray backwards compatibility

#### Known Issues and Limitations
* Client authentication (login/logout) is not yet supported

# 2023-05-17 - v6.0.5
#### Improvements
* Added Java interoperable support for push functions
Expand All @@ -7,6 +23,8 @@
#### Fixes
* Resolved internal observers and observables issue

#### Known Issues and Limitations
* Client authentication (login/logout) is not yet supported

# 2023-04-05 - v6.0.4
#### Improvements
Expand All @@ -15,6 +33,9 @@
#### Fixes
* Resolved resource linking issues

#### Known Issues and Limitations
* Client authentication (login/logout) is not yet supported

# 2023-02-24 - v6.0.3
#### Improvements
* Support mParticleID collection
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package apptentive.com.android.ui

import android.util.SparseArray
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import apptentive.com.android.util.InternalUseOnly

@InternalUseOnly
class ApptentivePagerAdapter : RecyclerView.Adapter<ApptentiveViewHolder<ListViewItem>>() {
private val pages = mutableListOf<ListViewItem>()
private val viewHolderFactoryLookup = SparseArray<ViewHolderFactory>()

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ApptentiveViewHolder<ListViewItem> {
// resolve factory object
val viewHolderFactory = viewHolderFactoryLookup.get(viewType)

// create item view
val itemView = viewHolderFactory.createItemView(parent)

// create view holder
@Suppress("UNCHECKED_CAST")
return viewHolderFactory.createViewHolder(itemView) as ApptentiveViewHolder<ListViewItem>
}

override fun onBindViewHolder(holder: ApptentiveViewHolder<ListViewItem>, position: Int) {
holder.bindView(pages[position], position)
}

override fun getItemCount(): Int = pages.size

override fun getItemViewType(position: Int): Int {
return pages[position].itemType
}

fun register(itemType: Int, factory: ViewHolderFactory) {
viewHolderFactoryLookup.put(itemType, factory)
}

fun addOrUpdatePage(page: ListViewItem, isFocusEditText: Boolean) {
val index = pages.indexOfFirst { it.id == page.id }
if (index == -1) {
pages.add(page)
notifyItemInserted(pages.size - 1)
} else {
pages[index] = page
if (!isFocusEditText) notifyItemChanged(index)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package apptentive.com.android.ui

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import apptentive.com.android.util.InternalUseOnly

@InternalUseOnly
abstract class ApptentiveViewHolder<T : ListViewItem> constructor(itemView: View) :
RecyclerView.ViewHolder(itemView) {
abstract fun bindView(item: T, position: Int)
open fun updateView(item: T, position: Int, changeMask: Int) {
bindView(item, position)
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package apptentive.com.android.ui

import android.util.SparseArray
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import apptentive.com.android.util.InternalUseOnly

@InternalUseOnly
class ListViewAdapter : ListAdapter<ListViewItem, ListViewAdapter.ViewHolder<ListViewItem>>(DIFF) {
class ListViewAdapter : ListAdapter<ListViewItem, ApptentiveViewHolder<ListViewItem>>(DIFF) {
private val viewHolderFactoryLookup = SparseArray<ViewHolderFactory>()

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder<ListViewItem> {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ApptentiveViewHolder<ListViewItem> {
// resolve factory object
val viewHolderFactory = viewHolderFactoryLookup.get(viewType)

Expand All @@ -21,11 +19,11 @@ class ListViewAdapter : ListAdapter<ListViewItem, ListViewAdapter.ViewHolder<Lis

// create view holder
@Suppress("UNCHECKED_CAST")
return viewHolderFactory.createViewHolder(itemView) as ViewHolder<ListViewItem>
return viewHolderFactory.createViewHolder(itemView) as ApptentiveViewHolder<ListViewItem>
}

override fun onBindViewHolder(
holder: ViewHolder<ListViewItem>,
holder: ApptentiveViewHolder<ListViewItem>,
position: Int,
payloads: MutableList<Any>
) {
Expand All @@ -37,7 +35,7 @@ class ListViewAdapter : ListAdapter<ListViewItem, ListViewAdapter.ViewHolder<Lis
}
}

override fun onBindViewHolder(holder: ViewHolder<ListViewItem>, position: Int) {
override fun onBindViewHolder(holder: ApptentiveViewHolder<ListViewItem>, position: Int) {
holder.bindView(getItem(position), position)
}

Expand All @@ -46,15 +44,7 @@ class ListViewAdapter : ListAdapter<ListViewItem, ListViewAdapter.ViewHolder<Lis
}

fun register(itemType: Int, factory: ViewHolderFactory) {
viewHolderFactoryLookup[itemType] = factory
}

abstract class ViewHolder<T : ListViewItem> constructor(itemView: View) :
RecyclerView.ViewHolder(itemView) {
abstract fun bindView(item: T, position: Int)
open fun updateView(item: T, position: Int, changeMask: Int) {
bindView(item, position)
}
viewHolderFactoryLookup.put(itemType, factory)
}

private companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import apptentive.com.android.util.InternalUseOnly
@InternalUseOnly
interface ViewHolderFactory {
fun createItemView(parent: ViewGroup): View
fun createViewHolder(itemView: View): ListViewAdapter.ViewHolder<*>
fun createViewHolder(itemView: View): ApptentiveViewHolder<*>
}

@InternalUseOnly
class LayoutViewHolderFactory(
private val layoutId: Int,
private val viewHolderCreator: (View) -> ListViewAdapter.ViewHolder<*>
private val viewHolderCreator: (View) -> ApptentiveViewHolder<*>,
) : ViewHolderFactory {
override fun createItemView(parent: ViewGroup): View {
return LayoutInflater.from(parent.context).inflate(layoutId, parent, false)
}

override fun createViewHolder(itemView: View): ListViewAdapter.ViewHolder<*> {
override fun createViewHolder(itemView: View): ApptentiveViewHolder<*> {
return viewHolderCreator.invoke(itemView)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true">
<shape>
<solid android:color="?attr/apptentiveCustomFocusForegroundColor" />
<stroke android:color="?attr/apptentiveCustomFocusForegroundColor" android:width="2dp" />
</shape>
</item>
</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/apptentiveColorProgressBarCurrent" />
<corners android:radius="100dp" />
<size android:height="10dp"/>
</shape>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/apptentiveColorProgressBarNext" />
<corners android:radius="100dp" />
<size android:height="6dp" />
</shape>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/apptentiveColorProgressBarPrevious" />
<corners android:radius="100dp" />
<size android:height="6dp" />
</shape>
2 changes: 1 addition & 1 deletion apptentive-core-ui/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<color name="apptentive_color_primary">#40566B</color>
<color name="apptentive_color_on_primary">#E1E1E1</color>
<color name="apptentive_color_secondary">#94A8B8</color>
<color name="apptentive_color_on_secondary">#E1E1E1</color>
<color name="apptentive_color_on_secondary">#212121</color>
<color name="apptentive_color_background">#212121</color>
<color name="apptentive_color_on_background">#C4C4C4</color>
<color name="apptentive_color_surface">#212121</color>
Expand Down
28 changes: 28 additions & 0 deletions apptentive-core-ui/src/main/res/values/apptentive-attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<!-- Survey Styles Start -->
<!-- Layout -->
<attr name="apptentiveSurveyLayoutStyle" format="reference"/>
<attr name="apptentiveSurveyLayoutPagedStyle" format="reference"/>
<attr name="apptentiveSurveyIntroductionLayoutStyle" format="reference"/>
<attr name="apptentiveSurveySuccessLayoutStyle" format="reference"/>

<!-- App Bars -->
<attr name="apptentiveSurveyToolbarStyle" format="reference"/>
Expand All @@ -69,7 +72,9 @@
<!-- TextViews -->
<attr name="apptentiveSurveyTitleStyle" format="reference"/>
<attr name="apptentiveSurveyIntroductionStyle" format="reference"/>
<attr name="apptentiveSurveySuccessStyle" format="reference"/>
<attr name="apptentiveSurveyQuestionLayoutStyle" format="reference"/>
<attr name="apptentiveSurveyScrollViewLayoutStyle" format="reference"/>
<attr name="apptentiveSurveyQuestionTitleStyle" format="reference"/>
<attr name="apptentiveSurveyQuestionInstructionsStyle" format="reference"/>
<attr name="apptentiveSurveyQuestionErrorStyle" format="reference"/>
Expand All @@ -89,8 +94,17 @@
<attr name="apptentiveSurveyOtherTextFieldLayoutStyle" format="reference"/>
<attr name="apptentiveSurveyOtherTextFieldEditTextStyle" format="reference"/>
<attr name="apptentiveSurveySubmitButtonStyle" format="reference" />
<attr name="apptentiveSurveyNextButtonStyle" format="reference" />
<attr name="apptentiveSurveyButtonColorDefault" format="color|reference" />
<attr name="apptentiveSurveyQuestionDividerStyle" format="reference" />
<attr name="apptentiveSurveyViewPagerStyle" format="reference"/>

<attr name="apptentiveProgressBarLinearStyle" format="reference" />
<attr name="apptentiveProgressBarSegmentedStyle" format="reference" />
<attr name="apptentiveProgressBarSegmentedItemStyle" format="reference" />
<attr name="apptentiveProgressBarPreviousIcon" format="reference" />
<attr name="apptentiveProgressBarCurrentIcon" format="reference" />
<attr name="apptentiveProgressBarNextIcon" format="reference" />
<!-- Survey Styles End -->

<!-- Message Center -->
Expand Down Expand Up @@ -143,6 +157,7 @@
<attr name="apptentiveMessageCenterRemoveAttachmentImage" format="reference"/>
<attr name="apptentiveMessageCenterAttachmentProgressIndicator" format="reference"/>
<attr name="apptentiveMessageCenterMessageListLayoutStyle" format="reference"/>
<attr name="apptentiveCustomFocusForegroundStyle" format="reference" />

<!-- Text Color/Fill color -->
<attr name="apptentiveMessageCenterTextColorToolbarTitle" format="color|reference"/>
Expand Down Expand Up @@ -175,6 +190,7 @@
<attr name="apptentiveMessageCenterInboundTextColorLink" format="color|reference"/>
<attr name="apptentiveMessageCenterGreetingTextColorLink" format="color|reference"/>
<attr name="apptentiveMessageCenterOutboundTextColorLink" format="color|reference"/>
<attr name="apptentiveCustomFocusForegroundColor" format="color|reference" />

<!-- Other -->
<attr name="apptentiveMessageCenterAttachmentThumbnailSpacing" format="dimension"/>
Expand Down Expand Up @@ -205,6 +221,8 @@
<attr name="apptentiveTextSizeDialogTitleOrMessageOnly" format="dimension|reference" />
<attr name="apptentiveTextSizeSurveyQuestionTitle" format="dimension|reference" />
<attr name="apptentiveTextSizeSurveyIntroduction" format="dimension|reference" />
<attr name="apptentiveTextSizeSurveySuccess" format="dimension|reference" />
<attr name="apptentiveTextSizeSurveyDisclaimer" format="dimension|reference" />
<attr name="apptentiveTextSizeSubhead" format="dimension|reference" />
<attr name="apptentiveTextSizeButtonBorderless" format="dimension|reference" />
<attr name="apptentiveTextSizeBody1" format="dimension|reference" />
Expand All @@ -224,10 +242,18 @@
<attr name="apptentiveTextColorButtonColored" format="color|reference"/>
<attr name="apptentiveTextColorSurveyTitle" format="color|reference"/>
<attr name="apptentiveTextColorSurveyIntroduction" format="color|reference"/>
<attr name="apptentiveTextColorSurveySuccess" format="color|reference"/>
<attr name="apptentiveTextColorSurveyDisclaimer" format="color|reference"/>
<attr name="apptentiveTextColorSurveyRangeLabel" format="color|reference"/>
<attr name="apptentiveTextColorSurveyQuestionInstructions" format="color|reference"/>
<attr name="apptentiveTextColorSurveyTermsAndConditions" format="color|reference"/>

<attr name="apptentiveProgressBarLinearIndicatorColor" format="color|reference" />
<attr name="apptentiveProgressBarLinearTrackColor" format="color|reference" />
<attr name="apptentiveColorProgressBarPrevious" format="color|reference"/>
<attr name="apptentiveColorProgressBarNext" format="color|reference"/>
<attr name="apptentiveColorProgressBarCurrent" format="color|reference"/>

<!-- Text Alpha -->
<attr name="apptentiveHeaderAlpha" format="float|dimension|reference" />
<attr name="apptentiveSubheaderAlpha" format="float|dimension|reference" />
Expand All @@ -250,6 +276,8 @@
<attr name="apptentiveTypefaceToolbar" format="integer|reference" />
<attr name="apptentiveTypefaceTitle" format="integer|reference" />
<attr name="apptentiveTypefaceSurveyIntroduction" format="integer|reference" />
<attr name="apptentiveTypefaceSurveySuccess" format="integer|reference" />
<attr name="apptentiveTypefaceSurveyDisclaimer" format="integer|reference" />
<attr name="apptentiveTypefaceSubhead" format="integer|reference" />
<attr name="apptentiveTypefaceButtonBorderless" format="integer|reference" />
<attr name="apptentiveTypefaceBody1" format="integer|reference" />
Expand Down
3 changes: 3 additions & 0 deletions apptentive-core-ui/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
<color name="apptentive_color_icon_default_fill">#00000000</color>
<color name="apptentive_color_bottomsheet_icon">#757575</color>
<color name="apptentive_color_attachment_background">#F5F5F5</color>
<color name="apptentive_color_progress_bar_previous">#6D6D6D</color>
<color name="apptentive_color_progress_bar_next">#AEAEAE</color>
<color name="apptentive_color_focus_overlay">#80FFFFFF</color>
</resources>
25 changes: 19 additions & 6 deletions apptentive-core-ui/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dimen name="apptentive_text_size_default">14sp</dimen>
<dimen name="apptentive_text_size_dialog_title">18sp</dimen>
<dimen name="apptentive_text_size_survey_introduction">20sp</dimen>
<dimen name="apptentive_text_size_survey_success">20sp</dimen>
<dimen name="apptentive_text_size_survey_disclaimer">16sp</dimen>
<dimen name="apptentive_text_size_question_title">16sp</dimen>
<dimen name="apptentive_text_size_caption">12sp</dimen>
<dimen name="apptentive_text_size_small">10sp</dimen>
Expand All @@ -27,25 +29,36 @@

<!-- Activities -->
<dimen name="apptentive_activity_horizontal_margin_padding">16dp</dimen>
<dimen name="apptentive_survey_question_top_padding">8dp</dimen>
<dimen name="apptentive_survey_question_bottom_padding">24dp</dimen>
<dimen name="apptentive_survey_introduction_padding">16dp</dimen>

<!-- Survey -->
<dimen name="apptentive_survey_question_top_margin">8dp</dimen>
<dimen name="apptentive_survey_question_bottom_margin">24dp</dimen>
<dimen name="apptentive_survey_paged_layout_bottom_padding">24dp</dimen>
<dimen name="apptentive_survey_introduction_success_padding">16dp</dimen>
<dimen name="apptentive_survey_disclaimer_padding">16dp</dimen>
<dimen name="apptentive_survey_question_title_bottom_margin">8dp</dimen>
<dimen name="apptentive_survey_question_instructions_bottom_padding">4dp</dimen>
<dimen name="apptentive_survey_radio_checkbox_min_height">40dp</dimen>
<dimen name="apptentive_survey_radio_checkbox_range_horizontal_margin">11dp</dimen>
<dimen name="apptentive_survey_radio_checkbox_horizontal_padding">8dp</dimen>
<dimen name="apptentive_survey_radio_checkbox_vertical_padding">4dp</dimen>
<dimen name="apptentive_survey_other_text_field_start_margin">40dp</dimen>
<dimen name="apptentive_survey_range_label_top_padding">2dp</dimen>
<dimen name="apptentive_survey_range_label_bottom_padding">4dp</dimen>
<dimen name="apptentive_survey_range_label_max_height">30dp</dimen>
<dimen name="apptentive_survey_edit_text_min_height">48dp</dimen>
<dimen name="apptentive_survey_footers_vertical_padding_margin">16dp</dimen>
<dimen name="apptentive_survey_paged_button_bottom_margin">24dp</dimen>
<dimen name="apptentive_survey_error_button_margin">8dp</dimen>
<dimen name="apptentive_survey_terms_conditions_horizontal_padding">16dp</dimen>
<dimen name="apptentive_survey_terms_conditions_vertical_padding">12dp</dimen>
<dimen name="apptentive_bottom_app_bar_min_height">36dp</dimen>

<!-- Message center -->
<dimen name="apptentive_progress_bar_linear_horizontal_margin">16dp</dimen>
<dimen name="apptentive_progress_bar_linear_track_corner_radius">24dp</dimen>
<dimen name="apptentive_progress_bar_linear_track_thickness">8dp</dimen>
<dimen name="apptentive_progress_bar_segmented_min_height">12dp</dimen>
<dimen name="apptentive_progress_bar_segmented_item_horizontal_margin">4dp</dimen>

<!-- Message Center -->
<dimen name="apptentive_separator_height">1dp</dimen>
<dimen name="apptentive_message_composer_text_padding">10dp</dimen>
<dimen name="apptentive_message_appbar_action_button_padding">12dp</dimen>
Expand Down
Loading

0 comments on commit 0b19f2c

Please sign in to comment.