@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_cicrcle_progress);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final ProgressBarCircular progress = (ProgressBarCircular) findViewById(R.id.progress_bar);
    ViewGroup.LayoutParams params = progress.getLayoutParams();
    params.width = (int) (DensityUtil.gettDisplayWidth(this));
    params.height = (int) (DensityUtil.gettDisplayWidth(this));

    SimpleDraweeView mImage = (SimpleDraweeView) findViewById(R.id.image);
    mImage.setImageURI(
        Uri.parse(
            "http://h.hiphotos.baidu.com/image/h%3D300/sign=97028a6b4a086e0675a8394b32097b5a/023b5bb5c9ea15ce1948f653b0003af33b87b2c1.jpg"));

    SimpleDraweeView mImage2 = (SimpleDraweeView) findViewById(R.id.image2);
    mImage2.setImageURI(
        Uri.parse(
            "http://b.hiphotos.baidu.com/image/h%3D300/sign=592f8030ac18972bbc3a06cad6cd7b9d/267f9e2f0708283896096030bf99a9014c08f18a.jpg"));

    SimpleDraweeView mImage3 = (SimpleDraweeView) findViewById(R.id.image3);
    mImage3.setImageURI(
        Uri.parse(
            "http://b.hiphotos.baidu.com/image/h%3D300/sign=592f8030ac18972bbc3a06cad6cd7b9d/267f9e2f0708283896096030bf99a9014c08f18a.jpg"));

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View view) {
            if (progress.getVisibility() != View.VISIBLE) {
              progress.setVisibility(View.VISIBLE);
              progress.postDelayed(
                  new Runnable() {
                    @Override
                    public void run() {
                      progress.showCircleView(
                          new ProgressBarCircular.IOnShowViewEndListener() {
                            @Override
                            public void onEnd() {}
                          });
                    }
                  },
                  1000);
            } else {
              progress.setVisibility(View.GONE);
            }
          }
        });
  }
  @Override
  public void setData(RecommendContent data) {

    super.setData(data);
    recommendContent = data;
    simpleDraweeView1.setImageURI(Uri.parse(recommendContent.getImgUrl1()));
    simpleDraweeView2.setImageURI(Uri.parse(recommendContent.getImgUrl2()));
    title1.setText(recommendContent.getTitle1());
    title2.setText(recommendContent.getTitle2());
    content1.setText(recommendContent.getContent1());
    content2.setText(recommendContent.getContent2());
    cardView1.setOnClickListener(this);
    cardView2.setOnClickListener(this);
  }
Пример #3
0
 @Override
 public void changeAvatar(String path) {
   if (TextUtils.isEmpty(path)) {
     return;
   }
   imgAvatar.setImageURI(Uri.parse(path));
 }
Пример #4
0
  protected void buildMultiPic(final GridLayout gridLayout) {
    gridLayout.setVisibility(View.VISIBLE);
    // 获取当前屏幕尺寸
    DisplayMetrics metrics = new DisplayMetrics();
    WindowManager windowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
    windowManager.getDefaultDisplay().getMetrics(metrics);
    // 设置图片的宽度和高度
    int picWidth = metrics.widthPixels / 3 - 48;

    for (int i = 0; i < 9; i++) {
      // 获取View
      SimpleDraweeView simpleDraweeView = (SimpleDraweeView) gridLayout.getChildAt(i);
      // 设置布局参数
      GridLayout.LayoutParams layoutParams = new GridLayout.LayoutParams();
      layoutParams.width = picWidth;
      layoutParams.height = picWidth;
      layoutParams.setMargins(8, 8, 8, 8);
      simpleDraweeView.setLayoutParams(layoutParams);
      // 设置图片数据源
      simpleDraweeView.setImageURI(Uri.parse(Image.imageThumbUrls[i]));
      // 准备传递数据
      final ImageViewPageMessage imageViewPageMessage =
          new ImageViewPageMessage(Image.imageThumbUrls, i);
      simpleDraweeView.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              EventBus.getDefault().postSticky(imageViewPageMessage);
              Intent intent = new Intent(mContext, ImageViewPagerActivity.class);
              mContext.startActivity(intent);
            }
          });
    }
  }
