Search in sources :

Example 1 with SwipeFrameLayout

use of org.qii.weiciyuan.support.lib.SwipeFrameLayout in project weiciyuan by qii.

the class BrowserWeiboMsgFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    SwipeFrameLayout swipeFrameLayout = new SwipeFrameLayout(getActivity());
    PullToRefreshListView pullToRefreshListView = new PullToRefreshListView(getActivity());
    pullToRefreshListView.setMode(PullToRefreshBase.Mode.DISABLED);
    pullToRefreshListView.setOnLastItemVisibleListener(onLastItemVisibleListener);
    pullToRefreshListView.setOnScrollListener(listViewOnScrollListener);
    listView = pullToRefreshListView.getRefreshableView();
    View header = inflater.inflate(R.layout.browserweibomsgfragment_layout, listView, false);
    listView.addHeaderView(header);
    View switchView = inflater.inflate(R.layout.browserweibomsgfragment_switch_list_type_header, listView, false);
    listView.addHeaderView(switchView);
    switchView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
        //empty
        }
    });
    View progressHeaderLayout = inflater.inflate(R.layout.browserweibomsgfragment_progress_header, listView, false);
    progressHeader = progressHeaderLayout.findViewById(R.id.progressbar);
    progressHeader.setVisibility(View.GONE);
    listView.addHeaderView(progressHeaderLayout);
    View emptyLayout = inflater.inflate(R.layout.browserweibomsgfragment_empty_header, listView, false);
    emptyHeader = (TextView) emptyLayout.findViewById(R.id.empty_text);
    emptyHeader.setOnClickListener(new EmptyHeaderOnClickListener());
    listView.addHeaderView(emptyLayout);
    footerView = inflater.inflate(R.layout.listview_footer_layout, null);
    listView.addFooterView(footerView);
    dismissFooterView();
    repostTab = (TextView) switchView.findViewById(R.id.repost);
    commentTab = (TextView) switchView.findViewById(R.id.comment);
    repostTab.setOnClickListener(new RepostTabOnClickListener());
    commentTab.setOnClickListener(new CommentTabOnClickListener());
    commentTab.setTextColor(getResources().getColor(R.color.orange));
    listView.setFooterDividersEnabled(false);
    listView.setChoiceMode(AbsListView.CHOICE_MODE_SINGLE);
    listView.setOnItemClickListener(commentOnItemClickListener);
    listView.setOnItemLongClickListener(commentOnItemLongClickListener);
    initView(header, savedInstanceState);
    adapter = new BrowserWeiboMsgCommentAndRepostAdapter(this, listView, commentList.getItemList(), repostList.getItemList());
    listView.setAdapter(adapter);
    adapter.notifyDataSetChanged();
    listView.setHeaderDividersEnabled(false);
    swipeFrameLayout.addView(pullToRefreshListView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    return swipeFrameLayout;
}
Also used : BrowserWeiboMsgCommentAndRepostAdapter(org.qii.weiciyuan.ui.adapter.BrowserWeiboMsgCommentAndRepostAdapter) PullToRefreshListView(org.qii.weiciyuan.support.lib.pulltorefresh.PullToRefreshListView) ViewGroup(android.view.ViewGroup) SwipeFrameLayout(org.qii.weiciyuan.support.lib.SwipeFrameLayout) ImageView(android.widget.ImageView) WeiboDetailImageView(org.qii.weiciyuan.support.lib.WeiboDetailImageView) View(android.view.View) AdapterView(android.widget.AdapterView) PullToRefreshListView(org.qii.weiciyuan.support.lib.pulltorefresh.PullToRefreshListView) TextView(android.widget.TextView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) ProfileTopAvatarImageView(org.qii.weiciyuan.support.lib.ProfileTopAvatarImageView)

Example 2 with SwipeFrameLayout

use of org.qii.weiciyuan.support.lib.SwipeFrameLayout in project weiciyuan by qii.

