Java Code Examples for android.widget.ImageView

The following are top voted examples for showing how to use android.widget.ImageView. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: ShangHanLun   File: ATableViewCellAccessoryView.java   Source Code and License 7 votes vote down vote up
private static ImageView getAccessoryView(ATableViewCell cell, ATableViewCellAccessoryType accessoryType) {
    LinearLayout containerView = (LinearLayout) cell.findViewById(R.id.containerView);

    // check if accessoryView already exists for current cell before creating a new instance.
    ImageView accessoryView = (ImageView) containerView.findViewById(R.id.accessoryView);
    if (accessoryView == null) {
        Resources res = cell.getResources();

        // get marginRight for accessoryView, DisclosureButton has a different one.
        LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
        int marginRight = (int) res.getDimension(R.dimen.atv_cell_content_margin);
        if (accessoryType == ATableViewCellAccessoryType.DisclosureButton) {
            marginRight = (int) res.getDimension(R.dimen.atv_cell_disclosure_button_margin_right);
        }
        params.setMargins(0, 0, marginRight, 0);

        // setup.
        accessoryView = new ATableViewCellAccessoryView(cell.getContext());
        accessoryView.setId(R.id.accessoryView);
        accessoryView.setLayoutParams(params);

        containerView.addView(accessoryView);
    }

    return accessoryView;
}
 
Example 2
Project: justintrain-client-android   File: ItemBuilder.java   Source Code and License 7 votes vote down vote up
public ItemBuilder addItemWithIconTitleSubtitle(int icon, String title, String subtitle) {
    view = inflater.inflate(R.layout.item_element_icon_title_subtitle, parent, false);
    ImageView iv = (ImageView) view.findViewById(R.id.iv_icon);
    iv.setImageResource(icon);
    TextView tv = (TextView) view.findViewById(R.id.tv_title);
    tv.setText(title);
    TextView tv2 = (TextView) view.findViewById(R.id.tv_subtitle);
    tv2.setText(subtitle);
    return this;
}
 
Example 3
Project: SWDemo   File: ChatActivity.java   Source Code and License 7 votes vote down vote up
public void onBtnNClicked(View view) {
    if (mVideoPreProcessing == null) {
        mVideoPreProcessing = new VideoPreProcessing();
    }

    ImageView iv = (ImageView) view;
    Object showing = view.getTag();
    if (showing != null && (Boolean) showing) {
        mVideoPreProcessing.enablePreProcessing(false);
        iv.setTag(null);
        iv.clearColorFilter();
    } else {
        mVideoPreProcessing.enablePreProcessing(true);
        iv.setTag(true);
        iv.setColorFilter(getResources().getColor(R.color.agora_blue), PorterDuff.Mode.MULTIPLY);
    }
}
 
Example 4
Project: OpenVideoCall-Android   File: ChatActivity.java   Source Code and License 7 votes vote down vote up
public void onVoiceMuteClicked(View view) {
    log.info("onVoiceMuteClicked " + view + " " + mUidsList.size() + " video_status: " + mVideoMuted + " audio_status: " + mAudioMuted);
    if (mUidsList.size() == 0) {
        return;
    }

    RtcEngine rtcEngine = rtcEngine();
    rtcEngine.muteLocalAudioStream(mAudioMuted = !mAudioMuted);

    ImageView iv = (ImageView) view;

    if (mAudioMuted) {
        iv.setColorFilter(getResources().getColor(R.color.agora_blue), PorterDuff.Mode.MULTIPLY);
    } else {
        iv.clearColorFilter();
    }
}
 
Example 5
Project: WithYou   File: DetailActivity.java   Source Code and License 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState){
	super.onCreate(savedInstanceState);
	requestWindowFeature(Window.FEATURE_NO_TITLE);
	setContentView(R.layout.detail_layout);
	
	imageDetail = (ImageView)findViewById(R.id.image_detail);
	spot = (TextView)findViewById(R.id.spot_detail);
	time = (TextView)findViewById(R.id.time_detail);
	reward = (TextView)findViewById(R.id.reward_detail);
	username = (TextView)findViewById(R.id.username_detail);
	ps = (TextView)findViewById(R.id.ps_detail);
	
	imageDetail.setBackgroundResource(getIntent().getIntExtra("headId", 0));
	spot.setText(getIntent().getStringExtra("spot"));
	time.setText(getIntent().getStringExtra("time"));
	reward.setText(getIntent().getStringExtra("reward"));
	username.setText(getIntent().getStringExtra("username"));
	ps.setText(getIntent().getStringExtra("ps"));
}
 
Example 6
Project: RoadLab-Pro   File: StartMeasurementFragment.java   Source Code and License 6 votes vote down vote up
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    xyPlot = (XYPlot) view.findViewById(R.id.accelerationGraph);
    badText = (TextView) view.findViewById(R.id.badText);
    normalText = (TextView) view.findViewById(R.id.normalText);
    goodText = (TextView) view.findViewById(R.id.goodText);
    perfectText = (TextView) view.findViewById(R.id.perfectText);
    distanceValueText = (TextView) view.findViewById(R.id.distanceValueText);
    speedText = (TextView) view.findViewById(R.id.speedText);
    speedValueText = (TextView) view.findViewById(R.id.speedValueText);
    bumpValueText = (TextView) view.findViewById(R.id.bumpValueText);
    badQualityText = (TextView) view.findViewById(R.id.badQualityText);
    normalQualityText = (TextView) view.findViewById(R.id.normalQualityText);
    goodQualityText = (TextView) view.findViewById(R.id.goodQualityText);
    perfectQualityText = (TextView) view.findViewById(R.id.perfectQualityText);
    deviceIndicatorAngleBtn = (ImageView) view.findViewById(R.id.wrong_angle_icon);
    gpsIndicatorBtn = (ImageView) view.findViewById(R.id.wrong_gps_icon);
    startMeasurementsBtn = (Button) view.findViewById(R.id.startMeasurementsBtn);
    roadIntervalValue = (TextView) view.findViewById(R.id.roadIntervalValue);
    roadIntervalText = (TextView) view.findViewById(R.id.roadIntervalText);
    recordStatusValue = (TextView) view.findViewById(R.id.recordStatusValue);
    itemsCntValueText = (TextView) view.findViewById(R.id.itemsCntValueText);
    intervalsCntValueText = (TextView) view.findViewById(R.id.intervalsCntValueText);
    initUI();
}
 
