Commit 09f46a55 authored by Alex Chau's avatar Alex Chau Committed by Commit Bot

Delay SharedClipboardShareActivity animation until native is lodaded

- We can only get correct data in adapter after native is initialized,
  which is needed to correctly decide if empty view should be shown
- This will result in a mask being shown full screen (instead of zero
  state view) while native is loaded
- Before: https://drive.google.com/file/d/1b6tKuRSj7LPOLr7O5h7XrWqfK4tJfJp9
- After: https://drive.google.com/file/d/14Nd650D85TwMjCJgtQmalgmB3uCt0kNg

Bug: 1002852
Change-Id: I6626865cbee2e9e9eee5664ae83139d428b7d0ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1798322Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Commit-Queue: Alex Chau <alexchau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695625}
parent e37a06d4
......@@ -47,7 +47,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="32dp"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/empty_state_image"
......
......@@ -35,7 +35,6 @@ import org.chromium.ui.widget.ButtonCompat;
public class SharedClipboardShareActivity
extends AsyncInitializationActivity implements OnItemClickListener {
private SharingAdapter mAdapter;
private ListView mListView;
/**
* Checks whether sending shared clipboard message is enabled for the user and enables/disables
......@@ -75,13 +74,6 @@ public class SharedClipboardShareActivity
View mask = findViewById(R.id.mask);
mask.setOnClickListener(v -> finish());
mListView = findViewById(R.id.device_picker_list);
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(this);
mListView.setEmptyView(findViewById(R.id.empty_state));
View content = findViewById(R.id.device_picker_content);
content.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_up));
ButtonCompat chromeSettingsButton = findViewById(R.id.chrome_settings);
if (!AndroidSyncSettings.get().isChromeSyncEnabled()) {
......@@ -109,7 +101,13 @@ public class SharedClipboardShareActivity
findViewById(R.id.device_picker_toolbar).setVisibility(View.VISIBLE);
}
mListView.setAdapter(mAdapter);
ListView listView = findViewById(R.id.device_picker_list);
listView.setAdapter(mAdapter);
listView.setOnItemClickListener(this);
listView.setEmptyView(findViewById(R.id.empty_state));
View content = findViewById(R.id.device_picker_content);
content.startAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_up));
}
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment