All Projects → zhousuqiang → Tvfocusborder

zhousuqiang / Tvfocusborder

Android Tv 焦点框框架; 支持设置颜色或图片作为焦点框; 支持圆角变化

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Tvfocusborder

Oddworks
[MIRROR]
Stars: ✭ 282 (+80.77%)
Mutual labels:  android-tv
Youtubetv
📺 YouTube embedded player library for Android TV
Stars: ✭ 44 (-71.79%)
Mutual labels:  android-tv
Tvlauncher
A TV Launcher UI use ViewPager+CustomView as Main Frame, like win8 style, including several specially good effect CustomWidget, such as FlyBorderView, PosterView, ReflectView, RippleLayout, TextImageView and so on. Also it defines some animation effects and functional utils.
Stars: ✭ 102 (-34.62%)
Mutual labels:  android-tv
Jellyfin Androidtv
Android TV Client for Jellyfin
Stars: ✭ 355 (+127.56%)
Mutual labels:  android-tv
Awesome Smart Tv
⚡️A curated list of awesome resources for building Smart TV apps
Stars: ✭ 588 (+276.92%)
Mutual labels:  android-tv
Tvsample
1、仿泰捷视频最新TV版 Metro UI效果. 2、仿腾讯视频TV版(云视听·极光) 列表页
Stars: ✭ 1,112 (+612.82%)
Mutual labels:  android-tv
xcloud-shield
Xcloud Beta Unofficial App for the Nvidia Shield Android TV. Playing Xbox Cloud Gaming directly on the box Nvidia Shield tv in the best way.
Stars: ✭ 93 (-40.38%)
Mutual labels:  android-tv
Android Player
LUSH Player for Mobile, Tablet & TV
Stars: ✭ 129 (-17.31%)
Mutual labels:  android-tv
Liveplayback
Android TV直播电视节目 ,包含各央视频道及卫视频道
Stars: ✭ 757 (+385.26%)
Mutual labels:  android-tv
Renative
🚀🚀🚀Build universal cross-platform apps with React Native. Includes latest iOS, tvOS, Android, Android TV, Android Wear, Web, Tizen TV, Tizen Watch, Tizen Mobile, LG webOS, macOS/OSX, Windows, KaiOS, FirefoxOS Firefox TV platforms
Stars: ✭ 1,199 (+668.59%)
Mutual labels:  android-tv
Tv Samples
Multiple samples showing best practices in app development on Android TV.
Stars: ✭ 377 (+141.67%)
Mutual labels:  android-tv
Android Tv Widget
Android tv,盒子,投影仪 控件
Stars: ✭ 536 (+243.59%)
Mutual labels:  android-tv
Fetch
The best file downloader library for Android
Stars: ✭ 1,124 (+620.51%)
Mutual labels:  android-tv
Tvrecyclerview
A custom RecyclerView for Android TV end
Stars: ✭ 320 (+105.13%)
Mutual labels:  android-tv
Anexplorer
📁 Another Android Explorer ( File Manager ) is an All-in-One Open source file manager. AnExplorer File Manager (File Explorer) is designed for all android devices including Phones, Phablets, Tablets, Chromecast, Wear OS, Android TV and Chromebooks. It's a fully designed with Material guidelines by Google.
Stars: ✭ 1,505 (+864.74%)
Mutual labels:  android-tv
pychannels
Python library for querying and controlling the Channels app.
Stars: ✭ 15 (-90.38%)
Mutual labels:  android-tv
Smarttubenext
Better YouTube experience on Android TV
Stars: ✭ 1,064 (+582.05%)
Mutual labels:  android-tv
Ftvlaunchx
Simple helper application to allow custom launchers on Amazon Fire TV devices.
Stars: ✭ 130 (-16.67%)
Mutual labels:  android-tv
Retrograde Android
Play retro video games on your Android TV!
Stars: ✭ 114 (-26.92%)
Mutual labels:  android-tv
Leankeykeyboard
Keyboard for Android based TV and set-top-box
Stars: ✭ 66 (-57.69%)
Mutual labels:  android-tv

欢迎使用Android TV端焦点框框架 TvFocusBorder Download

  • 支持TvRecyclerView焦点移动;
  • 支持颜色或图片作为焦点框;
  • 支持焦点框圆角变化;

效果

Gradle 引入

//support版本
implementation 'com.owen:tv-focusborder:1.1.4'

//androidx版本
implementation 'com.owen:tv-focusborder:2.0.1'

使用

/** 颜色焦点框 */
FocusBorder mColorFocusBorder = new FocusBorder.Builder().asColor()
        //阴影宽度(方法shadowWidth(18f)也可以设置阴影宽度)
        .shadowWidth(TypedValue.COMPLEX_UNIT_DIP, 20f)
        //阴影颜色
        .shadowColor(Color.parseColor("#3FBB66"))
        //边框宽度(方法borderWidth(2f)也可以设置边框宽度)
        .borderWidth(TypedValue.COMPLEX_UNIT_DIP, 3.2f)
        //边框颜色
        .borderColor(Color.parseColor("#00FF00"))
        //padding值
        .padding(2f)
        //动画时长
        .animDuration(300)
        //不要闪光动画
        //.noShimmer()
        //闪光颜色
        .shimmerColor(Color.parseColor("#66FFFFFF"))
        //闪光动画时长
        .shimmerDuration(1000)
        //不要呼吸灯效果
        //.noBreathing()
        //呼吸灯效果时长
        .breathingDuration(3000)
        //边框动画模式
        .animMode(AbsFocusBorder.Mode.SEQUENTIALLY)
        .build(this);

//焦点监听 方式一:绑定整个页面的焦点监听事件
mColorFocusBorder.boundGlobalFocusListener(new FocusBorder.OnFocusCallback() {
    @Override
    public FocusBorder.Options onFocus(View oldFocus, View newFocus) {
        if(null != newFocus) {
            switch (newFocus.getId()) {
                case R.id.round_frame_layout_1:
                case R.id.round_frame_layout_6:
                    float scale = 1.2f;
                    return FocusBorder.OptionsFactory.get(scale, scale, dp2px(radius) * scale);

                default:
                    break;
            }
        }
        //返回null表示不使用焦点框框架
        return null;
    }
});


/** 图片焦点框 */
FocusBorder mDrawableFocusBorder = new FocusBorder.Builder().asDrawable()
        .borderDrawableRes(R.mipmap.focus)
        .titleBackgroundRes(R.drawable.shape_item_title_bg)
        .titleMarginBottomAutoAlignBorder()
        .titleMargin(10, 0, 10, 4)
        .titlePadding(10)
        .titleTextColor(Color.LTGRAY)
        .titleTextSize(24)
        .titleWidth(ViewGroup.LayoutParams.MATCH_PARENT)
        ...
        .build(this);

//焦点监听 方式二:单个的焦点监听事件
view.setOnFocusChangeListener(new View.OnFocusChangeListener() {
    @Override
    public void onFocusChange(View v, boolean hasFocus) {
        if(hasFocus) {
            mDrawableFocusBorder.onFocus(v, FocusBorder.OptionsFactory.get(1.2f, 1.2f));
        }
    }
});

更详细的使用请见exmaple


扣 扣 群:484790001(注:加群时请写明来源及目的)

TvRecyclerView框架TvRecyclerView

Tab框架TvTabLayout

Tv控件TvWidget

作者 owen

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].