Example 7
Project: GitHub   File: MaterialCalendarView.java   Source Code and License 6 votes vote down vote up
private void setupChildren() {
    topbar = new LinearLayout(getContext());
    topbar.setOrientation(LinearLayout.HORIZONTAL);
    topbar.setClipChildren(false);
    topbar.setClipToPadding(false);
    addView(topbar, new LayoutParams(1));

    buttonPast.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    topbar.addView(buttonPast, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1));

    title.setGravity(Gravity.CENTER);
    topbar.addView(title, new LinearLayout.LayoutParams(
            0, LayoutParams.MATCH_PARENT, DEFAULT_DAYS_IN_WEEK - 2
    ));

    buttonFuture.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
    topbar.addView(buttonFuture, new LinearLayout.LayoutParams(0, LayoutParams.MATCH_PARENT, 1));

    pager.setId(R.id.mcv_pager);
    pager.setOffscreenPageLimit(1);
    addView(pager, new LayoutParams(calendarMode.visibleWeeksCount + DAY_NAMES_ROW));
}
 
Example 8
Project: AcopioMX   File: ActivityHome.java   Source Code and License 6 votes vote down vote up
private void showSupportersDialog() {
    final Dialog fullscreenDialog = new Dialog(this, R.style.DialogFullscreen);
    fullscreenDialog.setContentView(R.layout.dialog_supporters);
    Button logoutB = fullscreenDialog.findViewById(R.id.logout_b);
    ImageView img_dialog_fullscreen_close = fullscreenDialog.findViewById(R.id.close_iv);
    TextView collaborationTV = fullscreenDialog.findViewById(R.id.info_collaboration_tv);
    collaborationTV.setText(Html.fromHtml(getString(R.string.collaboration)));
    img_dialog_fullscreen_close.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            fullscreenDialog.dismiss();
        }
    });
    logoutB.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            saveToken(context, "HOME", null);
            Intent intent = new Intent(context, ActivitySplash.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK |
                    Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
            finish();
        }
    });

    fullscreenDialog.show();
}
 
Example 9
Project: cat-is-a-dog   File: FollowingHabitsListAdapter.java   Source Code and License 6 votes vote down vote up
/**
 * Instantiate a child view containing the user you following's habit and their individual completion status
 * @param groupPosition
 * @param childPosition
 * @param isExpanded
 * @param convertView
 * @param parent
 * @return
 */
@Override
public View getChildView(int groupPosition, int childPosition, boolean isExpanded, View convertView, ViewGroup parent) {
    Habit habit = (Habit) getChild(groupPosition, childPosition);

    if(convertView == null) {
        convertView = mInflater.inflate(R.layout.item_following_habit, parent, false);
    }

    TextView titleView = (TextView) convertView.findViewById(R.id.following_habit_title);
    titleView.setText(habit.getTitle());

    ImageView indicatorView = (ImageView) convertView.findViewById(R.id.following_habit_indicator);

    if (habit.getStatus() != null) {
        indicatorView.setColorFilter(habit.getStatus().getColor());
    }

    return convertView;
}
 
Example 10
Project: OSchina_resources_android   File: UserSelectFriendsActivity.java   Source Code and License 6 votes vote down vote up
/**
 * 刷新选中的布局
 */
private void updateSelectView() {
    mSelectContainer.removeAllViews();
    if (mSelectedFriends.size() == 0)
        mHorizontalScrollView.setVisibility(View.GONE);
    else {
        mHorizontalScrollView.setVisibility(View.VISIBLE);
        for (final Author author : mSelectedFriends) {
            ImageView ivIcon = (ImageView) LayoutInflater.from(this)
                    .inflate(R.layout.activity_main_select_friend_label_container_item, mSelectContainer, false);

            ivIcon.setTag(R.id.iv_show_icon, author);
            ivIcon.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Author tag = (Author) v.getTag(R.id.iv_show_icon);
                    onSelectIconClick(tag);
                    mSelectContainer.removeView(v);
                }
            });
            mSelectContainer.addView(ivIcon);
            Glide.with(this).load(author.getPortrait()).error(R.mipmap.widget_default_face).into(ivIcon);
        }
    }
}
 
Example 11
Project: pracler   File: SongListAdapter.java   Source Code and License 6 votes vote down vote up
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_musicrows, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    };

    ImageView album = (ImageView) convertView.findViewById(R.id.view_album);
    album.setImageDrawable(context.getResources().getDrawable(android.R.drawable.ic_menu_report_image));
    TextView title = (TextView) convertView.findViewById(R.id.view_title);
    TextView artist = (TextView) convertView.findViewById(R.id.view_artist);

    title.setText(list.get(position).title);
    artist.setText(list.get(position).artist + " - " + list.get(position).album + " - " + global.mMusicManager.convertToTime(list.get(position).length));

    convertView.setTag(list.get(position).uid);
    MyAsyncTask myAsyncTask = new MyAsyncTask();
    myAsyncTask.setImgView(album);
    myAsyncTask.execute(position + "");

    return convertView;
}
 
Example 12
Project: Watermark   File: PhotoViewAttacher.java   Source Code and License 6 votes vote down vote up
@Override
public void setScale(float scale, float focalX, float focalY,
                     boolean animate) {
    ImageView imageView = getImageView();

    if (null != imageView) {
        // Check to see if the scale is within bounds
        if (scale < mMinScale || scale > mMaxScale) {
            Logger.i("Scale must be within the range of minScale and maxScale");
            return;
        }

        if (animate) {
            imageView.post(new AnimatedZoomRunnable(getScale(), scale,
                    focalX, focalY));
        } else {
            mSuppMatrix.setScale(scale, scale, focalX, focalY);
            checkAndDisplayMatrix();
        }
    }
}
 
