@Override public void onCropping() { // - Update snap icon, display progress circle and stop preview. mSnapButton.setImageResource(R.drawable.ic_visibility_white_24dp); mFabProgressCircle.show(); mEasyCamera.stopPreview(); }
@Override public boolean onDependentViewChanged( CoordinatorLayout parent, FABProgressCircle child, View dependency) { float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); child.setTranslationY(translationY); return true; }
@Override public void onError() { // - If activity is still alive (asynchronous task). if (getActivity() != null) { // - Attach error listener to progress circle's final animation, then start it. getActivity() .runOnUiThread( () -> { mFabProgressCircle.attachListener( () -> { ((SnapAndMatchActivity) getActivity()) .pushFragment(ErrorFragment.newInstance()); }); mFabProgressCircle.beginFinalAnimation(); }); } }
private void attachListeners() { fabProgressCircle.attachListener(this); findViewById(R.id.fab) .setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { if (!taskRunning) { fabProgressCircle.show(); runMockInteractor(); } } }); }
@Override public void onMockActionComplete() { taskRunning = false; fabProgressCircle.beginFinalAnimation(); // fabProgressCircle.hide(); }