@Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_image_display);
   // String url = getIntent().getStringExtra("url");
   ImageResult result = (ImageResult) getIntent().getSerializableExtra("result");
   SmartImageView ivImage = (SmartImageView) findViewById(R.id.ivResult);
   // ivImage.setImageUrl(url);
   ivImage.setImageUrl(result.getFullUrl());
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    View view = inflater.inflate(R.layout.infosettingactivity, null);
    myHeadPic = (SmartImageView) view.findViewById(R.id.myheadpic);
    myHeadPic.setImageUrl(
        Common.HTTPSERVICE + XmppTool.loginUser.getUserId() + ".jpg", R.drawable.touxiang);
    showOrg = (TextView) view.findViewById(R.id.showorg);
    showSex = (TextView) view.findViewById(R.id.showsex);
    showMobliePhone = (TextView) view.findViewById(R.id.showmobilephone);
    showPhone = (TextView) view.findViewById(R.id.showphone);
    showPostion = (TextView) view.findViewById(R.id.showposition);
    showmyusername = (TextView) view.findViewById(R.id.showmyusername);

    editOrg = (EditText) view.findViewById(R.id.editorg);
    editPhone = (EditText) view.findViewById(R.id.editphone);
    editMobilePhone = (EditText) view.findViewById(R.id.editmobilephone);
    editPostion = (EditText) view.findViewById(R.id.editposition);
    editSex = (RadioGroup) view.findViewById(R.id.editsex);
    rb1 = (RadioButton) view.findViewById(R.id.sex_nan);
    rb2 = (RadioButton) view.findViewById(R.id.sex_nv);
    dialog = new ProgressDialog(getActivity());
    showInfo();
    getData();
    return view;
  }
  private void init() {
    // 取得诸控件
    // initTopBarForLeft(good.getTitle());
    bar = (ActionBar) findViewById(R.id.headbar);
    bar.setTitleAndLeftButton(R.drawable.back, "详情");
    bar.setOnLeftButtonClickListener(
        new onLeftButtonClickListener() {

          @Override
          public void onClick() {
            finish();
          }
        });

    // btnchat = (Button) findViewById(R.id.chat);
    chat = (LinearLayout) findViewById(R.id.chat);
    comment = (LinearLayout) findViewById(R.id.ping);
    comment_text = (EditText) findViewById(R.id.good_pinglun);
    commentlist = (ListView) findViewById(R.id.pinglun);
    data = new ArrayList<Comment>();
    adapter = new GoodsCommentAdapter(getApplication(), data);
    commentlist.addHeaderView(createListHeadView());
    commentlist.setAdapter(adapter);
    nickname.setText(good.getUser().getNick()); // 昵称
    good_createtime.setText(good.getCreatedAt()); // 物品发表时间
    gallery.setAdapter(galleryAdpter = new GalleryAdpter(mApplication, good.getPicture()));
    user = good.getUser(); // 获得商品的发表用户
    goodTitle.setText(good.getTitle());
    goodPrice.setText("   ¥" + good.getPrice());
    goodContent.setText(good.getContent());
    head.setImageUrl(good.getUser().getAvatar());
    gridViewPic.setAdapter(new myAdapter(this, good.getPicture()));
    getComment();
  }
Beispiel #4
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    this.registerReceiver(
        new BroadcastReceiver() {
          @Override
          public void onReceive(Context arg0, Intent intent) {
            pubnub.disconnectAndResubscribe();
          }
        },
        new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));

    Log.d(TAG, "Show tag writer");
    Log.d(TAG, "TEST");

    SmartImageView profileImage = (SmartImageView) findViewById(R.id.profileImage);
    profileImage.setImageUrl(
        "http://img.thesun.co.uk/multimedia/archive/01654/Panda_1_1654644a.jpg");

    AsyncHttpClient client = new AsyncHttpClient();
    client.get(
        "http://www.google.com",
        new AsyncHttpResponseHandler() {
          @Override
          public void onSuccess(String response) {
            System.out.println(response);
            Log.d(TAG, "HTTP Request Success!!");
          }
        });

    TwitterRestClientUsage tweettime = new TwitterRestClientUsage();
    tweettime.getPublicTimeline();

    Log.d(TAG, "Subscribe");
    subscribe();
  }