Example 13
Project: chat-sdk-android-push-firebase   File: CountryListAdapter.java   Source Code and License 6 votes vote down vote up
/**
 * Return row for each country
 */
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	View cellView = convertView;
	Cell cell;
	Country country = countries.get(position);

	if (convertView == null) {
		cell = new Cell();
		cellView = inflater.inflate(R.layout.row, null);
		cell.textView = (TextView) cellView.findViewById(R.id.row_title);
		cell.imageView = (ImageView) cellView.findViewById(R.id.row_icon);
		cellView.setTag(cell);
	} else {
		cell = (Cell) cellView.getTag();
	}

	cell.textView.setText(country.getName());

	// Load drawable dynamically from country code
	String drawableName = "flag_"
			+ country.getCode().toLowerCase(Locale.ENGLISH);
	cell.imageView.setImageResource(getResId(drawableName));
	return cellView;
}
 
Example 14
Project: MyFire   File: LoadingTip.java   Source Code and License 6 votes vote down vote up
private void initView(Context context) {
    View.inflate(context, R.layout.dialog_loading_tip, this);
    img_tip_logo = (ImageView) findViewById(R.id.img_tip_logo);
    progress = (ProgressBar) findViewById(R.id.progress);
    tv_tips = (TextView) findViewById(R.id.tv_tips);
    bt_operate = (Button) findViewById(R.id.bt_operate);
    //重新尝试
    bt_operate.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            if(onReloadListener!=null){
                onReloadListener.reload();
            }
        }
    });
    setVisibility(View.GONE);
}
 
Example 15
Project: AliZhiBoHao   File: LiveCameraActivity.java   Source Code and License 6 votes vote down vote up
private void initView() {
    mRelativeLayout = (RelativeLayout) findViewById(R.id.rl_main);
    push_state_ll = (LinearLayout) findViewById(R.id.push_state_ll);
    settings = (ImageView) findViewById(R.id.iv_settings);
    settings.setOnClickListener(this);
    wx_user_name = (TextView) findViewById(R.id.wx_user_name_tv);
    wx_user_icon = (CircleImageView) findViewById(R.id.wx_user_icon_iv);
    mCountTimeView = (CountTimeView) findViewById(R.id.count_time_view);
    mRecorderButton = (ImageView) findViewById(R.id.iv_push);
    mRecorderButton.setOnClickListener(this);
    btn_pop_pro = (ImageView) findViewById(R.id.btn_pro);
    btn_pop_pro.setOnClickListener(this);
    btn_pop_talk = (ImageView) findViewById(R.id.btn_talk);
    btn_pop_talk.setOnClickListener(this);
    mTv_watch_person = (TextView) findViewById(R.id.tv_watch_person);
    mRelativeLayout.setOnTouchListener(this);
}
 
Example 16
Project: CXJPadProject   File: PhotoViewAttacher.java   Source Code and License 6 votes vote down vote up
public final ImageView getImageView() {
	ImageView imageView = null;

	if (null != mImageView) {
		imageView = mImageView.get();
	}

	// If we don't have an ImageView, call cleanup()
	if (null == imageView) {
		cleanup();
		throw new IllegalStateException(
				"ImageView no longer exists. You should not use this PhotoViewAttacher any more.");
	}

	return imageView;
}
 
Example 17
Project: CardSlideView   File: MyCardHandler.java   Source Code and License 6 votes vote down vote up
@Override
public View onBind(final Context context, final MyBean data, final int position, @CardViewPager.TransformerMode int mode) {
    View view = View.inflate(context, R.layout.item, null);
    ImageView imageView = (ImageView) view.findViewById(R.id.image);
    ElasticCardView cardView = (ElasticCardView) view.findViewById(R.id.cardview);
    final boolean isCard = mode == CardViewPager.MODE_CARD;
    cardView.setPreventCornerOverlap(isCard);
    cardView.setUseCompatPadding(isCard);
    final String img = data.getImg();
    Glide.with(context).load(img).into(imageView);
    view.setOnClickListener(v -> {
        Toast.makeText(context, "data:" + data + "position:" + position, Toast.LENGTH_SHORT).show();
        TestActivity.start(context, img);
    });
    return view;
}
 
Example 18
Project: SunmiUI   File: BannerLayout.java   Source Code and License 6 votes vote down vote up
@Override
public void setEnabled(boolean enabled) {
    super.setEnabled(enabled);
    for(int i=0;i<getChildCount();i++){
        ImageView child = (ImageView) getChildAt(i);
        child.setEnabled(enabled);
    }
}
 
Example 19
Project: FlickLauncher   File: PageIndicatorLineCaret.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mAllAppsHandle = (ImageView) findViewById(R.id.all_apps_handle);
    mAllAppsHandle.setImageDrawable(getCaretDrawable());
    mAllAppsHandle.setOnTouchListener(mLauncher.getHapticFeedbackTouchListener());
    mAllAppsHandle.setOnClickListener(mLauncher);
    mAllAppsHandle.setOnLongClickListener(mLauncher);
    mAllAppsHandle.setOnFocusChangeListener(mLauncher.mFocusHandler);
    mLauncher.setAllAppsButton(mAllAppsHandle);
}
 
Example 20
Project: DailyStudy   File: CoustomBehavier.java   Source Code and License 6 votes vote down vote up
private void initView(View parent) {
    textView = (ImageView) parent.findViewById(R.id.textView);
    textView1 = (ImageView) parent.findViewById(R.id.textView1);
    title = (ImageView) parent.findViewById(R.id.title);
    title1 = (ImageView) parent.findViewById(R.id.title1);
    bifen1 = (TextView) parent.findViewById(R.id.bifen1);
    bifen2 = (TextView) parent.findViewById(R.id.bifen2);
    bifen3 = (TextView) parent.findViewById(R.id.bifen3);
    bifen = (TextView) parent.findViewById(R.id.bifen);
    zhudui = (FrameLayout) parent.findViewById(R.id.zhudui);
    kedui = (FrameLayout) parent.findViewById(R.id.kedui);
    bifenlayout = (FrameLayout) parent.findViewById(R.id.bifenlayout);
    bifen1layout = (RelativeLayout) parent.findViewById(R.id.bifen1layout);
    toolbarTitle = (RelativeLayout) parent.findViewById(R.id.toolbar_title);
    text_zhudui = (TextView) parent.findViewById(R.id.text_zhudui);
}
 
