use of org.aisen.weibo.sina.sinasdk.bean.Group in project AisenWeiBo by wangdan.
the class PublishStatusFragment method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// 所有人可见
if (item.getItemId() == R.id.group_all_visiable) {
getPublishBean().getParams().addParameter("visible", "0");
} else // 设置定时
if (item.getItemId() == R.id.publish_timing) {
// 定时发布
setTiming();
} else // 取消定时
if (item.getItemId() == R.id.cancel_timing) {
getPublishBean().setTiming(0);
setTimingHint();
} else // 分组
{
int groupIndex = item.getItemId();
if (groupIndex < AppContext.getAccount().getGroups().getLists().size()) {
Group group = AppContext.getAccount().getGroups().getLists().get(groupIndex);
if (group.getName().equalsIgnoreCase(item.getTitle().toString())) {
getPublishBean().getParams().addParameter("visible", "3");
getPublishBean().getParams().addParameter("list_id", group.getIdstr());
setVisiableHint();
}
}
}
setVisiableHint();
return super.onOptionsItemSelected(item);
}
use of org.aisen.weibo.sina.sinasdk.bean.Group in project AisenWeiBo by wangdan.
the class SinaSDK method friendshipGroups.
/**
* 获取好友的分组信息
*
* @return
*/
public Groups friendshipGroups() throws TaskException {
Groups groups = doGet(getSetting("friendshipGroups"), configParams(null), Groups.class);
Map<String, String> groupMap = new HashMap<String, String>();
List<Group> groupList = new ArrayList<Group>();
// fuck 有两个特别关注
for (Group group : groups.getLists()) {
if (!groupMap.containsKey(group.getIdstr())) {
groupList.add(group);
groupMap.put(group.getIdstr(), group.getIdstr());
}
}
groups.setLists(groupList);
return groups;
}
use of org.aisen.weibo.sina.sinasdk.bean.Group in project AisenWeiBo by wangdan.
the class OfflineService method prepareOffline.
// 准备离线
private void prepareOffline() {
mStatus = OfflineStatus.prepare;
mNotifier.cancelNotification(OfflineNotifier.OfflineStatus);
mNotifier.cancelNotification(OfflineNotifier.OfflinePicture);
// 开始离线微博
unOfflineGroups = new ArrayList<>();
unOfflineGroups.addAll(mGroups);
for (Group group : mGroups) {
new LoadStatusTask(group).executeOnSerialExecutor();
}
}
use of org.aisen.weibo.sina.sinasdk.bean.Group in project AisenWeiBo by wangdan.
the class OfflineSettingsFragment method setGroupsSummary.
private void setGroupsSummary() {
List<Group> groups = SinaDB.getOfflineSqlite().select(new Extra(AppContext.getAccount().getUser().getIdstr(), null), Group.class);
String summary = "";
if (groups.size() == 0) {
summary = getString(R.string.offline_none_groups) + ",";
} else {
for (Group group : groups) {
summary = summary + group.getName() + ",";
}
}
pOfflineGroups.setSummary(summary.substring(0, summary.length() - 1));
}
use of org.aisen.weibo.sina.sinasdk.bean.Group in project AisenWeiBo by wangdan.
the class OfflineSettingsFragment method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
if (preference.getKey().equals("pOfflineGroups")) {
final List<Group> groups = SinaDB.getOfflineSqlite().select(new Extra(AppContext.getAccount().getUser().getIdstr(), null), Group.class);
OfflineUtils.showOfflineGroupsModifyDialog(getActivity(), groups, new OfflineUtils.OnOfflineGroupSetCallback() {
@Override
public void onChanged(List<Group> newGroups) {
SinaDB.getOfflineSqlite().deleteAll(OfflineUtils.getLoggedExtra(null), Group.class);
if (newGroups == null || newGroups.size() == 0) {
} else {
SinaDB.getOfflineSqlite().insertOrReplace(OfflineUtils.getLoggedExtra(null), newGroups);
}
setGroupsSummary();
}
}, R.string.offline_groups_dialog);
}
return true;
}
Aggregations