日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

android新拟态实现方法,Android 新拟态UI (Neumorphism)

發(fā)布時(shí)間:2023/12/10 52 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android新拟态实现方法,Android 新拟态UI (Neumorphism) 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

前言

本文轉(zhuǎn)自github,只是進(jìn)行了圖片的處理和部分翻譯,已獲作者授權(quán)

截至首次發(fā)文前找到的原作者的文章地址-May,17,2020若找到本文章更新的時(shí)間節(jié)點(diǎn),請(qǐng)私信我更新。

原作者github地址

文末附源碼下載地址,免費(fèi)。

Android上的擬態(tài)化UI

This is the experimental codes to build Neumorphism designs in Android.

Not a library. Just sample project now(目前只是示例項(xiàng)目).

Preview

Light | Dark

添加依賴

在項(xiàng)目級(jí) build.gradle 添加以下依賴:

allprojects {

repositories {

maven { url "https://jitpack.io" }

}

}

然后, 在 build.gradle中添加以下依賴

dependencies {

//截至首次發(fā)文前l(fā)atest_version為0.3.0

implementation 'com.github.fornewid:neumorphism:{latest_version}'

}

Features

為組件繪制陰影實(shí)現(xiàn)新擬態(tài)化效果。

支持以下組件:

ViewGroup: CardView

View: Button, FloatingActionButton, ImageView

在Text上繪制陰影來(lái)實(shí)現(xiàn)TextView的新擬態(tài)化。

如果您需要更多功能或要修復(fù)錯(cuò)誤,請(qǐng)單擊 new issue并報(bào)告給我!

// 預(yù)定義樣式

style="@style/Widget.Neumorph.CardView"

// 設(shè)置elevation和color

app:neumorph_shadowElevation="6dp"

app:neumorph_shadowColorLight="@color/solid_light_color"

app:neumorph_shadowColorDark="@color/solid_dark_color"

// 設(shè)置光源 lightSource

app:neumorph_lightSource="leftTop|leftBottom|rightTop|rightBottom"

// 設(shè)置Shape類型和corner size

app:neumorph_shapeType="{flat|pressed|basin}"

app:neumorph_shapeAppearance="@style/CustomShapeAppearance"

// 設(shè)置 background 或 stroke

app:neumorph_backgroundColor="@color/background_color"

app:neumorph_strokeColor="@color/stroke_color"

app:neumorph_strokeWidth="@dimen/stroke_width"

使用插圖以避免修剪陰影

// 使用 inset 以避免陰影被裁剪. (default=12dp)

app:neumorph_inset="12dp"

app:neumorph_insetStart="12dp"

app:neumorph_insetEnd="12dp"

app:neumorph_insetTop="12dp"

app:neumorph_insetBottom="12dp"

// Use a padding. (default=12dp)

android:padding="12dp">

{rounded|oval}

32dp

16dp

16dp

16dp

16dp

光源(LightSource)

LEFT_TOPLEFT_BOTTOMRIGHT_TOPRIGHT_BOTTOM

陰影類型(ShapeType)

FLATPRESSEDBASIN

License

Copyright 2020 SOUP

Licensed to the Apache Software Foundation (ASF) under one or more contributor

license agreements. See the NOTICE file distributed with this work for

additional information regarding copyright ownership. The ASF licenses this

file to you 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

distributed under the License is distributed on an "AS IS" BASIS, WITHOUT

WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the

License for the specific language governing permissions and limitations under

the License.

標(biāo)簽:License,distributed,UI,16dp,under,Neumorphism,Android,擬態(tài)

來(lái)源: https://blog.csdn.net/qq_17282141/article/details/113945103

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)

總結(jié)

以上是生活随笔為你收集整理的android新拟态实现方法,Android 新拟态UI (Neumorphism)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。