Example 21
Project: RantApp   File: ProfileActivity.java   Source Code and License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profile);
    userId = getIntent().getIntExtra(EXTRA_USER_ID,0);
    mToolbar = (Toolbar) findViewById(R.id.activity_profile_toolbar);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    mToolbar.setNavigationIcon(R.drawable.ic_action_back);

    mAvatarImageView = (ImageView) findViewById(R.id.activity_profile_avatar);
    mNameTextView = (TextView) findViewById(R.id.activity_profile_name);
    mBioTextView = (TextView) findViewById(R.id.activity_profile_bio);
    mValueTextView = (TextView) findViewById(R.id.activity_profile_value);
    mLocationTextView = (TextView) findViewById(R.id.activity_profile_location);
    mEditCardView = (CardView) findViewById(R.id.activity_profile_cv_edit);
    mEditButton = (Button) findViewById(R.id.activity_profile_button_edit);
    mRecyclerView = (RecyclerView) findViewById(R.id.activity_profile_recycler_view);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setAdapter(new NewAdapter(new ArrayList<RantItem>()));


    getData();

}
 
Example 22
Project: Cable-Android   File: AlertView.java   Source Code and License 6 votes vote down vote up
private void initialize(AttributeSet attrs) {
  inflate(getContext(), R.layout.alert_view, this);

  approvalIndicator = (ImageView) findViewById(R.id.pending_approval_indicator);
  failedIndicator   = (ImageView) findViewById(R.id.sms_failed_indicator);

  if (attrs != null) {
    TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.AlertView, 0, 0);
    boolean useSmallIcon = typedArray.getBoolean(R.styleable.AlertView_useSmallIcon, false);
    typedArray.recycle();

    if (useSmallIcon) {
      failedIndicator.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_error_red_18dp));
    }
  }
}
 
Example 23
Project: qmui   File: QMUIDialogMenuItemView.java   Source Code and License 6 votes vote down vote up
public CheckItemView(Context context, boolean right) {
	super(context);
	mContext = context;
	mCheckedView = new ImageView(mContext);
	mCheckedView.setImageDrawable(QMUIResHelper.getAttrDrawable(context, R.attr.qmui_s_checkbox));
	mCheckedView.setId(QMUIViewHelper.generateViewId());
	LayoutParams checkLp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
	checkLp.addRule(CENTER_VERTICAL, TRUE);
	if(right){
		checkLp.addRule(ALIGN_PARENT_RIGHT, TRUE);
		checkLp.leftMargin = QMUIResHelper.getAttrDimen(mContext, R.attr.qmui_dialog_menu_item_check_icon_margin_horizontal);
	}else{
		checkLp.addRule(ALIGN_PARENT_LEFT, TRUE);
		checkLp.rightMargin =QMUIResHelper.getAttrDimen(mContext, R.attr.qmui_dialog_menu_item_check_icon_margin_horizontal);
	}

	addView(mCheckedView,checkLp);

	mTextView = createItemTextView(mContext);
	LayoutParams tvLp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
	if(right){
		tvLp.addRule(LEFT_OF, mCheckedView.getId());
	}else{
		tvLp.addRule(RIGHT_OF, mCheckedView.getId());
	}

	addView(mTextView,tvLp);
}
 
Example 24
Project: TPlayer   File: PendIntentCompat.java   Source Code and License 6 votes vote down vote up
private void setIntentByViewGroup(RemoteViews remoteViews, ViewGroup viewGroup, List<RectInfo> list) {
        int count = viewGroup.getChildCount();
        Rect p = new Rect();
        viewGroup.getHitRect(p);
        for (int i = 0; i < count; i++) {
            View v = viewGroup.getChildAt(i);
            if (v instanceof ViewGroup) {
                // linearlayout
                setIntentByViewGroup(remoteViews, (ViewGroup) v, list);
            } else if (v instanceof TextView || v instanceof ImageView) {
                // textview
                Rect rect = getRect(v);
                RectInfo next = findIntent(rect, list);
                if (next != null) {
//					VLog.d(TAG, next.rect+":setPendIntent:"+i);
//                    remoteViews.setImageViewBitmap(v.getId(), next.testBg);
                    remoteViews.setOnClickPendingIntent(v.getId(), next.mPendingIntent);
                }
            }
        }
    }
 
Example 25
Project: newIPlay   File: TopicFragment.java   Source Code and License 6 votes vote down vote up
private void setHeaderViewData() {
    ImageLoader.loadImage(getActivity(), mTopicBean.getNewIcon(), (ImageView) mHeaderView.findViewById(R.id.game_header_iv));
    ImageLoader.loadImage(getActivity(), mTopicBean.getNewIconBgImg(), (ImageView) mHeaderView.findViewById(R.id.game_header_bg_iv));

    ((TextView) mHeaderView.findViewById(R.id.game_header_title_tv)).setText(mTopicBean.getTopicName());
    ((TextView) mHeaderView.findViewById(R.id.game_header_des_tv)).setText(mTopicBean.getTopicDescription());
    ((TextView) mHeaderView.findViewById(R.id.game_header_fouce_num_tv)).setText(mTopicBean.getFollowUserCount() + " 人关注");

    mHeaderFocuseIv.setBackgroundResource(R.drawable.border_red);

    mHeaderFocuseIv.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mPresenter.changeFocuseState();
        }
    });
}
 
Example 26
Project: ViewPagerZoomTransformer   File: WatchDetailInfoActivity.java   Source Code and License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.watch_detail_info_layout);
    mPosition = getIntent().getIntExtra("position", 0);

    Toolbar toolbar = (Toolbar) findViewById(R.id.infoToolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    mTitleImage = (ImageView)findViewById(R.id.infoTitleImage);
    mIntroImage_1 = (ImageView)findViewById(R.id.imageIntro_1);
    mIntroImage_2 = (ImageView)findViewById(R.id.imageIntro_2);
    mIntroImage_3 = (ImageView)findViewById(R.id.imageIntro_3);

    setImagesRes(mTitleImage, mIntroImage_1, mIntroImage_2, mIntroImage_3);
}
 