Пример #5
0
  private void bindData() {
    task = (Task) getIntent().getSerializableExtra("task");
    tv_name.setText(task.getName());
    tv_name.setSelection(tv_name.length());
    tv_time.setText(TaskUtil.getZixiTimeS(task.getTime()));
    int p = 4320 - TaskUtil.getDurationFromNow(task.getTime());
    if (p <= 0) p = 1;
    pb.setText(TaskUtil.getDescriptionTimeFromTimestamp(task.getTime()));
    if (task.getTime() <= System.currentTimeMillis()) {
      pb.setRoundWidth(0);
      pb.setText(TaskUtil.getZixiDateS(task.getTime()));
    } else {
      pb.setRoundWidth(PixelUtil.dp2px(6));
    }
    if (p < 100) p = 100; // 防止太小了
    pb.setProgressNoAnim(p);
    if (task.getImageUrl() != null) {
      iv_home_bg.setImageURI(Uri.parse(task.getImageUrl()));
    }

    materialMenu.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            onBackPressed();
          }
        });

    String path = task.getAudioUrl();
    if (path != null) {
      final ImageButton ib_play = (ImageButton) ll_audio.findViewById(R.id.ib_play);
      final ProgressBar pb = (ProgressBar) ll_audio.findViewById(R.id.pb2);
      ib_play.setTag("play");
      ib_play.setOnClickListener(
          new View.OnClickListener() {
            @Override
            public void onClick(View v) {
              ib_play.setOnClickListener(
                  new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                      if (ib_play.getTag().equals("play")) {
                        ib_play.setImageResource(R.drawable.pause_audio);
                        ib_play.setTag("pause");
                        NotifyUtils.palyAudio(context, ib_play, pb, task.getAudioUrl());
                      } else {
                        ib_play.setTag("play");
                        ib_play.setImageResource(R.drawable.play_audio);
                        NotifyUtils.pauseAudio(ib_play);
                      }
                    }
                  });
            }
          });
    }
    if (task.getNote() != null) {
      ((TextView) findViewById(R.id.tv_note)).setText(task.getNote());
    }
  }
Пример #6
0
  @Override
  protected void initData() {
    String s = "res://com.example.jin.huaxiajuntuo/" + R.drawable.guide211;

    Uri uri = Uri.parse(s);
    System.out.println("22222" + uri);
    mSdv.setImageURI(uri);
  }
Пример #7
0
 private boolean loadImage(
     final SimpleDraweeView imageView, final Cursor cursor, final Binding binding) {
   final String url = cursor.getString(binding.getColumnIndex());
   if (url != null) {
     imageView.setImageURI(Uri.parse(url));
   }
   return true;
 }
Пример #8
0
 private void setUserHeader() {
   if (userHeader == null) return;
   user = CommConfig.getConfig().loginedUser;
   int pos = user.iconUrl.indexOf("@");
   String userIcon = user.iconUrl;
   if (pos > 0) {
     userIcon = user.iconUrl.substring(0, pos);
   }
   userHeader.setImageURI(Uri.parse(userIcon));
 }
Пример #9
0
 public void addPlusView() {
   logo.setImageURI(Uri.parse(Constant.URLS[1]));
   clubName.setText("동호회 생성");
   region.setVisibility(GONE);
   leader.setVisibility(GONE);
   category.setVisibility(GONE);
   memberCount.setVisibility(GONE);
   memberLimit.setVisibility(GONE);
   permission.setVisibility(GONE);
   this.exist = false;
 }
Пример #10
0
 public void addTestView() {
   logo.setImageURI(Uri.parse(Constant.URLS[0]));
   clubName.setText("clubName");
   region.setText("region");
   leader.setText("leader");
   category.setText("category");
   memberCount.setText("현재 명");
   memberLimit.setText("제한 명");
   permission.setText("공개 동호회");
   this.exist = true;
 }
