完整项目

常用开源框架分类总结

2017-03-09  本文已影响1183人  s酸菜

暂时没写完,我会继续完善的。

基本控件

APP底部Tab布局

TabLayout+ViewPager 简单实现app底部Tab布局

TabLayout+ViewPager
mViewpager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener
                (mTabLayout));
        mTabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener
                (mViewpager));
View userCenter = View.inflate(this, R.layout.navigator_tab_icon_layout, null);
        TabLayout.Tab tabUserCenter = tabLayout.newTab();
        tabUserCenter.setCustomView(userCenter);
        userCenter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (UIUtils.isLogin()) {
                    //已登录,切换到用户中心
                    mViewPager.setCurrentItem(3, false);
                    tabUserCenter.select();
                } else {
                    //未登录,跳转登录页面
                    startActivity(new Intent(MainActivity.this,LoginActivity.class));
                }
            }
        });

Android Support 25中BottomNavigationView与ViewPager结合实现material Tab标准效果

BottomNavigationView
public final class BottomNavigationMenu extends MenuBuilder {
    public static final int MAX_ITEM_COUNT = 5;

    public BottomNavigationMenu(Context context) {
        super(context);
    }

    @Override
    public SubMenu addSubMenu(int group, int id, int categoryOrder, CharSequence title) {
        throw new UnsupportedOperationException("BottomNavigationView does not support submenus");
    }

    @Override
    protected MenuItem addInternal(int group, int id, int categoryOrder, CharSequence title) {
        if (size() + 1 > MAX_ITEM_COUNT) {
            throw new IllegalArgumentException(
                    "Maximum number of items supported by BottomNavigationView is " + MAX_ITEM_COUNT
                            + ". Limit can be checked with BottomNavigationView#getMaxItemCount()");
        }
        return super.addInternal(group, id, categoryOrder, title);
    }
}

下拉刷新

android-Ultra-Pull-To-Refresh 廖祜秋

android-Ultra-Pull-To-Refresh

SwipeRefreshLayout
google官方控件

SwipeRefreshLayout

轮播图

ConvenientBanner

Android-Coverflow

Android-Coverflow.gif

右滑退出

SwipeBack

相册图片相关

PhotoView
DragPhotoView 基于PhotoView实现的仿微信朋友圈查看大图功能

ImagePicker

RecyclerView

XRecyclerView

RecyclerView Animators
UltimateRecyclerView
Paginate 侵入式的loadMore

标签相关

FlowLayout

AndroidTagGroup

Toast相关

SuperToasts

SuperToasts_Banner.png

新手引导

GuideView

GuideView.png

GuideView-master

GuideView-master.gif

键盘相关

WeChatPswKeyboard

WeChatPswKeyboard.gif

AndroidPicker

Android_Picker.gif

音视频

JieCaoVideoPlayer

作者貌似有嫂子情节,该开源框架集成了一个播放器应该有的技能,只需要简单的几部就可以实现一个视频播放,不好的地方就是很多控件没有放开,需要自己去实现,而且不能实现缓存功能。JCVideoPlayerStandard.java是一个标准播放器的代码,如果需要自定义播放器的可以仿照这个类里面的写法。不过复制代码过来的时候注意里面的资源前面的包名去掉。

GSYVideoPlayer

然而这个作者是个猫控。。。在JieCaoVideoPlayer基础上进行重构的,支持缓存,很多控件有放开,随意显示与隐藏,一键静音功能等。如果需要自定义播放器UI和部分功能跟JieCaoVideoPlayer一样的做法。

GSYVideoPlayer

动画特效

SwipeCardsView

CardSlidePanel

ENViewsDemo

ENViews_o_play.gif

框架模式

上一篇下一篇

猜你喜欢

热点阅读