Skip to content

Commit

Permalink
release v3.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristiyan Petrov committed Sep 4, 2023
1 parent fcab37e commit 5ae3eab
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 95 deletions.
6 changes: 3 additions & 3 deletions app-extensions/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/Bandyer/Android-App-Extensions
branch = master
commit = b6238dd406f6cf604b097eca5567dc2a47f7f5e1
commit = 98c38ff7b1f11404523ac9691ce08181482b034b
method = merge
cmdver = 0.4.3
parent = 6072ddb8c8069df22a3440aa611b5920f62c3492
cmdver = 0.4.5
parent = 75b3b872bf2d3facf702b786c6c53c0b5e1d2436
1 change: 0 additions & 1 deletion app-extensions/app-design/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
plugins {
id "com.android.library"
id "kotlin-android"
id "kotlin-android-extensions"
}

android {
Expand Down
2 changes: 1 addition & 1 deletion app-extensions/app-utilities/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
plugins {
id "com.android.library"
id "kotlin-android"
id "kotlin-android-extensions"
id "kotlin-kapt"
alias(sampleAppCatalog.plugins.kotlinxSerialization)
}
Expand Down Expand Up @@ -67,6 +66,7 @@ dependencies {
/*** UI ***/
api sampleAppCatalog.androidxRecyclerview
api sampleAppCatalog.fastadapter
api "com.mikepenz:fastadapter-extensions-binding:${sampleAppCatalog.versions.fastadapterVersion.get()}"
api (sampleAppCatalog.materialExpansionPanel) {
exclude module: 'constraintlayout'
}
Expand Down
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "kotlin-android-extensions"
id "com.github.triplet.play"
id "com.google.firebase.appdistribution"
id "ru.cian.huawei-publish"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ private void addObservers() {

// set an observer for the call to show ongoing call label
CallModule callModule = BandyerSDK.getInstance().getCallModule();
if (callModule == null) return;
callModule.addCallObserver(this, callObserver);
callModule.addCallUIObserver(this, callObserver);
if (callModule.isInCall()) showOngoingCallLabel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.content.ContextCompat
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener
import com.bandyer.demo_android_sdk.R
import com.bandyer.demo_android_sdk.databinding.ActivityCollapsingToolbarBinding
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.appbar.AppBarLayout.OnOffsetChangedListener
import com.google.android.material.appbar.AppBarLayout.ScrollingViewBehavior
import com.kaleyra.app_utilities.MultiDexApplication
import com.kaleyra.app_utilities.activities.BaseActivity
import com.kaleyra.app_utilities.storage.ConfigurationPrefsManager
import com.kaleyra.app_utilities.utils.DPadNavigationHelper
import kotlinx.android.synthetic.main.activity_collapsing_toolbar.*
import kotlin.math.abs

abstract class CollapsingToolbarActivity : BaseActivity(), OnRefreshListener {
Expand All @@ -53,6 +53,8 @@ abstract class CollapsingToolbarActivity : BaseActivity(), OnRefreshListener {

protected val restApi by lazy { MultiDexApplication.restApi }

private lateinit var binding: ActivityCollapsingToolbarBinding

private val version: String by lazy {
val pInfo = packageManager.getPackageInfo(packageName, 0)
pInfo.versionName
Expand All @@ -75,14 +77,16 @@ abstract class CollapsingToolbarActivity : BaseActivity(), OnRefreshListener {
val layoutParams = CoordinatorLayout.LayoutParams(CoordinatorLayout.LayoutParams.MATCH_PARENT, CoordinatorLayout.LayoutParams.MATCH_PARENT)
layoutParams.behavior = ScrollingViewBehavior(this, null)
findViewById<View>(R.id.content).layoutParams = layoutParams
binding = ActivityCollapsingToolbarBinding.bind(container)
customizeSwipeRefreshLayout()
customizeAppBarLayout()
refreshUsersView.setOnRefreshListener(this)
appbar_toolbar?.setExpanded(isPortrait())

binding.refreshUsersView.setOnRefreshListener(this)
binding.appbarToolbar.setExpanded(isPortrait())
}

protected fun setRefreshing(refresh: Boolean) {
refreshUsersView.isRefreshing = refresh
binding.refreshUsersView.isRefreshing = refresh
}

override fun onResume() {
Expand All @@ -99,48 +103,48 @@ abstract class CollapsingToolbarActivity : BaseActivity(), OnRefreshListener {
val infoSpan = SpannableString("\n$portraitTitle")
infoSpan.setSpan(AbsoluteSizeSpan(textSizeH3), 0, infoSpan.length, Spanned.SPAN_INCLUSIVE_INCLUSIVE)
val collapsingToolbarTitle = TextUtils.concat(titleSpan, envTextView, infoSpan)
info.text = collapsingToolbarTitle
binding.info.text = collapsingToolbarTitle
this@CollapsingToolbarActivity.collapsedTitle = "$appTitle @$environment | $landscapeTitle"
collapsing_toolbar.title = if (isPortrait()) appTitle else collapsedTitle
binding.collapsingToolbar.title = if (isPortrait()) appTitle else collapsedTitle
}

private fun customizeSwipeRefreshLayout() {
refreshUsersView.setColorSchemeColors(
binding.refreshUsersView.setColorSchemeColors(
ContextCompat.getColor(this, R.color.colorPrimaryDark),
ContextCompat.getColor(this, R.color.colorPrimary),
ContextCompat.getColor(this, R.color.colorPrimaryLight)
)
}

private fun customizeAppBarLayout() {
setSupportActionBar(toolbar)
setSupportActionBar(binding.toolbar)
supportActionBar!!.setHomeButtonEnabled(false)
supportActionBar!!.setDisplayHomeAsUpEnabled(false)
supportActionBar!!.setDisplayShowHomeEnabled(false)
appbar_toolbar.addOnOffsetChangedListener(OnOffsetChangedListener { appBarLayout: AppBarLayout, verticalOffset: Int ->
if (refreshUsersView.isRefreshing && verticalOffset == 0) refreshUsersView.isRefreshing = false
refreshUsersView.isEnabled = verticalOffset == 0
binding.appbarToolbar.addOnOffsetChangedListener(OnOffsetChangedListener { appBarLayout: AppBarLayout, verticalOffset: Int ->
if (binding.refreshUsersView.isRefreshing && verticalOffset == 0) binding.refreshUsersView.isRefreshing = false
binding.refreshUsersView.isEnabled = verticalOffset == 0
if (abs(verticalOffset) - appBarLayout.totalScrollRange == 0) {
collapsing_toolbar.title = if (isPortrait()) appTitle else collapsedTitle
toolbar.background = ColorDrawable(ContextCompat.getColor(this, R.color.colorPrimary))
binding.collapsingToolbar.title = if (isPortrait()) appTitle else collapsedTitle
binding.toolbar.background = ColorDrawable(ContextCompat.getColor(this, R.color.colorPrimary))
} else {
collapsing_toolbar.title = ""
toolbar.background = ColorDrawable(Color.TRANSPARENT)
binding.collapsingToolbar.title = ""
binding.toolbar.background = ColorDrawable(Color.TRANSPARENT)
}
val offsetAlpha = 1 - appBarLayout.y / appBarLayout.totalScrollRange * -1
fader.alpha = 1 - offsetAlpha
toolbar.background.alpha = (255 * offsetAlpha).toInt()
binding.fader.alpha = 1 - offsetAlpha
binding.toolbar.background.alpha = (255 * offsetAlpha).toInt()
})
}

override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (DPadNavigationHelper.isDpad(keyCode)) appbar_toolbar.setExpanded(false)
if (DPadNavigationHelper.isDpad(keyCode)) binding.appbarToolbar.setExpanded(false)
return super.onKeyDown(keyCode, event)
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
appbar_toolbar?.setExpanded(isPortrait())
binding.appbarToolbar.setExpanded(isPortrait())
}

private fun isPortrait() = resources.configuration.orientation != Configuration.ORIENTATION_LANDSCAPE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,27 @@

package com.bandyer.demo_android_sdk.ui.adapter_items

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import com.bandyer.demo_android_sdk.R
import com.mikepenz.fastadapter.items.AbstractItem
import kotlinx.android.synthetic.main.no_users_selected_item_layout.view.*
import com.bandyer.demo_android_sdk.databinding.NoUsersSelectedItemLayoutBinding
import com.mikepenz.fastadapter.binding.AbstractBindingItem

/**
* A simple RecyclerView item used to display no selections on users' list.
*/
class NoUserSelectedItem : AbstractItem<NoUserSelectedItem.ViewHolder>() {
class NoUserSelectedItem : AbstractBindingItem<NoUsersSelectedItemLayoutBinding>() {

override var identifier: Long = NO_USER_SELECTED_ITEM_IDENTIFIER
override var identifier: Long = NO_USER_SELECTED_ITEM_IDENTIFIER
override val type: Int = R.id.no_user_selecte_item
override val layoutRes: Int = R.layout.no_users_selected_item_layout
override fun getViewHolder(v: View): ViewHolder = ViewHolder(v)

override fun bindView(holder: ViewHolder, payloads: List<Any>) {
super.bindView(holder, payloads)
holder.containerView.no_user_selecte_itemView.text = holder.containerView.context.getString(R.string.no_users_selected)
override fun bindView(binding: NoUsersSelectedItemLayoutBinding, payloads: List<Any>) {
super.bindView(binding, payloads)
binding.noUserSelecteItemView.text = binding.noUserSelecteItemView.context.getString(R.string.no_users_selected)
}

class ViewHolder(val containerView: View) : RecyclerView.ViewHolder(containerView) {

init {
containerView.isFocusable = false
containerView.isFocusableInTouchMode = false
containerView.isClickable = false
}
override fun createBinding(inflater: LayoutInflater, parent: ViewGroup?): NoUsersSelectedItemLayoutBinding {
return NoUsersSelectedItemLayoutBinding.inflate(inflater, parent, false)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,35 @@

package com.bandyer.demo_android_sdk.ui.adapter_items

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.bandyer.demo_android_sdk.R
import com.mikepenz.fastadapter.items.AbstractItem
import kotlinx.android.synthetic.main.selected_user_item_layout.view.*
import com.bandyer.demo_android_sdk.databinding.SelectedUserItemLayoutBinding
import com.mikepenz.fastadapter.binding.AbstractBindingItem

/**
* A simple RecyclerView item used to display the user userAlias as a Chip in the list.
*/
class SelectedUserItem(@JvmField val userAlias: String,@JvmField val position: Int) : AbstractItem<SelectedUserItem.ViewHolder>() {
class SelectedUserItem(@JvmField val userAlias: String,@JvmField val position: Int) : AbstractBindingItem<SelectedUserItemLayoutBinding>() {

override var identifier: Long = userAlias.hashCode().toLong()
override val type: Int = R.id.user_selected_item
override val layoutRes: Int = R.layout.selected_user_item_layout
override fun getViewHolder(v: View): ViewHolder = ViewHolder(v)

override fun bindView(holder: ViewHolder, payloads: List<Any>) {
super.bindView(holder, payloads)
holder.containerView.userAlias!!.text = userAlias
holder.containerView.userAlias!!.setOnCloseIconClickListener { v: View? -> v!!.performClick() }
override fun createBinding(inflater: LayoutInflater, parent: ViewGroup?): SelectedUserItemLayoutBinding {
return SelectedUserItemLayoutBinding.inflate(inflater, parent, false)
}

override fun unbindView(holder: ViewHolder) {
super.unbindView(holder)
holder.containerView.userAlias.text = null
override fun bindView(binding: SelectedUserItemLayoutBinding, payloads: List<Any>) {
super.bindView(binding, payloads)
binding.userAlias.text = userAlias
binding.userAlias.setOnCloseIconClickListener { v: View? -> v!!.performClick() }
}

class ViewHolder(val containerView: View) : RecyclerView.ViewHolder(containerView) {
init {
containerView.isFocusable = false
containerView.isFocusableInTouchMode = false
}
override fun unbindView(binding: SelectedUserItemLayoutBinding) {
super.unbindView(binding)
binding.userAlias.text = null
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
*/
package com.bandyer.demo_android_sdk.ui.adapter_items

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import com.bandyer.demo_android_sdk.R
import com.mikepenz.fastadapter.items.AbstractItem
import kotlinx.android.synthetic.main.item_user_layout.view.*
import com.bandyer.demo_android_sdk.databinding.ItemUserLayoutBinding
import com.mikepenz.fastadapter.binding.AbstractBindingItem

/**
* A simple RecyclerView item used to display the user userAlias as a cell in the list.
*/
class UserItem(@JvmField val userAlias: String) : AbstractItem<UserItem.ViewHolder>() {
class UserItem(@JvmField val userAlias: String) : AbstractBindingItem<ItemUserLayoutBinding>() {

override var identifier: Long = userAlias.hashCode().toLong()
override val type: Int = R.id.user_item_id
override val layoutRes: Int = R.layout.item_user_layout
override fun getViewHolder(v: View): ViewHolder = ViewHolder(v)

override fun bindView(holder: ViewHolder, payloads: List<Any>) {
super.bindView(holder, payloads)
holder.containerView.userAlias!!.text = userAlias
override fun createBinding(inflater: LayoutInflater, parent: ViewGroup?): ItemUserLayoutBinding {
return ItemUserLayoutBinding.inflate(inflater, parent, false)
}

override fun unbindView(holder: ViewHolder) {
super.unbindView(holder)
holder.containerView.userAlias!!.text = null
override fun bindView(binding: ItemUserLayoutBinding, payloads: List<Any>) {
super.bindView(binding, payloads)
binding.userAlias.text = userAlias
}

class ViewHolder(val containerView: View) : RecyclerView.ViewHolder(containerView)
override fun unbindView(binding: ItemUserLayoutBinding) {
super.unbindView(binding)
binding.userAlias.text = null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,33 @@
*/
package com.bandyer.demo_android_sdk.ui.adapter_items

import android.view.View
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import com.bandyer.demo_android_sdk.R
import com.mikepenz.fastadapter.items.AbstractItem
import kotlinx.android.synthetic.main.user_selection_item_layout.view.*
import com.bandyer.demo_android_sdk.databinding.UserSelectionItemLayoutBinding
import com.mikepenz.fastadapter.binding.AbstractBindingItem

/**
* A simple RecyclerView item used to display the user name with a checkbox as a cell in the list.
*/
class UserSelectionItem(@JvmField val name: String) : AbstractItem<UserSelectionItem.ViewHolder>() {
class UserSelectionItem(@JvmField val name: String) : AbstractBindingItem<UserSelectionItemLayoutBinding>() {

override var identifier: Long = name.hashCode().toLong()
override val type: Int = R.id.user_selection_item_id
override val layoutRes: Int= R.layout.user_selection_item_layout
override fun getViewHolder(v: View): ViewHolder = ViewHolder(v)

override fun bindView(holder: ViewHolder, payloads: List<Any>) {
super.bindView(holder, payloads)
holder.containerView.checkbox!!.isChecked = isSelected
holder.containerView.checkbox!!.text = name
override fun createBinding(inflater: LayoutInflater, parent: ViewGroup?): UserSelectionItemLayoutBinding {
return UserSelectionItemLayoutBinding.inflate(inflater, parent, false)
}

override fun unbindView(holder: ViewHolder) {
super.unbindView(holder)
holder.containerView.checkbox!!.isChecked = false
holder.containerView.checkbox.text = null
override fun bindView(binding: UserSelectionItemLayoutBinding, payloads: List<Any>) {
super.bindView(binding, payloads)
binding.checkbox.isChecked = isSelected
binding.checkbox.text = name
}

class ViewHolder(val containerView: View) : RecyclerView.ViewHolder(containerView)

override fun unbindView(binding: UserSelectionItemLayoutBinding) {
super.unbindView(binding)
binding.checkbox.isChecked = false
binding.checkbox.text = null
}
}
1 change: 1 addition & 0 deletions app/src/main/res/layout/no_users_selected_item_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
android:gravity="center_vertical"
android:textStyle="italic" />
3 changes: 1 addition & 2 deletions app/src/main/res/layout/selected_user_item_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/space4"
android:layout_marginRight="@dimen/space4"
android:clickable="true"
android:focusable="false"
android:clickable="true"
android:focusableInTouchMode="false"
app:closeIconEnabled="true"
app:closeIconTint="?attr/colorSecondary" />
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#Mon, 04 Sep 2023 10:40:16 +0000
#Mon, 04 Sep 2023 16:13:29 +0000
#
# Copyright (C) 2020 Bandyer S.r.l. All Rights Reserved.
# See LICENSE.txt for licensing information
#

#Thu, 08 Oct 2020 18:57:34 +0200
VERSION_CODE=165
VERSION_CODE=166

0 comments on commit 5ae3eab

Please sign in to comment.