Skip to content

Commit

Permalink
Updated PR based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Dec 2, 2023
1 parent c2376ec commit a4ede2f
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 178 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ dependencies {

// AndroidX
implementation libs.androidx.appcompat
//implementation libs.androidx.core
implementation libs.androidx.constraintlayout
implementation libs.androidx.lifecycle.process
implementation libs.androidx.preference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
return false;
}
});
// TODO(aanorbel): Fix change in state(theme change from notification) changing the selected item.
/* TODO(aanorbel): Fix change in state(theme change from notification) changes the selected item.
The proper fix would be to track the selected item as well as other properties in a `ViewModel`. */
binding.bottomNavigation.setSelectedItemId(getIntent().getIntExtra(RES_ITEM, R.id.dashboard));
/* Check if we are restoring the activity from a saved state first.
* If we have a message to show, show it as a snackbar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class DashboardAdapter(
val item = items[position]
when (holder.itemViewType) {
VIEW_TYPE_TITLE -> {
val separator = holder as CardGroupTitleViewHolder
separator.binding.root.text = item as String
}
val separator = holder as CardGroupTitleViewHolder
separator.binding.root.text = item as String
}

VIEW_TYPE_CARD -> {
val cardHolder = holder as CardViewHolder
Expand All @@ -72,7 +72,10 @@ class DashboardAdapter(
holder.binding.apply {
title.setTextColor(resources.getColor(R.color.disabled_test_text))
desc.setTextColor(resources.getColor(R.color.disabled_test_text))
icon.setColorFilter(resources.getColor(R.color.disabled_test_text), PorterDuff.Mode.SRC_IN)
icon.setColorFilter(
resources.getColor(R.color.disabled_test_text),
PorterDuff.Mode.SRC_IN
)
}
} else {
holder.itemView.setOnClickListener(onClickListener)
Expand All @@ -94,13 +97,14 @@ class DashboardAdapter(
}

/**
* ViewHolder for dashboard item group
* ViewHolder for a dashboard item group.
* @param binding
*/
class CardGroupTitleViewHolder(var binding: ItemSeperatorBinding) : RecyclerView.ViewHolder(binding.root)
class CardGroupTitleViewHolder(var binding: ItemSeperatorBinding) :
RecyclerView.ViewHolder(binding.root)

/**
* ViewHolder for dashboard item
* ViewHolder for dashboard item.
* @param binding
*/
class CardViewHolder(var binding: ItemTestsuiteBinding) : RecyclerView.ViewHolder(binding.root)
Expand Down
Loading

0 comments on commit a4ede2f

Please sign in to comment.