Example 27
Project: Cable-Android   File: ThumbnailView.java   Source Code and License 6 votes vote down vote up
public ThumbnailView(final Context context, AttributeSet attrs, int defStyle) {
  super(context, attrs, defStyle);

  inflate(context, R.layout.thumbnail_view, this);

  this.radius      = getResources().getDimensionPixelSize(R.dimen.message_bubble_corner_radius);
  this.image       = (ImageView) findViewById(R.id.thumbnail_image);
  this.playOverlay = (ImageView) findViewById(R.id.play_overlay);
  super.setOnClickListener(new ThumbnailClickDispatcher());

  if (attrs != null) {
    TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.ThumbnailView, 0, 0);
    backgroundColorHint = typedArray.getColor(R.styleable.ThumbnailView_backgroundColorHint, Color.BLACK);
    typedArray.recycle();
  }
}
 
Example 28
Project: GitHub   File: PhotoViewAttacher.java   Source Code and License 6 votes vote down vote up
public final void update() {
	ImageView imageView = getImageView();

	if (null != imageView) {
		if (mZoomEnabled) {
			// Make sure we using MATRIX Scale Type
			setImageViewScaleTypeMatrix(imageView);

			// Update the base matrix using the current drawable
			updateBaseMatrix(imageView.getDrawable());
		} else {
			// Reset the Matrix...
			resetMatrix();
		}
	}
}
 
Example 29
Project: Tiny   File: BatchFileCompressTestActivity.java   Source Code and License 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_batch_file_compress_test);

    mOriginImg1 = (ImageView) findViewById(R.id.img_origin1);
    mOriginImg2 = (ImageView) findViewById(R.id.img_origin2);
    mOriginImg3 = (ImageView) findViewById(R.id.img_origin3);
    mOriginImg4 = (ImageView) findViewById(R.id.img_origin4);
    mCompressImg1 = (ImageView) findViewById(R.id.img_compress1);
    mCompressImg2 = (ImageView) findViewById(R.id.img_compress2);
    mCompressImg3 = (ImageView) findViewById(R.id.img_compress3);
    mCompressImg4 = (ImageView) findViewById(R.id.img_compress4);

    mOriginTv = (TextView) findViewById(R.id.tv_origin);
    mCompressTv = (TextView) findViewById(R.id.tv_compress);
}
 
Example 30
Project: CustomAndroidOneSheeld   File: PinsColumnContainer.java   Source Code and License 5 votes vote down vote up
public void setup(OnChildFocusListener focusListener, ImageView cursor,
                  ControllerParent<?> controller, onGetPinsView onGetPinsListener) {
    this.focusListener = focusListener;
    this.cursor = cursor;
    this.controller = controller;
    this.onGetPinsListener = onGetPinsListener;
    currentIndex = -1;
    currentTag = null;
    isOnglobalCalled = false;
    childrenRects = new ArrayList<PinData>();
    getViewTreeObserver().addOnGlobalLayoutListener(
            new OnGlobalLayoutListener() {

                @Override
                public void onGlobalLayout() {
                    if (!isOnglobalCalled
                            && (childrenRects == null || childrenRects
                            .size() == 0)) {
                        childrenRects = new ArrayList<PinsColumnContainer.PinData>();
                        loadRects(PinsColumnContainer.this);
                        PinsColumnContainer.this.onGetPinsListener
                                .onPinsDrawn();
                        isOnglobalCalled = true;
                    }
                }
            });
}
 
Example 31
Project: hands-on-api-proxy   File: PhotoGalleryAdapter.java   Source Code and License 5 votes vote down vote up
public PhotoHolder(View v, App app) {
    super(v);

    mApp = app;

    mItemImage = (ImageView) v.findViewById(R.id.item_image);
    v.setOnClickListener(this);
}
 
Example 32
Project: RLibrary   File: ImageAdapter.java   Source Code and License 5 votes vote down vote up
@Override
public Object instantiateItem(ViewGroup container, final int position) {
    RelativeLayout layout = new RelativeLayout(container.getContext());
    ImageView imageView = new ImageView(container.getContext());
    imageView.setScaleType(ImageView.ScaleType.FIT_XY);
    layout.addView(imageView, new ViewGroup.LayoutParams(-1, -1));
    initImageView(layout, imageView, position);
    container.addView(layout, new ViewGroup.LayoutParams(width, height));
    return layout;
}
 
Example 33
Project: GCSApp   File: Rv_MyProjectAdapter.java   Source Code and License 5 votes vote down vote up
public AnchorHotViewHolder(final View itemView) {
    super(itemView);
    pic = (ImageView) itemView.findViewById(R.id.img_layout_project_sorting_item_pic);
    tvName = (TextView) itemView.findViewById(R.id.tv_item_project_list_name);
    tvRound = (TextView) itemView.findViewById(R.id.tv_item_project_list_round);
    tvStatus = (TextView) itemView.findViewById(R.id.tv_status);
    tvCity = (TextView) itemView.findViewById(R.id.tv_item_project_list_city);
    tvRemark = (TextView) itemView.findViewById(R.id.tv_item_project_list_remark);
    tvCommentCount = (TextView) itemView.findViewById(R.id.tv_project_sorting_comments);
    tv_project_sorting_collection = (TextView) itemView.findViewById(R.id.tv_project_sorting_collection);
}
 
Example 34
Project: XERUNG   File: ButtonFloat.java   Source Code and License 5 votes vote down vote up
@Override
protected void onInitDefaultValues() {
	super.onInitDefaultValues();
	icon = new ImageView(getContext());
	iconSize = 24;
	sizeRadius = 28;
	rippleSpeed = 3;
	rippleSize = 5;
	minWidth = sizeRadius * 2;// 56dp
	minHeight = sizeRadius * 2;// 56dp
	backgroundResId = R.drawable.background_button_float;
}
 
Example 35
Project: TripBuyer   File: ContactItemHolder.java   Source Code and License 5 votes vote down vote up
public void initView() {
  nameView = (TextView)itemView.findViewById(R.id.tv_friend_name);
  avatarView = (ImageView)itemView.findViewById(R.id.img_friend_avatar);

  itemView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      Intent intent = new Intent(getContext(), LCIMConversationActivity.class);
      intent.putExtra(LCIMConstants.PEER_ID, lcChatKitUser.getUserId());
      getContext().startActivity(intent);
    }
  });
}
 
