use of org.edx.mobile.util.images.TopAnchorFillWidthTransformation in project edx-app-android by openedx.
the class CourseOutlineAdapter method getCardView.
public View getCardView(View view) {
final MaterialTextView courseTextName = view.findViewById(R.id.course_detail_name);
final MaterialTextView courseTextDetails = view.findViewById(R.id.course_detail_extras);
final AppCompatImageView headerImageView = view.findViewById(R.id.header_image_view);
final View upgradeBtn = view.findViewById(R.id.layout_upgrade_btn);
final MaterialButton upgradeBtnText = upgradeBtn.findViewById(R.id.btn_upgrade);
((ShimmerFrameLayout) upgradeBtn).hideShimmer();
upgradeBtn.setVisibility(courseData.getMode().equalsIgnoreCase(EnrollmentMode.AUDIT.toString()) ? View.VISIBLE : View.GONE);
upgradeBtnText.setOnClickListener(view1 -> CourseModalDialogFragment.newInstance(environment.getConfig().getPlatformName(), courseData.getCourseId(), courseData.getCourse().getName(), courseData.getCourse().getPrice(), courseData.getCourse().isSelfPaced()).show(((AppCompatActivity) context).getSupportFragmentManager(), CourseModalDialogFragment.TAG));
upgradeBtnText.setText(R.string.value_prop_course_card_message);
// Full course name should appear on the course's dashboard screen.
courseTextName.setEllipsize(null);
courseTextName.setSingleLine(false);
final String headerImageUrl = courseData.getCourse().getCourse_image(environment.getConfig().getApiHostURL());
Glide.with(context).load(headerImageUrl).placeholder(R.drawable.placeholder_course_card_image).transform(new TopAnchorFillWidthTransformation()).into(headerImageView);
courseTextName.setText(courseData.getCourse().getName());
courseTextDetails.setText(CourseCardUtils.getFormattedDate(context, courseData));
return view;
}
use of org.edx.mobile.util.images.TopAnchorFillWidthTransformation in project edx-app-android by edx.
the class CourseDashboardFragment method onActivityCreated.
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (courseData == null || !isCoursewareAccessible)
return;
final String headerImageUrl = courseData.getCourse().getCourse_image(environment.getConfig().getApiHostURL());
Glide.with(CourseDashboardFragment.this).load(headerImageUrl).placeholder(R.drawable.placeholder_course_card_image).transform(new TopAnchorFillWidthTransformation(getActivity())).into(headerImageView);
courseTextName.setText(courseData.getCourse().getName());
CourseEntry course = courseData.getCourse();
courseTextDetails.setText(course.getDescriptionWithStartDate(getActivity()));
if (environment.getConfig().isCourseSharingEnabled()) {
shareButton.setVisibility(headerImageView.VISIBLE);
shareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openShareMenu();
}
});
}
}
use of org.edx.mobile.util.images.TopAnchorFillWidthTransformation in project edx-app-android by edx.
the class NewCourseOutlineAdapter method getCardView.
public View getCardView(View view) {
final TextView courseTextName = (TextView) view.findViewById(R.id.course_detail_name);
final TextView courseTextDetails = (TextView) view.findViewById(R.id.course_detail_extras);
final ImageView headerImageView = (ImageView) view.findViewById(R.id.header_image_view);
// Full course name should appear on the course's dashboard screen.
courseTextName.setEllipsize(null);
courseTextName.setSingleLine(false);
final String headerImageUrl = courseData.getCourse().getCourse_image(environment.getConfig().getApiHostURL());
Glide.with(context).load(headerImageUrl).placeholder(R.drawable.placeholder_course_card_image).transform(new TopAnchorFillWidthTransformation(context)).into(headerImageView);
courseTextName.setText(courseData.getCourse().getName());
courseTextDetails.setText(CourseCardUtils.getFormattedDate(context, courseData.getCourse()));
return view;
}
use of org.edx.mobile.util.images.TopAnchorFillWidthTransformation in project edx-app-android by edx.
the class CourseOutlineAdapter method getCardView.
public View getCardView(View view) {
final MaterialTextView courseTextName = view.findViewById(R.id.course_detail_name);
final MaterialTextView courseTextDetails = view.findViewById(R.id.course_detail_extras);
final AppCompatImageView headerImageView = view.findViewById(R.id.header_image_view);
final View upgradeBtn = view.findViewById(R.id.layout_upgrade_btn);
final MaterialButton upgradeBtnText = upgradeBtn.findViewById(R.id.btn_upgrade);
((ShimmerFrameLayout) upgradeBtn).hideShimmer();
upgradeBtn.setVisibility(courseData.getMode().equalsIgnoreCase(EnrollmentMode.AUDIT.toString()) ? View.VISIBLE : View.GONE);
upgradeBtnText.setOnClickListener(view1 -> CourseModalDialogFragment.newInstance(environment.getConfig().getPlatformName(), courseData.getCourseId(), courseData.getCourse().getName(), courseData.getCourse().getPrice(), courseData.getCourse().isSelfPaced()).show(((AppCompatActivity) context).getSupportFragmentManager(), CourseModalDialogFragment.TAG));
upgradeBtnText.setText(R.string.value_prop_course_card_message);
// Full course name should appear on the course's dashboard screen.
courseTextName.setEllipsize(null);
courseTextName.setSingleLine(false);
final String headerImageUrl = courseData.getCourse().getCourse_image(environment.getConfig().getApiHostURL());
Glide.with(context).load(headerImageUrl).placeholder(R.drawable.placeholder_course_card_image).transform(new TopAnchorFillWidthTransformation()).into(headerImageView);
courseTextName.setText(courseData.getCourse().getName());
courseTextDetails.setText(CourseCardUtils.getFormattedDate(context, courseData));
return view;
}
Aggregations