public void listPostForCurrentMemberService() {
    if (GeneralHelpers.isInternetAvailable(getActivity())) {
      if (GlobalVariables.isCurrentMember == true) {
        // spinner.setVisibility(View.VISIBLE);
        PostService postService = new PostService(accessToken);
        postService.listPostsForMe();
        loading.setVisibility(View.VISIBLE);
      } else {

        // spinner.setVisibility(View.VISIBLE);
        SharedPreferences preferences =
            getActivity().getSharedPreferences("CurrentUser", getActivity().MODE_PRIVATE);
        Member member =
            Member.createUserFromJson(
                createJsonElementFromString(preferences.getString("profile_member", "")));
        PostService postService = new PostService(accessToken);
        postService.listPostsForMember(member.id);
        loading.setVisibility(View.VISIBLE);
      }
    } else {
      // ViewHelpers.showProgress(false, this, contentFrame, membersSearchProgress);
      ViewHelpers.showPopup(
          getActivity(),
          getResources().getString(R.string.alert_title_network),
          getResources().getString(R.string.no_connection),
          true);
    }
  }
Esempio n. 2
0
 public void listAllAmbassadorsOfHubService() {
   if (GeneralHelpers.isInternetAvailable(getActivity())) {
     HubService hubService = new HubService(accessToken);
     hubService.getHubAmbassadors(hubToDisplay.id);
   } else {
     // ViewHelpers.showProgress(false, this, contentFrame, membersSearchProgress);
     ViewHelpers.showPopup(
         getActivity(),
         getResources().getString(R.string.alert_title_network),
         getResources().getString(R.string.no_connection),
         true);
   }
 }
Esempio n. 3
0
  public void searchForMembersByPaginationService(String search) {
    if (GeneralHelpers.isInternetAvailable(getActivity())) {

      MemberService memberService = new MemberService(accessToken);
      memberService.searchForMembersForTodo(
          search,
          this.from,
          GlobalVariables.SEARCH_SIZE,
          GlobalVariables.ORDER_TYPE,
          GlobalVariables.ORDER_COLUMN);
    } else {
      // ViewHelpers.showProgress(false, this, contentFrame, membersSearchProgress);
      ViewHelpers.showPopup(
          getActivity(),
          getResources().getString(R.string.alert_title_network),
          getResources().getString(R.string.no_connection),
          true);
    }
  }
Esempio n. 4
0
  public void listAllMembersByPaginationService() {
    SharedPreferences preferences =
        getActivity().getSharedPreferences("CurrentUser", getActivity().MODE_PRIVATE);

    accessToken = preferences.getString("access_token", "").replace("\"", "");

    if (GeneralHelpers.isInternetAvailable(getActivity())) {
      MemberService memberService = new MemberService(accessToken);
      memberService.listAllMembersByPaginationForTodo(
          this.from,
          GlobalVariables.SEARCH_SIZE,
          GlobalVariables.ORDER_TYPE,
          GlobalVariables.ORDER_COLUMN);
    } else {
      // ViewHelpers.showProgress(false, this, contentFrame, membersSearchProgress);
      ViewHelpers.showPopup(
          getActivity(),
          getResources().getString(R.string.alert_title_network),
          getResources().getString(R.string.no_connection),
          true);
    }
  }