fr.castorflex.android.circularprogressbar.CircularProgressBar Java Examples

The following examples show how to use fr.castorflex.android.circularprogressbar.CircularProgressBar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PostFragment.java    From Girls with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.activity_fragment, null);
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.activity_recycke_view);

    //设置adapter
    mRecyclerView.setAdapter(mGirlAdapter);
    //设置Item增加、移除动画
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mRecyclerView.setHasFixedSize(false);

    //设置布局管理器
    LinearLayoutManager linearLayoutManager =
            new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
    mRecyclerView.setLayoutManager(linearLayoutManager);

    mCircularProgressBar = (CircularProgressBar) rootView.findViewById(R.id.circular_progressbar);

    swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setColorSchemeColors(
            R.color.holo_red_light,
            R.color.holo_green_light,
            R.color.holo_blue_bright);

    //swipeRefreshLayout 设置下拉刷新事件
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            getData();
            //成功了 关闭刷新
            swipeRefreshLayout.setRefreshing(false);
        }
    });
    return rootView;
}
 
Example #2
Source File: GroupPermissionsFragment.java    From actor-platform with GNU Affero General Public License v3.0 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View res = inflater.inflate(R.layout.fragment_edit_permissions, container, false);
    View rootContainer = res.findViewById(R.id.rootContainer);
    rootContainer.setBackgroundColor(style.getBackyardBackgroundColor());

    canEditInfo = (CheckBox) res.findViewById(R.id.canEditValue);
    canEditInfoTV = (TextView) res.findViewById(R.id.canEditTitle);
    canEditInfoTV.setText(isChannel ? R.string.channel_can_edit_info_members : R.string.group_can_edit_info_members);

    canAdminsEditInfo = (CheckBox) res.findViewById(R.id.canAdminsEditValue);
    canAdminsEditInfoTV = (TextView) res.findViewById(R.id.canAdminsEditTitle);
    canAdminsEditInfoTV.setText(isChannel ? R.string.channel_can_edit_info_admins : R.string.group_can_edit_info_admins);

    canSendInvitations = (CheckBox) res.findViewById(R.id.canMembersInviteValue);
    canSendInvitationsTV = (TextView) res.findViewById(R.id.canMembersInviteTitle);
    canSendInvitationsTV.setText(isChannel ? R.string.channel_can_invite_members : R.string.group_can_invite_members);

    if (!isChannel) {
        showLeaveJoin = (CheckBox) res.findViewById(R.id.showJoinLeaveValue);
        showLeaveJoinTV = (TextView) res.findViewById(R.id.showJoinLeaveTitle);
        showLeaveJoinTV.setText(isChannel ? R.string.channel_show_leave_join : R.string.group_show_leave_join);
    } else {
        res.findViewById(R.id.showJoinLeaveContainer).setVisibility(View.GONE);
    }

    showAdminsToMembers = (CheckBox) res.findViewById(R.id.showAdminsToMembersValue);
    showAdminsToMembersTV = (TextView) res.findViewById(R.id.showAdminsToMembersTitle);
    showAdminsToMembersTV.setText(isChannel ? R.string.channel_show_admin_to_members : R.string.group_show_admin_to_members);

    scrollContainer = res.findViewById(R.id.scrollContainer);
    progress = (CircularProgressBar) res.findViewById(R.id.progress);
    progress.setIndeterminate(true);
    return res;
}
 
Example #3
Source File: MessagesFragment.java    From actor-platform with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

    //
    // Loading arguments
    //
    try {
        peer = Peer.fromBytes(getArguments().getByteArray("EXTRA_PEER"));
        conversationVM = messenger().getConversationVM(peer);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

    //
    // Display List
    //
    BindedDisplayList<Message> displayList = onCreateDisplayList();
    if (isPrimaryMode) {
        displayList.setLinearLayoutCallback(b -> {
            if (layoutManager != null) {
                layoutManager.setStackFromEnd(b);
            }
        });
    }


    //
    // Main View
    //
    View res = inflate(inflater, container, R.layout.fragment_messages, displayList);
    progressView = (CircularProgressBar) res.findViewById(R.id.loadingProgress);
    progressView.setIndeterminate(true);
    progressView.setVisibility(View.INVISIBLE);

    //
    // Loading background
    //
    Drawable background;
    int[] backgrounds = ActorSDK.sharedActor().style.getDefaultBackgrouds();
    String selectedWallpaper = messenger().getSelectedWallpaper();
    if (selectedWallpaper != null) {
        background = getResources().getDrawable(backgrounds[0]);
        if (selectedWallpaper.startsWith("local:")) {
            for (int i = 1; i < backgrounds.length; i++) {
                if (getResources().getResourceEntryName(backgrounds[i]).equals(selectedWallpaper.replaceAll("local:", ""))) {
                    background = getResources().getDrawable(backgrounds[i]);
                }
            }
        } else {
            background = Drawable.createFromPath(BaseActorSettingsFragment.getWallpaperFile());
        }
    } else {
        background = getResources().getDrawable(backgrounds[0]);
    }
    ((ImageView) res.findViewById(R.id.chatBackgroundView)).setImageDrawable(background);


    //
    // List Padding
    //
    View footer = new View(getActivity());
    footer.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Screen.dp(8)));
    addHeaderView(footer); // Add Footer as Header because of reverse layout

    View header = new View(getActivity());
    header.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, Screen.dp(64)));
    addFooterView(header); // Add Header as Footer because of reverse layout


    //
    // Init unread message index if available
    //
    recalculateUnreadMessageIfNeeded();

    return res;
}