當前位置: 首頁>>代碼示例>>Java>>正文


Java ExistingFollower類代碼示例

本文整理匯總了Java中com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower的典型用法代碼示例。如果您正苦於以下問題:Java ExistingFollower類的具體用法?Java ExistingFollower怎麽用?Java ExistingFollower使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExistingFollower類屬於com.eveningoutpost.dexdrip.ShareModels.Models包,在下文中一共展示了ExistingFollower類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getContacts

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
public void getContacts(Callback<List<ExistingFollower>> existingFollowerListener) {
    dexcomShareApi.getContacts(getSessionId()).enqueue(new AuthenticatingCallback<List<ExistingFollower>>(existingFollowerListener) {
        @Override
        public void onRetry() {
            dexcomShareApi.getContacts(getSessionId()).enqueue(this);
        }
    });
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:9,代碼來源:ShareRest.java

示例2: getView

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
@Override
public View getView(final int position, final View convertView, ViewGroup parent) {
    View view = convertView;
    if (view == null) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        view = inflater.inflate(R.layout.item_follower, null);
    }
    TextView followerName = (TextView) view.findViewById(R.id.follwerName);
    Button deleteButton = (Button) view.findViewById(R.id.deleteFollower);

    final ExistingFollower follower = list.get(position);

    followerName.setText(follower.ContactName);
    deleteButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Callback<ResponseBody> deleteFollowerListener = new Callback<ResponseBody>() {
                @Override
                public void onResponse(Response<ResponseBody> response, Retrofit retrofit) {
                    if (response.isSuccess()) {
                        Toast.makeText(context, "Follower deleted succesfully", Toast.LENGTH_LONG).show();
                        list.remove(position);
                        notifyDataSetChanged();
                    } else {
                        Toast.makeText(context, "Failed to delete follower", Toast.LENGTH_LONG).show();
                    }
                }

                @Override
                public void onFailure(Throwable t) {
                    Toast.makeText(context, "Failed to delete follower", Toast.LENGTH_LONG).show();
                }
            };
            shareRest.deleteContact(follower.ContactId, deleteFollowerListener);
        }
    });
    return view;
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:39,代碼來源:FollowerListAdapter.java

示例3: populateFollowerList

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
private void populateFollowerList() {
    existingFollowerListener = new Callback<List<ExistingFollower>>() {
        @Override
        public void onResponse(Response<List<ExistingFollower>> response, Retrofit retrofit) {
            List<ExistingFollower> existingFollowers = response.body();
            if (followerListAdapter != null) {
                existingFollowerList.clear();
                if (existingFollowers != null && existingFollowers.size() > 0)
                    existingFollowerList.addAll(existingFollowers);
                followerListAdapter.notifyDataSetChanged();
            } else {
                if (existingFollowers != null && existingFollowers.size() > 0) {
                    existingFollowerList = existingFollowers;
                    followerListAdapter = new FollowerListAdapter(getApplicationContext(), shareRest, existingFollowerList);
                    existingFollowersView.setAdapter(followerListAdapter);
                }
            }
        }

        @Override
        public void onFailure(Throwable t) {
            // If it fails, don't show followers.
        }
    };

    shareRest.getContacts(existingFollowerListener);

}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:29,代碼來源:FollowerManagementActivity.java

示例4: getContacts

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
public void getContacts(Callback<List<ExistingFollower>> existingFollowerListener) {
    try {
        dexcomShareApi.getContacts(getSessionId()).enqueue(new AuthenticatingCallback<List<ExistingFollower>>(existingFollowerListener) {
            @Override
            public void onRetry() {
                dexcomShareApi.getContacts(getSessionId()).enqueue(this);
            }
        });
    } catch (ShareException e) {
        existingFollowerListener.onFailure(e);
    }
}
 
開發者ID:StephenBlackWasAlreadyTaken,項目名稱:xDrip-Experimental,代碼行數:13,代碼來源:ShareRest.java

示例5: populateFollowerList

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
private void populateFollowerList() {
    existingFollowerListener = new Callback<List<ExistingFollower>>() {
        @Override
        public void onResponse(Response<List<ExistingFollower>> response, Retrofit retrofit) {
            List<ExistingFollower> existingFollowers = response.body();
            if (followerListAdapter != null) {
                existingFollowerList.clear();
                if (existingFollowers != null && existingFollowers.size() > 0)
                    existingFollowerList.addAll(existingFollowers);
                followerListAdapter.notifyDataSetChanged();
            } else {
                if (existingFollowers != null && existingFollowers.size() > 0) {
                    existingFollowerList = existingFollowers;
                    followerListAdapter = new FollowerListAdapter(getApplicationContext(), shareRest, existingFollowerList);
                    existingFollowersView.setAdapter(followerListAdapter);
                }
            }
        }

        @Override
        public void onFailure(Throwable t) {
            Toast.makeText(FollowerManagementActivity.this, "Failed to retrieve follower list: " + t.getMessage(), Toast.LENGTH_LONG).show();
            // If it fails, don't show followers.
        }
    };

    shareRest.getContacts(existingFollowerListener);

}
 
開發者ID:StephenBlackWasAlreadyTaken,項目名稱:xDrip-Experimental,代碼行數:30,代碼來源:FollowerManagementActivity.java

示例6: getContacts

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
@POST("Publisher/ListPublisherAccountSubscriptions")
Call<List<ExistingFollower>> getContacts(@Query("sessionId") String sessionId);
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:3,代碼來源:DexcomShare.java

示例7: FollowerListAdapter

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
public FollowerListAdapter(Context context, ShareRest shareRest, List<ExistingFollower> list) {
    this.context = context;
    this.list = list;
    this.shareRest = shareRest;
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:6,代碼來源:FollowerListAdapter.java

示例8: getItem

import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //導入依賴的package包/類
@Override
public ExistingFollower getItem(int pos) {
    return list.get(pos);
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:5,代碼來源:FollowerListAdapter.java


注:本文中的com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。