Skip to content

Instantly share code, notes, and snippets.

View abualgait's full-sized avatar
📖
keep learning

Muhammad Sayed abualgait

📖
keep learning
View GitHub Profile
@abualgait
abualgait / MainActivity.kt
Last active September 1, 2021 13:40
Password Length Strength (Custom View)
/**
* at your activity/fragment just add onTextChanged Listener and use the fun. setPassword
*/
edPassword.onTextChanged {
passwordStrenghtView.setPassword(it)
}
@abualgait
abualgait / PaymentChoiceViewHolder
Last active March 8, 2021 11:02
a recyclerview allows to select single item
class PaymentChoiceViewHolder(
val context: Context,
private val binding: ItemPaymentBinding,
val callback: (item: PaymentOption, view: View, position: Int) -> Unit
) : RecyclerViewHolder(binding.root) {
var selectedItem = -1
override fun onBindView(`object`: Any, position: Int) {
val data = `object` as PaymentOption
binding.item = data
@abualgait
abualgait / MaskedCardView.kt
Last active March 8, 2021 07:44
A Card view that clips the content of any shape
/*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software