Update: Move to androidx.material/appcompat

Auto Format of code
This commit is contained in:
LooKeR
2021-10-27 00:41:20 +05:30
parent 486d531158
commit 95183dde6b
50 changed files with 305 additions and 384 deletions

View File

@ -13,10 +13,10 @@ import android.util.Xml
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.content.ContextCompat
import coil.util.CoilUtils
import com.google.android.material.imageview.ShapeableImageView
import com.google.android.material.textview.MaterialTextView
import com.looker.droidify.utility.extension.android.Android
import org.xmlpull.v1.XmlPullParser
import kotlin.math.roundToInt
@ -88,7 +88,7 @@ fun Resources.sizeScaled(size: Int): Int {
return (size * displayMetrics.density).roundToInt()
}
fun TextView.setTextSizeScaled(size: Int) {
fun MaterialTextView.setTextSizeScaled(size: Int) {
val realSize = (size * resources.displayMetrics.scaledDensity).roundToInt()
setTextSize(TypedValue.COMPLEX_UNIT_PX, realSize.toFloat())
}