本文整理汇总了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);
}
});
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
示例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;
}
示例8: getItem
import com.eveningoutpost.dexdrip.ShareModels.Models.ExistingFollower; //导入依赖的package包/类
@Override
public ExistingFollower getItem(int pos) {
return list.get(pos);
}