Example 36
Project: android-project-gallery   File: StorageManagerActivity.java   Source Code and License 5 votes vote down vote up
@Override
public void realOnBindViewHolder(RecyclerViewHolder holder, int position)
{
	ImageView image = holder.findViewById(R.id.image);
	TextView nameTV = holder.findViewById(R.id.name);
	TextView descTV = holder.findViewById(R.id.desc);
	TextView picnumTV = holder.findViewById(R.id.picnum);
	
	FileInfo info = realGetItem(position);
	
	nameTV.setText(info.getName());
	descTV.setText(getString(R.string.size_1, info.getDisplaySize()));
	picnumTV.setText(getString(R.string.file_count_1, info.getFileCount()));
}
 
Example 37
Project: CustomAndroidOneSheeld   File: MusicPlayerFragment.java   Source Code and License 5 votes vote down vote up
@Override
public void doOnViewCreated(View v, @Nullable Bundle savedInstanceState) {
    musicFileName = (TextView) v.findViewById(R.id.playingMusic);
    seekBar = (SeekBar) v.findViewById(R.id.seekBar);
    playingBtn = (ImageView) v.findViewById(R.id.playingBtn);
    playingStatus = (TextView) v.findViewById(R.id.playingStatus);
    hasSettings = true;
}
 
Example 38
Project: CXJPadProject   File: DishesView.java   Source Code and License 5 votes vote down vote up
private View getAddView() {

		mAddImageView=new ImageView(this.getContext());
		LayoutParams param=getLayoutParams((getMeasuredWidth()-20)/4,getMeasuredHeight());
		param.weight=1;
		param.gravity= Gravity.CENTER;
		mAddImageView.setLayoutParams(param);
		mDeleteImageView.setScaleType(ImageView.ScaleType.CENTER);

		setBackgroundDrawable(mAddImageView, addDrawable);
		return mAddImageView;
	}
 
Example 39
Project: BaseCore   File: ImageViewBindingAdapter.java   Source Code and License 5 votes vote down vote up
@BindingAdapter(value = {"imageUrl", "placeHolder", "error"}, requireAll = false)
/**
 * 不支持mipmap下的图片
 */
public static void loadImage(ImageView imageView, String url, Drawable holderDrawable, Drawable errorDrawable) {

    Glide.with(imageView.getContext())
            .load(url)
            .apply(GlideRequestOption.getRequestOptions().placeholder(holderDrawable)
                    .error(errorDrawable))
            .into(imageView);
}
 
Example 40
Project: ultrasonic   File: SubsonicTabActivity.java   Source Code and License 5 votes vote down vote up
public void setImageDrawableOnUiThread(final ImageView view, final Drawable drawable)
{
	this.runOnUiThread(new Runnable()
	{
		@Override
		public void run()
		{
			if (view != null && view.getVisibility() != View.GONE)
			{
				view.setImageDrawable(drawable);
			}
		}
	});
}
 
Example 41
Project: Hyke   File: DistressFragment.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    FirebaseAuth auth = FirebaseAuth.getInstance();
    final String uid = auth.getCurrentUser().getUid();
    final DatabaseReference ref = database.getReference("users").child(uid).child("distress");
    ref.setValue(dist);
    final View rootView = inflater.inflate(R.layout.fragment_distress, null, false);

    final TextView tvDistress = (TextView) rootView.findViewById(R.id.tvDistress);
    ImageView ivDistressSignal = (ImageView) rootView.findViewById(R.id.ivDistressSignal);
    ivDistressSignal.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if(dist) {
                ref.setValue(false);
                dist = false;
                tvDistress.setText("All Clear");
            }
            else {
                ref.setValue(true);
                dist = true;
                tvDistress.setText("Group Notified");
            }
        }
    });
    return rootView;
}
 
Example 42
Project: boohee_v5.6   File: PostPicturePreviewAdapter.java   Source Code and License 5 votes vote down vote up
private void loadImage(ImageView imageView, Uri imageUri) {
    if (imageUri != null && imageView != null && imageView.getTag() != imageUri) {
        imageView.setTag(imageUri);
        this.mImageLoader.displayImage(Uri.decode(imageUri.toString()), imageView, this.mDisplayOptions);
    }
}
 
Example 43
Project: YCStateLayout   File: RootFrameLayout.java   Source Code and License 5 votes vote down vote up
private void emptyDataViewAddData(int iconImage, String textTip) {
    if (iconImage == 0 && TextUtils.isEmpty(textTip)) return;
    View emptyDataView = layoutSparseArray.get(LAYOUT_EMPTYDATA_ID);
    View iconImageView = emptyDataView.findViewById(mStatusLayoutManager.emptyDataIconImageId);
    View textView = emptyDataView.findViewById(mStatusLayoutManager.emptyDataTextTipId);
    if (iconImageView != null && iconImageView instanceof ImageView) {
        ((ImageView) iconImageView).setImageResource(iconImage);
    }

    if (textView != null && textView instanceof TextView) {
        ((TextView) textView).setText(textTip);
    }
}
 
Example 44
Project: JavaIsFun   File: Classe4.java   Source Code and License 5 votes vote down vote up
public void verificar(View view) {
    ImageView imageViewtop = (ImageView) findViewById(R.id.corretoerrado);

    TextView erradoabelha = (TextView) findViewById(R.id.erradoAbelha);
    TextView erradocachorro = (TextView) findViewById(R.id.erradoCachorro);
    TextView erradogato = (TextView) findViewById(R.id.erradoGato);
    TextView textocorreto = (TextView) findViewById(R.id.textCorreto);
    ImageView classpeixe = (ImageView) findViewById(R.id.classpeixe);
    ImageView classcachorro = (ImageView) findViewById(R.id.classcachorro);
    ImageView classgato = (ImageView) findViewById(R.id.classgato);
    ImageView classabelha = (ImageView) findViewById(R.id.classabelha);
    if (classpeixe.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.VISIBLE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.classpeixe).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.happy);
        imageViewtop.setVisibility(View.VISIBLE);
    } else if (classcachorro.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.VISIBLE);
        findViewById(R.id.classcachorro).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.sad);
        imageViewtop.setVisibility(View.VISIBLE);
    } else if (classgato.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.GONE);
        findViewById(R.id.erradoGato).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.classgato).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.sad);
        imageViewtop.setVisibility(View.VISIBLE);
    } else if (classabelha.getVisibility() == View.VISIBLE) {
        findViewById(R.id.textCorreto).setVisibility(View.GONE);
        findViewById(R.id.imageButton63).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoAbelha).setVisibility(View.VISIBLE);
        findViewById(R.id.erradoGato).setVisibility(View.GONE);
        findViewById(R.id.erradoCachorro).setVisibility(View.GONE);
        findViewById(R.id.classabelha).setVisibility(View.GONE);
        imageViewtop.setImageResource(R.drawable.sad);
        imageViewtop.setVisibility(View.VISIBLE);
    }
}
 