Beispiel #5
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    commentList = new ListView(this);
    // set list options
    commentList.setHeaderDividersEnabled(false);
    commentList.setLayoutParams(
        new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    View view = getLayoutInflater().inflate(R.layout.view_weibo, null);
    commentList.addHeaderView(view, null, true);

    setContentView(commentList);

    repostAdapter = new RepostAdapter(this, reposts);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);

    comments = new ArrayList<Comment>();
    reposts = new ArrayList<Status>();

    weiboText = (TextView) findViewById(R.id.weibo_item_text);
    weiboText.setMovementMethod(LinkMovementMethod.getInstance());

    profileImg = (SmartImageView) findViewById(R.id.profile_img);
    weiboUser = (TextView) findViewById(R.id.weibo_item_user);

    thumbnail = (SmartImageView) findViewById(R.id.thumbnail);
    picList = (PicList) findViewById(R.id.piclist);
    retweet = (Retweet) findViewById(R.id.retweet);

    attitudeCount = (TextView) findViewById(R.id.weibo_item_attitude_cnt);
    commentCount = (TextView) findViewById(R.id.weibo_item_comment_cnt);
    repostCount = (TextView) findViewById(R.id.weibo_item_repost_cnt);

    source = (TextView) findViewById(R.id.weibo_item_src);
    source.setMovementMethod(LinkMovementMethod.getInstance());

    status = (Status) getIntent().getSerializableExtra("status");

    weiboUser.setText(status.getUser().getScreenName());

    attitudeCount.setText("赞(" + status.getAttitudesCount() + ")");
    commentCount.setText("评论(" + status.getCommentsCount() + ")");
    repostCount.setText("转发(" + status.getRepostsCount() + ")");
    source.setText(Html.fromHtml("来自: " + status.getSource()));

    weiboText.setText(status.getText());
    profileImg.setImageUrl(status.getUser().getProfileImageUrl());

    List<PicDetail> picDetails = status.getPicDetails();

    if (status.getRetweetedStatus() != null) {
      retweet.setVisibility(View.VISIBLE);
      retweet.setData(status.getRetweetedStatus(), true);
      retweet.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View view) {
              Intent intent = new Intent(ViewWeiboActivity.this, ViewWeiboActivity.class);
              intent.putExtra("status", status.getRetweetedStatus());
              startActivity(intent);
            }
          });
    } else {
      if (picDetails.size() <= 1) {
        thumbnail.setImageUrl(status.getBmiddlePic());
        thumbnail.setOnClickListener(
            new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                Intent intent = new Intent(ViewWeiboActivity.this, ViewImageActivity.class);
                intent.putExtra("uri", status.getOriginalPic());
                startActivity(intent);
              }
            });
      } else {
        List<String> urls = new ArrayList<String>();
        for (PicDetail picDetail : picDetails) {
          urls.add(picDetail.getThumbnailPic());
        }
        picList.setImages(urls);
      }
    }

    handler =
        new Handler(
            new Handler.Callback() {
              @Override
              @SuppressWarnings("unchecked")
              public boolean handleMessage(Message message) {
                switch (message.what) {
                  case UPDATE_CMT:
                    updateCommentList((List<Comment>) message.obj);
                    break;
                  case UPDATE_REPO:
                    updateRepostList((List<Status>) message.obj);
                    break;
                  case LOVE:
                    loveItem.setIcon(R.drawable.rating_favorite_r);
                    Toast.makeText(ViewWeiboActivity.this, loveItem.getTitle(), Toast.LENGTH_LONG)
                        .show();
                    status.setFavorited(true);
                    break;
                  case UNLOVE:
                    loveItem.setIcon(R.drawable.rating_favorite);
                    status.setFavorited(false);
                    break;
                }
                return false;
              }
            });

    profileImg.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            Intent intent = new Intent(ViewWeiboActivity.this, AccountActivity.class);
            intent.putExtra("uid", status.getUser().getId());
            startActivity(intent);
          }
        });

    repostCount.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            loadReposts();
          }
        });

    commentCount.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            loadComments();
          }
        });

    attitudeCount.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {}
        });

    commentAdapter = new CommentAdapter(this, comments);
    commentList.setAdapter(commentAdapter);

    loadComments();

    /*
    commentList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            if (type == COMMENT) {
                Comment comment = (Comment) commentList.getAdapter().getItem(i);
                Intent intent = new Intent(ViewWeiboActivity.this, AccountActivity.class);
                intent.putExtra("uid", comment.getUser().getId());
                startActivity(intent);
            } else {
                Status status = (Status) commentList.getAdapter().getItem(i);
                Intent intent = new Intent(ViewWeiboActivity.this, ViewWeiboActivity.class);
                intent.putExtra("status", status);
                startActivity(intent);
            }
        }
    });
    */
  }