use of com.facebook.shimmer.ShimmerFrameLayout in project android-frontend-java by Dezenix.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final int[] currentPage = { 0 };
Timer timer;
final long DELAY_MS = 2000;
final long PERIOD_MS = 4000;
ShimmerFrameLayout s1, s2, s3;
final Handler sh;
ViewPager vp = findViewById(R.id.vp);
s1 = findViewById(R.id.s1);
s2 = findViewById(R.id.s2);
s3 = findViewById(R.id.s3);
s1.startShimmer();
s2.startShimmer();
s3.startShimmer();
sh = new Handler();
sh.postDelayed(() -> {
s1.stopShimmer();
s1.setVisibility(View.GONE);
s2.stopShimmer();
s2.setVisibility(View.GONE);
s3.stopShimmer();
s3.setVisibility(View.GONE);
vp.setVisibility(View.VISIBLE);
addDots(0);
}, 3500);
Objects.requireNonNull(getSupportActionBar()).hide();
list.add(new slideritem("Management", "do management effectively with our help ...", R.drawable.img1));
list.add(new slideritem("Presentation", "Make stunning and impressive presentations ...", R.drawable.img2));
list.add(new slideritem("Effective", "Work effectively from anywhere any time ...", R.drawable.img4));
list.add(new slideritem("Success", "Make, your company grow and let catch the success ...", R.drawable.img3));
slider_adapter adapter = new slider_adapter(this, list);
vp.setAdapter(adapter);
vp.setOffscreenPageLimit(4);
vp.addOnPageChangeListener(viewListener);
final Handler handler = new Handler();
final Runnable Update = () -> {
if (currentPage[0] == 4) {
currentPage[0] = 0;
}
vp.setCurrentItem(currentPage[0]++, true);
};
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
handler.post(Update);
}
}, DELAY_MS, PERIOD_MS);
}
use of com.facebook.shimmer.ShimmerFrameLayout 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 com.facebook.shimmer.ShimmerFrameLayout 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