Пример #11
0
  private void setOrganization() {
    TextView repos_description = (TextView) findViewById(R.id.repos_description);
    TextView orga_name = (TextView) findViewById(R.id.orga_name);
    SimpleDraweeView orga_avatar = (SimpleDraweeView) findViewById(R.id.orga_avatar);

    if (orgs != null) {
      orga_name.setText(orgs.name);
      repos_description.setText(orgs.description);
      orga_avatar.setImageURI(Uri.parse(orgs.avatar_url));
    }

    TextView members = (TextView) findViewById(R.id.members);
    TextView events = (TextView) findViewById(R.id.events);
    TextView repositories = (TextView) findViewById(R.id.repositories);
    members.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intent = new Intent(OrganizationDetailActivity.this, UserListActivity.class);
            Bundle bundle = new Bundle();
            bundle.putParcelable(ORGS, orgs);
            intent.putExtras(bundle);
            intent.putExtra(UserListActivity.USER_TYPE, UserListActivity.USER_TYPE_MEMBER);
            startActivity(intent);
          }
        });
    repositories.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intent = new Intent(OrganizationDetailActivity.this, ReposListActivity.class);
            Bundle bundle = new Bundle();
            bundle.putParcelable(ORGS, orgs);
            intent.putExtras(bundle);
            intent.putExtra(ReposListActivity.REPOS_TYPE, ReposListActivity.REPOS_TYPE_ORGS);
            startActivity(intent);
          }
        });
    events.setOnClickListener(
        new View.OnClickListener() {

          @Override
          public void onClick(View v) {
            Intent intent = new Intent(OrganizationDetailActivity.this, EventListActivity.class);
            Bundle bundle = new Bundle();
            bundle.putParcelable(ORGS, orgs);
            intent.putExtras(bundle);
            intent.putExtra(EventListActivity.EVENT_TYPE, EventListActivity.EVENT_TYPE_ORGS);
            startActivity(intent);
          }
        });
  }
Пример #12
0
 public void addView(JSONObject result) throws JSONException {
   logo.setImageURI(Uri.parse(result.getString("logoUrl")));
   clubName.setText(result.getString("clubName"));
   region.setText(result.getString("region"));
   leader.setText(result.getString("leader"));
   category.setText(result.getString("category"));
   memberCount.setText("현재 " + result.getInt("memberCount") + "명");
   memberLimit.setText("제한 " + result.getInt("memberLimit") + "명");
   if (result.getInt("permission") == 0) {
     permission.setText("공개 동호회");
   } else if (result.getInt("permission") == 1) {
     permission.setText("비공개 동호회");
   } else if (result.getInt("permission") == 2) {
     permission.setText("비밀 동호회");
   }
   this.exist = true;
 }
Пример #13
0
 @Override
 public void onSuccess(ThemeContent json) {
   mSwipeRefreshLayout.setRefreshing(false);
   tv_description.setText(json.getDescription());
   draweeView.setImageURI(Uri.parse(json.getImage()));
   List<Editor> editors = json.getEditors();
   layout_icons.removeAllViews();
   if (editors != null && editors.size() > 0) {
     for (Editor ts : editors) {
       View view = _inflater.inflate(R.layout.layout_editor_icon, null);
       SimpleDraweeView imageView = (SimpleDraweeView) view.findViewById(R.id.img_icon);
       Uri uri = Uri.parse(ts.getAvatar());
       imageView.setImageURI(uri);
       layout_icons.addView(view);
     }
   }
   adapter.setLists(json.getStories());
 }
  private void setupCardView(Item item) {
    // Item item = Singleton.getInstance().getItems().items.get(pos);
    textViewTitle.setText(item.title);
    textViewDomain.setText(item.title);
    textViewFullUrl.setText(item.displayLink);
    textViewDateSaved.setText(item.kind);

    Uri uri = null;
    try {
      uri = Uri.parse(item.image.thumbnailLink);
    } catch (Exception e) {
      e.printStackTrace();
    }
    simpleDraweeView.setImageURI(uri);
    textViewDone.setOnClickListener(v -> onBackPressed());
    textViewCancel.setOnClickListener(v -> onBackPressed());
    textViewDelete.setOnClickListener(v -> onBackPressed());
  }
