| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
compile 'com.dingmouren.paletteimageview:paletteimageview:1.0.4'
| 圆角半径 | 阴影半径 | 阴影偏移量 |
|---|---|---|
![]() |
![]() |
![]() |
<com.dingmouren.paletteimageview.PaletteImageView
android:id="@+id/palette"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:palettePadding="20dp"
app:paletteOffsetX="15dp"
app:paletteOffsetY="15dp"
/>
mPaletteImageView.setOnParseColorListener(new PaletteImageView.OnParseColorListener() {
@Override//解析图片的颜色完毕
public void onComplete(PaletteImageView paletteImageView) {
int[] vibrant = paletteImageView.getVibrantColor();
int[] vibrantDark = paletteImageView.getDarkVibrantColor();
int[] vibrantLight = paletteImageView.getLightVibrantColor();
int[] muted = paletteImageView.getMutedColor();
int[] mutedDark = paletteImageView.getDarkMutedColor();
int[] mutedLight = paletteImageView.getLightMutedColor();
}
@Override//解析图片的颜色失败
public void onFail() {
}
});
| xml属性 | 描述 |
|---|---|
| app:palettePadding | 表示阴影显示最大空间距离。值为0,没有阴影,大于0,才有阴影。 |
| app:paletteOffsetX | 表示阴影在x方向上的偏移量 |
| app:paletteOffsetY | 表示阴影在y方向上的偏移量 |
| app:paletteSrc | 表示图片资源 |
| app:paletteRadius | 表示圆角半径 |
| app:paletteShadowRadius | 表示阴影半径 |
| 方法 | 描述 |
|---|---|
| public void setShadowColor(int color) | 表示自定义设置控件阴影的颜色 |
| public void setBitmap(Bitmap bitmap) | 表示设置控件位图 |
| public void setPaletteRadius(int raius) | 表示设置控件圆角半径 |
| public void setPaletteShadowOffset(int offsetX, int offsetY) | 表示设置阴影在控件阴影在x方向 或 y方向上的偏移量 |
| public void setPaletteShadowRadius(int radius) | 表示设置控件阴影半径 |
| public void setOnParseColorListener(OnParseColorListener listener) | 设置控件解析图片颜色的监听器 |
| public int[] getVibrantColor() | 表示获取Vibrant主题的颜色数组;假设颜色数组为arry,arry[0]是推荐标题使用的颜色,arry[1]是推荐正文使用的颜色,arry[2]是推荐背景使用的颜色。颜色只是用于推荐,可以自行选择 |
| public int[] getDarkVibrantColor() | 表示获取DarkVibrant主题的颜色数组,数组元素含义同上 |
| public int[] getLightVibrantColor() | 表示获取LightVibrant主题的颜色数组,数组元素含义同上 |
| public int[] getMutedColor() | 表示获取Muted主题的颜色数组,数组元素含义同上 |
| public int[] getDarkMutedColor() | 表示获取DarkMuted主题的颜色数组,数组元素含义同上 |
| public int[] getLightMutedColor() | 表示获取LightMuted主题的颜色数组,数组元素含义同上 |
Copyright (C) 2017 WeyYe 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 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
| Back | FazBrowse Home | New Git URL |