Search in sources :

Example 21 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class UserInfoFragment method newMsgLoaderSuccessCallback.

@Override
protected void newMsgLoaderSuccessCallback(MessageListBean newValue, Bundle loaderArgs) {
    stopRefreshMenuAnimationIfPossible();
    getListView().removeFooterView(progressFooter);
    if (getActivity() != null && newValue.getSize() > 0) {
        getList().addNewData(newValue);
        getAdapter().notifyDataSetChanged();
        getListView().setSelectionAfterHeaderView();
        getActivity().invalidateOptionsMenu();
        moreFooter.setVisibility(View.VISIBLE);
        if (isMyself()) {
            MyStatusDBTask.asyncReplace(getList(), userBean.getId());
        }
        UserBean userInfoFromServer = newValue.getItem(0).getUser();
        if (userInfoFromServer != null && !isSinaWeiboBlockWeiciyuanFetchUserInfo(userInfoFromServer)) {
            UserInfoFragment.this.userBean = userInfoFromServer;
            displayBasicInfo();
            displayCoverPicture();
            if (getActivity() instanceof UserInfoActivity) {
                ((UserInfoActivity) getActivity()).setUser(userInfoFromServer);
                getActivity().invalidateOptionsMenu();
            }
        }
    }
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean)

Example 22 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class UserTimeLineActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    getActionBar().setDisplayShowTitleEnabled(true);
    getActionBar().setDisplayShowHomeEnabled(false);
    String token = getIntent().getStringExtra("token");
    UserBean bean = getIntent().getParcelableExtra("user");
    getActionBar().setTitle(bean.getScreen_name());
    if (getSupportFragmentManager().findFragmentByTag(StatusesByIdTimeLineFragment.class.getName()) == null) {
        getSupportFragmentManager().beginTransaction().replace(android.R.id.content, StatusesByIdTimeLineFragment.newInstance(bean, token), StatusesByIdTimeLineFragment.class.getName()).commit();
    }
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean)

Example 23 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class UserInfoActivity method processIntent.

private void processIntent(Intent intent) {
    Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
    // only one message sent during the beam
    NdefMessage msg = (NdefMessage) rawMsgs[0];
    Toast.makeText(this, new String(msg.getRecords()[0].getPayload()), Toast.LENGTH_SHORT).show();
    bean = new UserBean();
    bean.setScreen_name(new String(msg.getRecords()[0].getPayload()));
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean) NdefMessage(android.nfc.NdefMessage) Parcelable(android.os.Parcelable)

Example 24 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class DMActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getActionBar().setDisplayShowHomeEnabled(false);
    getActionBar().setDisplayShowTitleEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    UserBean bean = (UserBean) getIntent().getParcelableExtra("user");
    setTitle(bean.getScreen_name());
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction().replace(android.R.id.content, DMConversationListFragment.newInstance(bean), DMConversationListFragment.class.getName()).commit();
    }
}
Also used : UserBean(org.qii.weiciyuan.bean.UserBean)

Example 25 with UserBean

use of org.qii.weiciyuan.bean.UserBean in project weiciyuan by qii.

the class FanDao method removeFan.

public UserBean removeFan() throws WeiboException {
    String url = URLHelper.FRIENDSHIPS_FOLLOWERS_DESTROY;
    Map<String, String> map = new HashMap<String, String>();
    map.put("access_token", access_token);
    map.put("uid", uid);
    String jsonData = HttpUtility.getInstance().executeNormalTask(HttpMethod.Post, url, map);
    try {
        UserBean value = new Gson().fromJson(jsonData, UserBean.class);
        if (value != null) {
            return value;
        }
    } catch (JsonSyntaxException e) {
        AppLogger.e(e.getMessage());
    }
    return null;
}
Also used : JsonSyntaxException(com.google.gson.JsonSyntaxException) UserBean(org.qii.weiciyuan.bean.UserBean) HashMap(java.util.HashMap) Gson(com.google.gson.Gson)

Aggregations

UserBean (org.qii.weiciyuan.bean.UserBean)31 Gson (com.google.gson.Gson)9 JsonSyntaxException (com.google.gson.JsonSyntaxException)9 DMUserBean (org.qii.weiciyuan.bean.DMUserBean)8 HashMap (java.util.HashMap)7 MessageBean (org.qii.weiciyuan.bean.MessageBean)6 Drawable (android.graphics.drawable.Drawable)4 RelativeLayout (android.widget.RelativeLayout)4 AtUserBean (org.qii.weiciyuan.bean.AtUserBean)4 SearchUserBean (org.qii.weiciyuan.bean.SearchUserBean)4 Intent (android.content.Intent)3 SpannableString (android.text.SpannableString)3 CommentBean (org.qii.weiciyuan.bean.CommentBean)3 Cursor (android.database.Cursor)2 View (android.view.View)2 ListView (android.widget.ListView)2 ArrayList (java.util.ArrayList)2 AccountBean (org.qii.weiciyuan.bean.AccountBean)2 WriteReplyToCommentActivity (org.qii.weiciyuan.ui.send.WriteReplyToCommentActivity)2 PendingIntent (android.app.PendingIntent)1