Skip to content
Projets

meetsl/SCardView-master

Voir sur GitHub

À propos

SCardView, un contrôle de type CardView dont la direction et la couleur de l’ombre sont configurables.

Développement web et applicatif

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

SCardView

Display :

Control the direction and color of shadow

image

Control the corner of shadow

image

How to use ?

Gradle Groovy DSL

implementation 'io.github.meetsl:SCardView:1.2'

Attribute

<attr name="cardLightDirection">
    <enum name="left" value="1" /> <!-- 设置光源位置为左侧,阴影在右侧 -->
    <enum name="right" value="2" /> <!-- 阴影在左侧-->
    <enum name="top" value="3" /> <!-- 阴影在下部-->
    <enum name="bottom" value="4" /> <!-- 阴影在上部 -->
    <enum name="LT" value="5" /> <!-- 阴影在右下角-->
    <enum name="RT" value="6" /> <!-- 阴影在左下角-->
    <enum name="LB" value="7" /> <!-- 阴影在右上角 -->
    <enum name="RB" value="8" /> <!-- 阴影在左上角 -->
    <enum name="none" value="9" /> <!-- 光源位置在正上方 -->
</attr>

<attr name="cardCornerVisibility">
     <enum name="noLeftCorner" value="1" />
     <enum name="noRightCorner" value="2" />
     <enum name="noTopCorner" value="3" />
     <enum name="noBottomCorner" value="4" />
     <enum name="noLT_RBCorner" value="5" />
     <enum name="noRT_LBCorner" value="6" />
     <enum name="none" value="7" />
</attr>

Update Log

V1.2

issue#11 Update the color of card's shadow dynamically

/**
     * Updates the shadow color of the CardView
     *
     * @param startColor The new startColor to set for the card shadow
     * @param endColor The new endColor to set for the card shadow
     */
    fun setCardShadowColor(@ColorInt startColor: Int, @ColorInt endColor: Int)

    /**
     * update the both of background color and shadow color of the card view
     */
    fun setColors(@ColorInt backgroundColor: Int, @ColorInt shadowStartColor: Int, @ColorInt shadowEndColor: Int)

issue#7 The attribute of 'layout_gravity = end|right' at the children of SCardView has no effect. This problem has been resolved.

Explorer des projets similaires

Chargement…