Skip to content

Commit b9a22c9

Browse files
committed
fixing view not hiding properly
1 parent d1d6794 commit b9a22c9

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

app/src/main/java/com/fastcomments/FeedExampleActivity.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,13 @@ private void setupPostCreationView() {
173173

174174
// Set FAB click listener
175175
createPostFab.setOnClickListener(v -> {
176-
// Show post creation view with animation and hide FAB
176+
// Configure post creation view and prepare it for showing
177177
postCreateView.setVisibility(View.VISIBLE);
178+
postCreateView.setClickable(true);
179+
postCreateView.setEnabled(true);
178180
createPostFab.setVisibility(View.GONE);
179181

180-
// Apply animation
182+
// Apply animation to slide it down
181183
postCreateView.startAnimation(android.view.animation.AnimationUtils.loadAnimation(
182184
FeedExampleActivity.this, com.fastcomments.sdk.R.anim.slide_down_from_top));
183185
});
@@ -198,8 +200,13 @@ public void onAnimationStart(android.view.animation.Animation animation) {
198200

199201
@Override
200202
public void onAnimationEnd(android.view.animation.Animation animation) {
201-
// Set gone at the end of animation
203+
// Make form completely gone and unclickable
204+
postCreateView.clearAnimation();
202205
postCreateView.setVisibility(View.GONE);
206+
postCreateView.setClickable(false);
207+
postCreateView.setEnabled(false);
208+
209+
// Show FAB button
203210
createPostFab.setVisibility(View.VISIBLE);
204211

205212
// Refresh the feed to show the new post
@@ -235,8 +242,13 @@ public void onAnimationStart(android.view.animation.Animation animation) {
235242

236243
@Override
237244
public void onAnimationEnd(android.view.animation.Animation animation) {
238-
// Set gone at the end of animation
245+
// Make form completely gone and unclickable
246+
postCreateView.clearAnimation();
239247
postCreateView.setVisibility(View.GONE);
248+
postCreateView.setClickable(false);
249+
postCreateView.setEnabled(false);
250+
251+
// Show FAB button
240252
createPostFab.setVisibility(View.VISIBLE);
241253
}
242254

0 commit comments

Comments
 (0)