Пример #15
0
  public void onFragmentBack(final AcContentInfo.DataEntity.FullContentEntity fullContentEntity) {
    // 加载标题图片并点击播放默认第一个视频
    mTitleImg.setImageURI(Uri.parse(fullContentEntity.getCover()));
    mTitleImg.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            AcContentInfo.DataEntity.FullContentEntity.VideosEntity videosEntity =
                fullContentEntity.getVideos().get(0);

            VideoPlayActivity.startActivity(
                AcContentActivity.this,
                String.valueOf(videosEntity.getVideoId()),
                String.valueOf(videosEntity.getDanmakuId()),
                videosEntity.getSourceId(),
                videosEntity.getType());
          }
        });
    //        mCollapsingToolbarLayout.setTitle("AC" + fullContentEntity.getContentId());
  }
Пример #16
0
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      View view = _inflater.inflate(R.layout.fragment_main_item, null);
      Story s = lists.get(position);
      if (s != null) {
        TextView item_title = (TextView) view.findViewById(R.id.item_title);
        item_title.setText(s.getTitle());
        SimpleDraweeView draweeView = (SimpleDraweeView) view.findViewById(R.id.item_image);
        List<String> imgs = s.getImages();
        if (imgs != null && imgs.size() > 0) {
          Uri uri = Uri.parse(imgs.get(0));
          draweeView.setImageURI(uri);
        } else {
          draweeView.setVisibility(View.GONE);
        }
        view.setOnClickListener(new onItemClickListener(s.getId()));
      }

      return view;
    }
Пример #17
0
 @Override
 public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
   if (holder instanceof ItemViewHolder) {
     ItemViewHolder item = (ItemViewHolder) holder;
     Post post = mPostList.get(position);
     item.avatar.setImageURI(Uri.parse(StrUtils.thumForID(post.userId)));
     item.avatar.setTag(post.userId);
     item.avatar.setOnClickListener(mListener);
     item.userName.setText(post.name);
     item.university.setText(post.school);
     item.time.setText(StrUtils.timeTransfer(post.timestamp));
     item.title.setText(post.title);
     item.content.setText(post.body);
     item.like_number.setText(post.likenumber);
     item.comment_number.setText(post.commentnumber);
     item.grid.removeAllViews();
     for (int i = 0; i < post.thumbnailUrl.size() && i < 4; i++) {
       String url = post.thumbnailUrl.get(i);
       SimpleDraweeView image = new SimpleDraweeView(mContext);
       item.grid.addView(image);
       image.setImageURI(Uri.parse(url));
       image.setId(imageID);
       image.setOnClickListener(mListener);
       try {
         JSONObject j = new JSONObject();
         JSONArray array = new JSONArray(post.imageUrl);
         j.put(AtyImage.KEY_ARRAY, array);
         j.put(AtyImage.KEY_INDEX, i);
         image.setTag(j.toString());
       } catch (JSONException e) {
         // ignore
       }
     }
     item.itemView.setTag(post);
     item.itemView.setOnClickListener(mListener);
   } else if (holder instanceof ProgressViewHolder) {
     ProgressViewHolder progress = (ProgressViewHolder) holder;
     progress.progressBar.setIndeterminate(true);
   }
 }
  @Override
  public void onResume() {
    super.onResume();

    Bundle bundle = getArguments();
    final int posicion = bundle.getInt("posicion");

    DetalleImagen item = MainActivity.lista.get(posicion);

    ivImagen.setImageURI(Uri.parse(item.getRutaImagen()));
    lblTitulo.setText(item.getTitulo());

    btnAbrir.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Intent intent = new Intent(getActivity(), TerceroActivity.class);
            intent.putExtra("posicion", posicion);
            startActivity(intent);
          }
        });
  }