Example 45
Project: ListItemView   File: ViewUtils.java   Source Code and License 5 votes vote down vote up
public static void setIconColor(ImageView iconHolder, int color) {
    Drawable wrappedDrawable = DrawableCompat.wrap(iconHolder.getDrawable());
    DrawableCompat.setTint(wrappedDrawable, color);
    iconHolder.setImageDrawable(wrappedDrawable);
    iconHolder.invalidate();
}
 
Example 46
Project: VirtualAPKDemo   File: ImageBrowserActivity.java   Source Code and License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_image_browser);

    ImageView homeIcon1 = (ImageView) findViewById(R.id.iv_home_icon1);
    ImageView homeIcon2 = (ImageView) findViewById(R.id.iv_home_icon2);
    ImageView homeIcon3 = (ImageView) findViewById(R.id.iv_home_icon3);

    Picasso.with(this).load(IMG1_URL).into(homeIcon1);
    Picasso.with(this).load(IMG2_URL).into(homeIcon2);
    Picasso.with(this).load(IMG3_URL).into(homeIcon3);
}
 
Example 47
Project: AndroidArchTodo   File: TodoViewHolder.java   Source Code and License 5 votes vote down vote up
public TodoViewHolder(View itemView) {
    super(itemView);

    todoRelativeLayout=(RelativeLayout) itemView.findViewById(R.id.todo_relative_layout);
    todoTextView=(TextView)itemView.findViewById(R.id.todo_text_view);
    checkImageView=(ImageView) itemView.findViewById(R.id.check_image_view);
}
 
Example 48
Project: ImageLoaderSupportGif   File: ImageViewAware.java   Source Code and License 5 votes vote down vote up
@Override
protected void setImageDrawableInto(Drawable drawable, View view) {
	((ImageView) view).setImageDrawable(drawable);
	if (drawable instanceof AnimationDrawable) {
		((AnimationDrawable)drawable).start();
	}
}
 
Example 49
Project: letv   File: QrCodeShareActivity.java   Source Code and License 5 votes vote down vote up
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_qrcode_gen);
    this.mIvTitleLeft = (ImageView) findViewById(R.id.common_nav_left);
    this.mIvQrCodeArea = (ImageView) findViewById(R.id.qrcode_gen_area);
    this.mBtnShare = (Button) findViewById(R.id.btn_share);
    this.mBtnRefresh = (Button) findViewById(R.id.btn_refresh);
    this.mTitleTextView = (TextView) findViewById(R.id.common_nav_title);
    this.mTitleTextView.setText(SharedPreferencesUtil.readData(SharedPreferencesUtil.LEBOX_NAME_KEY, ""));
    this.mIvTitleLeft.setOnClickListener(this);
    this.mBtnShare.setOnClickListener(this);
    this.mBtnRefresh.setOnClickListener(this);
    createQrCode();
}
 
Example 50
Project: letv   File: LeboxBuyHtmlActivity.java   Source Code and License 5 votes vote down vote up
@SuppressLint({"SetJavaScriptEnabled"})
private void initView() {
    this.mBackImage = (ImageView) findViewById(R.id.common_nav_left);
    this.mBackImage.setOnClickListener(this);
    this.mTitleTextView = (TextView) findViewById(R.id.common_nav_title);
    this.mTitleTextView.setText(R.string.btn_text_buy_box);
    this.mWebView = (WebView) findViewById(R.id.web_view);
    this.mWebView.getSettings().setJavaScriptEnabled(true);
    String url = "http://m.lemall.com/products/view/pid-GWGZ300051.html";
    Logger.d(TAG, url);
    this.mWebView.loadUrl(url);
    this.mWebView.setWebViewClient(new HelloWebViewClient());
}
 
Example 51
Project: mobile-app-dev-book   File: JournalAdapter.java   Source Code and License 5 votes vote down vote up
public ViewHolder(View view) {
    super(view);
    mView = view;
    mBackImage = (ImageView) view.findViewById(R.id.imageView2);
    mIdView = (TextView) view.findViewById(R.id.name);
    mContentView = (TextView) view.findViewById(R.id.location);
}
 
Example 52
Project: Guanajoven   File: RegionFragment.java   Source Code and License 5 votes vote down vote up
@Override
public void onResume() {
    super.onResume();
    ImageView imagen = (ImageView)cToolbar.findViewById(R.id.image);

    getActivity().findViewById(R.id.toolbar).setVisibility(View.GONE);
    cToolbar.setVisibility(View.VISIBLE);
    activity.setSupportActionBar(toolbar);
    activity.getSupportActionBar().setHomeButtonEnabled(true);
    activity.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    activity.getSupportActionBar().setTitle("Regiones");
    cToolbar.setTitle("Regiones");
    imagen.setImageResource(R.drawable.registro_usuario);

}
 
Example 53
Project: Huochexing12306   File: FaceAdapter.java   Source Code and License 5 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	ViewHolder viewHolder;
	if(convertView == null){
		viewHolder = new ViewHolder();
		convertView = inflater.inflate(R.layout.face, null, false);
		viewHolder.faceIV = (ImageView) convertView.findViewById(R.id.face_iv);
		convertView.setTag(viewHolder);
	}else{
		viewHolder = (ViewHolder) convertView.getTag();
	}
	viewHolder.faceIV.setImageResource(faceList.get(position));
	return convertView;
}
 
Example 54
Project: Camera-Roll-Android-App   File: VirtualAlbum.java   Source Code and License 5 votes vote down vote up
VirtualAlbumHolder(View itemView, OnVirtualAlbumSelectedCallback callback) {
    super(itemView);
    this.callback = callback;

    Context context = itemView.getContext();
    Theme theme = Settings.getInstance(context).getThemeInstance(context);
    int accentColor = theme.getAccentColor(context);

    textView = itemView.findViewById(R.id.text);
    textView.setTextColor(accentColor);
    ImageView folderIndicator = itemView.findViewById(R.id.folder_indicator);
    folderIndicator.setColorFilter(accentColor, PorterDuff.Mode.SRC_IN);

    itemView.findViewById(R.id.delete_button).setVisibility(View.GONE);
}
 
