Add: Wire show/hide for updates button

This commit is contained in:
machiav3lli
2022-02-20 03:20:59 +01:00
parent e7295d90d6
commit 3a9b207073
3 changed files with 31 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import android.view.ViewGroup
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.Scaffold
import com.google.android.material.composethemeadapter.MdcTheme
import com.looker.droidify.R
import com.looker.droidify.content.Preferences
import com.looker.droidify.database.entity.Repository
import com.looker.droidify.databinding.FragmentInstalledXBinding
@ -79,5 +80,22 @@ class InstalledFragment : MainNavFragmentX() {
}
}
}
binding.buttonUpdated.setOnClickListener {
binding.secondaryComposeRecycler.visibility =
when (binding.secondaryComposeRecycler.visibility) {
View.VISIBLE -> {
binding.buttonUpdated.setCompoundDrawablesRelativeWithIntrinsicBounds(
0, 0, R.drawable.ic_arrow_down, 0
)
View.GONE
}
else -> {
binding.buttonUpdated.setCompoundDrawablesRelativeWithIntrinsicBounds(
0, 0, R.drawable.ic_arrow_up, 0
)
View.VISIBLE
}
}
}
}
}