Пример #19
0
  private void init(Context context) {
    this.mContext = context;
    Log.d(Constant.LOG, "메인 커스텀 리니어레이아웃");
    String infService = Context.LAYOUT_INFLATER_SERVICE;
    LayoutInflater li;
    li = (LayoutInflater) getContext().getSystemService(infService);
    li.inflate(R.layout.linear_main_gridview, this, true);

    logo = (SimpleDraweeView) findViewById(R.id.logo);
    clubName = (TextView) findViewById(R.id.clubName);
    region = (TextView) findViewById(R.id.region);
    leader = (TextView) findViewById(R.id.leader);
    category = (TextView) findViewById(R.id.category);
    memberCount = (TextView) findViewById(R.id.memberCount);
    memberLimit = (TextView) findViewById(R.id.memberLimit);
    permission = (TextView) findViewById(R.id.permission);

    Random ran = new Random();
    Uri uri = Uri.parse(Constant.URLS[ran.nextInt(34)]);
    logo.setImageURI(uri);

    setOnClickListener(this);
  }
 public void bind(Context context, UserDataHolder dataHolder, int position) {
   mIcon.setImageURI(Uri.parse(mUser.getIconUrl()));
   mTitleText.setText(mUser.getNickname());
 }
Пример #21
0
  // 实现setContentView方法
  @Override
  public void setContentView(View contentView, int position, HorizontalScrollView parent) {
    SimpleDraweeView userimg =
        (SimpleDraweeView) contentView.findViewById(R.id.petdiartycomment_userimg);
    TextView timeTv = (TextView) contentView.findViewById(R.id.petdiartycomment_time);
    TextView contentTv = (TextView) contentView.findViewById(R.id.petdiartycomment_content);
    TextView voicenameTv = (TextView) contentView.findViewById(R.id.petdiartycomment_voice_name);
    PercentRelativeLayout voiceRL =
        (PercentRelativeLayout) contentView.findViewById(R.id.petdiartycomment_voice);
    ImageView voiceImg = (ImageView) contentView.findViewById(R.id.petdiartycomment_voiceimg);
    TextView voiceText = (TextView) contentView.findViewById(R.id.petdiartycomment_voicetext);
    CommontObject commentObj = (CommontObject) getItem(position);
    if (commentObj != null) {
      AccountObject account = commentObj.getAccount();
      String name = "";
      if (account != null) {
        if (!CommonTextUtils.isEmpty(account.getIcoUrl())) {
          FrescoHelper.displayImageview(
              userimg,
              account.getIcoUrl() + CommonUtils.getAvatarSize(mContext),
              R.drawable.avatar_default_image,
              mContext.getResources(),
              true);
        } else {
          Uri uri = Uri.parse("res://mobi.jzcx.android.chongmi/" + R.drawable.avatar_default_image);
          userimg.setImageURI(uri);
        }
        name = account.getNickName();
      }
      if (!CommonTextUtils.isEmpty(commentObj.getTimeStamp())) {
        timeTv.setText(commentObj.getTimeStamp());
      } else {
        timeTv.setText("");
      }
      if (!CommonTextUtils.isEmpty(commentObj.getText())) {
        contentTv.setText(commentObj.getText());
      } else {
        contentTv.setText("");
      }
      // if (!CommonTextUtils.isEmpty(commentObj.getVoiceUrl())) {
      // voiceRL.setVisibility(View.VISIBLE);
      // contentTv.setVisibility(View.GONE);
      // } else {
      //
      // }
      voiceRL.setVisibility(View.GONE);
      contentTv.setVisibility(View.VISIBLE);
      if (!CommonTextUtils.isEmpty(name)) {
        voicenameTv.setText(name);
      } else {
        voicenameTv.setText("");
      }
      userimg.setOnClickListener(new userImgClick(account));

      // String localPath = FileUtils.VOICE +
      // DemoUtils.md5(commentObj.getVoiceUrl()) + ".amr";
      //
      // if (FileUtils.exists(localPath)) {
      // try {
      // long duration = CommonUtils.getAmrDuration(new File(localPath));
      // NumberFormat nf = NumberFormat.getNumberInstance();
      // nf.setMaximumFractionDigits(2);
      // voiceText.setText(nf.format(Double.valueOf(duration / 1000)));
      // } catch (IOException e) {
      // e.printStackTrace();
      // }
      // voiceRL.setOnClickListener(new VoicePlayClickListener(localPath,
      // voiceImg, this, mContext));
      // } else {
      // voiceText.setText("");
      // }
    }
  }