Example 55
Project: phonk   File: FileManagerListItem.java   Source Code and License 5 votes vote down vote up
public FileManagerListItem(Context context) {
    super(context);
    this.c = context;
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    this.v = new WeakReference<View>(inflater.inflate(R.layout.filemanager_file_view, this, true));

    mImageView = (ImageView) v.get().findViewById(R.id.img_file);
    mTextView = (TextView) v.get().findViewById(R.id.txt_file_name);
}
 
Example 56
Project: Pluto-Android   File: FinalBitmap.java   Source Code and License 5 votes vote down vote up
/**
 * 获取线程匹配的imageView,防止出现闪动的现象
 * 
 * @return
 */
private ImageView getAttachedImageView() {
	final ImageView imageView = imageViewReference.get();
	final BitmapLoadAndDisplayTask bitmapWorkerTask = getBitmapTaskFromImageView(imageView);

	if (this == bitmapWorkerTask) {
		return imageView;
	}

	return null;
}
 
Example 57
Project: Expert-Android-Programming   File: ProfileReviewAdapter.java   Source Code and License 5 votes vote down vote up
public ViewHolder(View itemView) {
    super(itemView);

    place_image = (ImageView) itemView.findViewById(R.id.place_image);
    place_name = (TextView) itemView.findViewById(R.id.place_name);
    place_location = (TextView) itemView.findViewById(R.id.place_location);

    //TIMING
    timing_lay = (LinearLayout) itemView.findViewById(R.id.timing_lay);
    rating_view = (LinearLayout) itemView.findViewById(R.id.rating_view);
    created_time = (TextView) itemView.findViewById(R.id.created_time);
    dineline_rating = (TextView) itemView.findViewById(R.id.dineline_rating);

    //FOR REVIEW
    review_lay = (LinearLayout) itemView.findViewById(R.id.review_lay);
    review_details = (TextView) itemView.findViewById(R.id.review_details);
    review_image_lay = (LinearLayout) itemView.findViewById(R.id.review_image_lay);
    image1_holder = (CardView) itemView.findViewById(R.id.image1_holder);
    image2_holder = (CardView) itemView.findViewById(R.id.image2_holder);
    image3_holder = (CardView) itemView.findViewById(R.id.image3_holder);
    image4_holder = (CardView) itemView.findViewById(R.id.image4_holder);
    image5_holder = (CardView) itemView.findViewById(R.id.image5_holder);
    image1 = (ImageView) itemView.findViewById(R.id.image1);
    image2 = (ImageView) itemView.findViewById(R.id.image2);
    image3 = (ImageView) itemView.findViewById(R.id.image3);
    image4 = (ImageView) itemView.findViewById(R.id.image4);
    image5 = (ImageView) itemView.findViewById(R.id.image5);

    //FOR OPTIONS
    options_lay = (LinearLayout) itemView.findViewById(R.id.options_lay);


    myFont.setAppFont((ViewGroup) itemView, MyFont.FONT_REGULAR);
    //myFont.setFont(name, MyFont.FONT_BOLD);

}
 
Example 58
Project: YCGallery   File: DefaultImageLoader.java   Source Code and License 5 votes vote down vote up
@Override
public void loadThumbnail(Context context, ImageView thumbnailView, SuccessCallback callback) {
    loadBitmap(context);
    thumbnailView.setImageBitmap(mBitmap);
    if (callback != null) {
        callback.onSuccess();
    }
}
 
Example 59
Project: decoy   File: EffectAndFilterItemView.java   Source Code and License 5 votes vote down vote up
private void init(Context context) {
    LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    setLayoutParams(params);
    View viewRoot = LayoutInflater.from(context).inflate(R.layout.effect_and_filter_item_view, this, true);
    mItemIcon = (ImageView) viewRoot.findViewById(R.id.item_icon);
    mItemText = (TextView) viewRoot.findViewById(R.id.item_text);
    if (mItemType == EffectAndFilterSelectAdapter.VIEW_TYPE_FILTER) {
        mItemText.setVisibility(VISIBLE);
    }
}
 
Example 60
Project: Widgets   File: PreImgActivity.java   Source Code and License 5 votes vote down vote up
/**
 * 在绘制前执行动画
 *
 * @return 如果返回false的话,刚开始出现的那一帧画面会被跳过,但是我们需要显示这第一帧,所以要返回true
 */
@Override
public boolean onPreDraw() {
    if (isAnimating) {
        return false;
    }
    rlRoot.getViewTreeObserver().removeOnPreDrawListener(this);
    final View view = mAdapter.getPrimaryItem();
    final ImageView ivImg = mAdapter.getPrimaryImgView();
    calculateIvSize(ivImg);

    final float vx = mCfg.getIvWidth() * 1.0f / mImgWidth;
    final float vy = mCfg.getIvHeight() * 1.0f / mImgHeight;

    ValueAnimator animator = ValueAnimator.ofFloat(0f, 1.0f);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            long duration = animation.getDuration();
            long playTime = animation.getCurrentPlayTime();
            float fraction = duration > 0 ? (float) playTime / duration : 1f;
            if (fraction > 1) fraction = 1;
            view.setTranslationX(evaluateFloat(fraction, mCfg.getIvX() + mCfg.getIvWidth() / 2 - ivImg.getWidth() / 2, 0));
            view.setTranslationY(evaluateFloat(fraction, mCfg.getIvY() + mCfg.getIvHeight() / 2 - ivImg.getHeight() / 2, 0));

            view.setScaleX(evaluateFloat(fraction, vx, 1));
            view.setScaleY(evaluateFloat(fraction, vy, 1));

            view.setAlpha(evaluateFloat(fraction, 0f, 1.0f));

            rlRoot.setBackgroundColor(evaluateArgb(fraction, Color.TRANSPARENT, Color.BLACK));
        }
    });
    addIntoListener(animator);
    animator.setDuration(ANIMATE_DURATION);
    animator.start();

    //返回true,表示第一帧就开始绘制,否则会被跳过
    return true;
}