the class UserInfoFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = super.onCreateView(inflater, container, savedInstanceState);
    view.setBackground(null);
    header = inflater.inflate(R.layout.newuserinfofragment_header_layout, getListView(), false);
    getListView().addHeaderView(header);
    footerView.setVisibility(View.GONE);
    progressFooter = inflater.inflate(R.layout.newuserinfofragment_progress_footer, getListView(), false);
    progressFooter.setVisibility(View.GONE);
    getListView().addFooterView(progressFooter);
    moreFooter = inflater.inflate(R.layout.newuserinfofragment_more_footer, getListView(), false);
    moreFooter.setVisibility(View.GONE);
    getListView().addFooterView(moreFooter);
    viewPager = ViewUtility.findViewById(header, R.id.viewpager);
    cover = ViewUtility.findViewById(header, R.id.cover);
    blur = ViewUtility.findViewById(header, R.id.blur);
    friendsCount = ViewUtility.findViewById(header, R.id.friends_count);
    fansCount = ViewUtility.findViewById(header, R.id.fans_count);
    topicsCount = ViewUtility.findViewById(header, R.id.topics_count);
    weiboCount = ViewUtility.findViewById(header, R.id.weibo_count);
    headerFirst = inflater.inflate(R.layout.newuserinfofragment_header_viewpager_first_layout, null, false);
    headerSecond = inflater.inflate(R.layout.newuserinfofragment_header_viewpager_second_layout, null, false);
    headerThird = inflater.inflate(R.layout.newuserinfofragment_header_viewpager_third_layout, null, false);
    avatar = ViewUtility.findViewById(headerFirst, R.id.avatar);
    nickname = ViewUtility.findViewById(headerFirst, R.id.nickname);
    location = ViewUtility.findViewById(headerFirst, R.id.location);
    followsYou = ViewUtility.findViewById(headerFirst, R.id.follows_you);
    bio = ViewUtility.findViewById(headerSecond, R.id.bio);
    url = ViewUtility.findViewById(headerSecond, R.id.url);
    verifiedReason = ViewUtility.findViewById(headerThird, R.id.verified_reason);
    leftPoint = ViewUtility.findViewById(header, R.id.left_point);
    centerPoint = ViewUtility.findViewById(header, R.id.center_point);
    rightPoint = ViewUtility.findViewById(header, R.id.right_point);
    leftPoint.getDrawable().setLevel(1);
    View weiboCountLayout = ViewUtility.findViewById(header, R.id.weibo_count_layout);
    View friendsCountLayout = ViewUtility.findViewById(header, R.id.friends_count_layout);
    View fansCountLayout = ViewUtility.findViewById(header, R.id.fans_count_layout);
    View topicCountLayout = ViewUtility.findViewById(header, R.id.topics_count_layout);
    weiboCountLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = UserTimeLineActivity.newIntent(GlobalContext.getInstance().getSpecialToken(), userBean);
            startActivity(intent);
        }
    });
    friendsCountLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = FriendListActivity.newIntent(GlobalContext.getInstance().getSpecialToken(), userBean);
            startActivity(intent);
        }
    });
    fansCountLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = FanListActivity.newIntent(GlobalContext.getInstance().getSpecialToken(), userBean);
            startActivity(intent);
        }
    });
    topicCountLayout.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = UserTopicListActivity.newIntent(userBean, topicList);
            startActivity(intent);
        }
    });
    View result = view;
    if (!isOpenedFromMainPage()) {
        SwipeFrameLayout swipeFrameLayout = new SwipeFrameLayout(getActivity());
        swipeFrameLayout.addView(result, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        result = swipeFrameLayout;
    }
    return result;
}
Also used : ViewGroup(android.view.ViewGroup) SwipeFrameLayout(org.qii.weiciyuan.support.lib.SwipeFrameLayout) Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) BlurImageView(org.qii.weiciyuan.support.lib.BlurImageView) TextView(android.widget.TextView) TimeLineAvatarImageView(org.qii.weiciyuan.support.lib.TimeLineAvatarImageView)

Aggregations

View (android.view.View)2 ViewGroup (android.view.ViewGroup)2 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 TextView (android.widget.TextView)2 SwipeFrameLayout (org.qii.weiciyuan.support.lib.SwipeFrameLayout)2 Intent (android.content.Intent)1 AbsListView (android.widget.AbsListView)1 ListView (android.widget.ListView)1 BlurImageView (org.qii.weiciyuan.support.lib.BlurImageView)1 ProfileTopAvatarImageView (org.qii.weiciyuan.support.lib.ProfileTopAvatarImageView)1 TimeLineAvatarImageView (org.qii.weiciyuan.support.lib.TimeLineAvatarImageView)1 WeiboDetailImageView (org.qii.weiciyuan.support.lib.WeiboDetailImageView)1 PullToRefreshListView (org.qii.weiciyuan.support.lib.pulltorefresh.PullToRefreshListView)1 BrowserWeiboMsgCommentAndRepostAdapter (org.qii.weiciyuan.ui.adapter.BrowserWeiboMsgCommentAndRepostAdapter)1