Пример #22
0
 public void loadImage(String url) {
   super.setImageURI(Uri.parse(url));
 }
 public void setProfilePicture(String pp_url) {
   Uri imageUri = Uri.parse(pp_url);
   ppicture.setImageURI(imageUri);
 }
Пример #24
0
 public ViewHolderHelper setImageFromUrl(int viewId, String url, int res) {
   SimpleDraweeView imageView = findViewById(viewId);
   imageView.setImageURI(Uri.parse(url));
   return this;
 }
 public void setHeader(MoreHeaderData data) {
   if (data.getBg() != null) imgBg.setImageURI(Uri.parse(data.getBg()));
   inrecordTotalCount.setText(data.getNum() + "");
   visitTotalCount.setText(data.getVisit() + "");
   zanTotalCount.setText(data.getZan() + "");
 }
 public void setSharePic(String sharePic) {
   if (sharePic.equals("")) Log.e("Recycler", sharePic);
   // share_container.setVisibility(View.GONE);
   else share_profilePicture.setImageURI(Uri.parse(sharePic));
   share_progressbar.setVisibility(View.GONE);
 }
Пример #27
0
  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  @Override
  public void setData(SubCommentDataModel data) {
    super.setData(data);
    this.data = data;
    try {
      String result = URLDecoder.decode(data.getSubCommentContent(), Xml.Encoding.UTF_8.name());
      commentContent.setText(result);
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    }
    userName.setText(data.getUserName());
    userIcon.setImageURI(Uri.parse(data.getUserImg()));
    time.setText(data.getSubTime());
    if (data.getLikeNumber() == 0) {
      likeNumber.setText("点赞");
    } else {
      likeNumber.setText(String.valueOf(data.getLikeNumber()));
    }
    levels.setText(String.valueOf(getAdapterPosition() + 1) + "楼");

    if (SubCommentAdapter.isNotLike.get(data.getCid()) == null) {
      HashMap<Integer, Boolean> hashMap = new HashMap<>();
      hashMap.put(getAdapterPosition(), false);
      ArrayList<HashMap<Integer, Boolean>> list = new ArrayList<>();
      list.add(getAdapterPosition(), hashMap);
      SubCommentAdapter.isNotLike.put(data.getCid(), list);
      likeIcon.setBackground(getContext().getResources().getDrawable(R.mipmap.like));
      isNotLike = false;
    } else {
      if (getAdapterPosition() == SubCommentAdapter.isNotLike.get(data.getCid()).size()) {
        HashMap<Integer, Boolean> hashMap = new HashMap<>();
        hashMap.put(getAdapterPosition(), false);
        SubCommentAdapter.isNotLike.get(data.getCid()).add(getAdapterPosition(), hashMap);
      }
      likeIcon.setBackground(getContext().getResources().getDrawable(R.mipmap.like));
      isNotLike = false;
    }

    if (SubCommentAdapter.isNotLike.get(data.getCid()) != null
        && SubCommentAdapter.isNotLike.get(data.getCid()).get(getAdapterPosition()) != null) {
      if (SubCommentAdapter.isNotLike
              .get(data.getCid())
              .get(getAdapterPosition())
              .get(getAdapterPosition())
          != null) {
        if (SubCommentAdapter.isNotLike
            .get(data.getCid())
            .get(getAdapterPosition())
            .get(getAdapterPosition())) {
          likeIcon.setBackground(getContext().getResources().getDrawable(R.mipmap.like_click));
          isNotLike = true;
        } else {
          likeIcon.setBackground(getContext().getResources().getDrawable(R.mipmap.like));
          isNotLike = false;
        }
      }
    }

    likeIcon.setOnClickListener(this);
  }