This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ColorConverter { | |
// Hex to RGB | |
static hexToRgb(hex) { | |
let cleanHex = hex.replace('#', ''); | |
if (cleanHex.length === 3) { | |
cleanHex = cleanHex.split('').map(char => char + char).join(''); | |
} | |
const bigint = parseInt(cleanHex, 16); | |
const r = (bigint >> 16) & 255; | |
const g = (bigint >> 8) & 255; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TextFlowLayout @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null, | |
defStyleAttr: Int = 0 | |
) : ViewGroup(context, attrs, defStyleAttr) { | |
private lateinit var baseTextView: TextView | |
fun attachTextView(tv: TextView) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Canvas | |
import android.util.Log | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.FrameLayout | |
import androidx.recyclerview.widget.GridLayoutManager | |
import androidx.recyclerview.widget.LinearLayoutManager | |
import androidx.recyclerview.widget.RecyclerView | |
import androidx.recyclerview.widget.RecyclerView.OnScrollListener | |
import androidx.recyclerview.widget.StaggeredGridLayoutManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2014 Square, Inc. | |
* | |
* 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 | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |