【前言】

因为要加强 Android 投影仪的 luncher 倒影国际化的功能,所以开始的时候在BroderView的基础改了些东西.

后来又一些BUG,修复了,感觉毕竟是用的别人的开源代码,如果不开源又不好意思,再说了,这个代码也不属于

在职期间开发,是业余时间编写,所以没有什么问题.欢迎大家多多指教.

【Android-tv-widget】

Android 组件,主要用于 投影仪,TV电视,手机等等Android设备.

需要定制luncher桌面的请不要联系我.

移动边框,焦点控件动画.

高斯模糊(毛玻璃效果)

图片主色

目录结构:

--com/androidtv/activity

----activity.java : 测试demo

--com/androidtv/color (获取图片颜色主色和其它颜色)

----ColorArt.java :

----HashBag.java

--com/androidtv/utils (一些常用函数)

----AnimUtils.java

----DensityUtil.java

----FastBlur.java :高斯模糊

----ImageUtils.java

--com/androidtv/view

----BorderView.java :移动边框

----CopyOfCopyOfFocusBorderView.java

----FocusBorderView.java

----FocusRelativeLayout.java

----ReflectionRelativeLayout.java

----VerticalSmoothGridView.java

--net.qiujuer.imageblurring.jni (高斯模糊JNI)

例子图片查看

注意

如果想在GridView上加上BorderView,只需要调用 runTranslateAnimation

最近找了一种新的方法,可以在最上面放大... ....布局只需要将需要放大的房在最上层

package com.xgimi.doubanfm.utils;

import com.xgimi.doubanfm.widgets.ZoomFrameWidget;

import android.animation.Animator;

import android.animation.AnimatorListenerAdapter;

import android.animation.AnimatorSet;

import android.animation.ObjectAnimator;

import android.graphics.Bitmap;

import android.graphics.Point;

import android.graphics.Rect;

import android.view.View;

import android.view.animation.DecelerateInterpolator;

import android.widget.ImageView;

public class ZoomHelper {

private static final float DEFULAT_SCALE_VALUE = 1.2f;

private static final float DEFULAT_SCALE_VALUE2 = 1.4f;

public void zoomImageFromThumb(final View container, final View thumbView,

final ZoomFrameWidget zoomView) {

final Rect startBounds = new Rect();

final Rect finalBounds = new Rect();

final Point globalOffset = new Point();

thumbView.getGlobalVisibleRect(startBounds);

container.getGlobalVisibleRect(finalBounds, globalOffset);

startBounds.offset(-globalOffset.x, -globalOffset.y);

zoomView.setVisibility(View.VISIBLE);

thumbView.setDrawingCacheEnabled(true);

Bitmap b = thumbView.getDrawingCache();

zoomView.setImageBitmap(b);

zoomView.setPivotX(0f);

zoomView.setPivotY(0f);

AnimatorSet set = new AnimatorSet();

float deltaWidth = (startBounds.width() * DEFULAT_SCALE_VALUE - startBounds

.width()) / 2;

float deltaHeight = (startBounds.height() * DEFULAT_SCALE_VALUE - startBounds

.height()) / 2;

set.play(

ObjectAnimator.ofFloat(zoomView, View.X, startBounds.left,

startBounds.left - deltaWidth))

.with(ObjectAnimator.ofFloat(zoomView, View.Y, startBounds.top,

startBounds.top - deltaWidth))

.with(ObjectAnimator.ofFloat(zoomView, View.SCALE_X, 1.0f,

DEFULAT_SCALE_VALUE))

.with(ObjectAnimator.ofFloat(zoomView, View.SCALE_Y, 1.0f,

DEFULAT_SCALE_VALUE));

set.setDuration(200);

set.setInterpolator(new DecelerateInterpolator());

set.addListener(new AnimatorListenerAdapter() {

@Override

public void onAnimationEnd(Animator animation) {

}

@Override

public void onAnimationCancel(Animator animation) {

}

});

set.start();

}

/**

* 设置移动边框.

*/

public void zoomImageFromThumb(final View container, final View thumbView,

final ImageView zoomView) {

final Rect startBounds = new Rect();

final Rect finalBounds = new Rect();

final Point globalOffset = new Point();

thumbView.getGlobalVisibleRect(startBounds);

container.getGlobalVisibleRect(finalBounds, globalOffset);

startBounds.offset(-globalOffset.x, -globalOffset.y);

zoomView.setVisibility(View.VISIBLE);

thumbView.setDrawingCacheEnabled(true);

Bitmap thumbViewBitmap = thumbView.getDrawingCache();

zoomView.setDrawingCacheEnabled(true);

Bitmap b = zoomView.getDrawingCache();

Bitmap mBitmap = Bitmap.createScaledBitmap(b,

thumbViewBitmap.getWidth(), thumbViewBitmap.getHeight(), true);

zoomView.setImageBitmap(mBitmap);

zoomView.setPivotX(0f);

zoomView.setPivotY(0f);

AnimatorSet set = new AnimatorSet();

float deltaWidth = (startBounds.width() * DEFULAT_SCALE_VALUE2 - startBounds

.width()) / 2;

float deltaHeight = (startBounds.height() * DEFULAT_SCALE_VALUE2 - startBounds

.height()) / 2;

set.play(

ObjectAnimator.ofFloat(zoomView, View.X, startBounds.left,

startBounds.left - deltaWidth))

.with(ObjectAnimator.ofFloat(zoomView, View.Y, startBounds.top,

startBounds.top - deltaWidth))

.with(ObjectAnimator.ofFloat(zoomView, View.SCALE_X, 1.0f,

DEFULAT_SCALE_VALUE2))

.with(ObjectAnimator.ofFloat(zoomView, View.SCALE_Y, 1.0f,

DEFULAT_SCALE_VALUE2));

set.setDuration(200);

set.setInterpolator(new DecelerateInterpolator());

set.start();

}

}

android tv github,GitHub - dongbingliu/Android-tv-widget: Android tv,盒子,投影仪 控件相关推荐

  1. Android仿抖音加载框之两颗小球转动控件

    Android仿抖音加载框之两颗小球转动控件 本篇文章已授权微信公众号 hongyangAndroid(鸿洋)独家发布. 效果图 安卓版抖音v2.5加载框: 本控件效果图: 使用方法 源码地址:And ...

  2. android tv nugat,GitHub - GongXunYoung/Android-tv-widget: Android tv,盒子,投影仪 控件

    Android TV 开发框架 QQ群:522186932 Leanback 框架(类似谷歌的Leanback,更简直,更方便): 键盘框架: 菜单框架: 整体目录结构 *AndroidTvWidet ...

  3. Android 怎么实现支持所有View的通用的下拉刷新控件

    转载请标明出处: http://blog.csdn.net/u010386612/article/details/51372696 本文出自:[AItsuki的博客] 下拉刷新对于一个app来说是必不 ...

  4. 播放视频android学习笔记---44_在线视频播放器,网络视频解析器,SurfaceView 控件使用方法...

    最近用使开辟的过程中涌现了一个小题问,顺便录记一下因原和法方--播放视频 44_在线视频播放器 ------------------------- 1.注意这里,在模拟器中,android2.2和an ...

  5. android button 属性,两行显示数字,前面各有图像,Android_2_常用控件及常用属性

    安卓常用控件及其常用属性 TextView android:id 这是唯一地标识控件的ID. android:capitalize 如果设置,指定该TextView中有一个文本输入法 会自动利用什么类 ...

  6. Android实战简易教程-第五十一枪(ListView实现子控件的动态显示和隐藏、checkbox全选和反选)

    前段时间写过一篇文章:Android实战简易教程-第四十七枪(ListView多选-实现点餐系统)有的同学留言建议,可不可以动态控制checkbox的显示和全选反选功能,我研究了一下,发现实现也比较容 ...

  7. android 光晕动画,Android去掉SrollView、GrdiView、RecycleView、ViewPager等可滑动控件滑动到边缘的光晕效果...

    下面以RecycleView为例,其他可滑动控件也是一样的 在XML中设置: android:id="@+id/rv_recycle_view" android:layout_wi ...

  8. android比较常用的布局,Android_九宫图比较常用的多控件布局(GridView)使用介绍,GridView跟ListView都是比较常用的 - phpStudy...

    九宫图比较常用的多控件布局(GridView)使用介绍 GridView跟ListView都是比较常用的多控件布局,而GridView更是实现九宫图的首选!本文就是介绍如何使用GridView实现九宫 ...

  9. android自定义控件(6)-详解在onMeasure()方法中如何测量一个控件尺寸

    今天的任务就是详细研究一下protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)方法.如果只是说要重写什么方法有什么 ...

最新文章

  1. 中国电子学会图形化四级编程题:成语接龙
  2. matlab实现瑞利信道需要的步骤,基于Matlab的瑞利信道仿真.docx
  3. AA065VD数据线连接错位的现象及分析总结
  4. 服务器可以装2个系统吗,云服务器可以装多个系统吗
  5. PHP中stripslashes()函数的解释
  6. redis怎么连接mysql数据库_Golang连接Redis数据库的方法
  7. php封装一个异常类,php封装一个异常的处理类
  8. 我去,还在这样读写 excel 这也太低效了吧!
  9. java常用算法手册 赵志云_Java常用算法手册
  10. 电路串联和并联图解_电路的串联和并联有什么区别
  11. 台式计算机配置单,最新台式电脑组装配置推荐
  12. hdu5963 朋友
  13. 谷歌浏览器崩溃之后卸载无法重装的解决方法
  14. flutter图标按钮_flutter 按钮封装 带图片的按钮,带边框的按钮,纯文字的按钮
  15. 快速上手UER-py
  16. 超千万人同时在线,抖音快手,是怎么抗住高并发?
  17. 计算机学生会大型户外活动,学生会户外活动策划
  18. 从B 树、B+ 树、B* 树
  19. 企业集群平台架构设计与实现--LVS篇(二)
  20. 舒舍分析现在的北京租房市场

热门文章

  1. QT 简单五子棋实现
  2. Light OJ 1197
  3. PHP全栈学习笔记7
  4. RSF-Center,集群模式下-协调数据结构
  5. are exo exo是什么歌 we_We Are One EXO!
  6. ps2021中文版完美逆袭
  7. android手机拍摄视频格式,怎么用手机给自己拍摄的视频加上字幕?安卓手机视频编辑器给视频加字幕的方法...
  8. 线性代数行列式计算方法之三角法
  9. 2022年最值得去的100家互联网大厂排名出来了
  10. 关于使用vue-quill-editor出现p标签的解决方案