use of com.android.gallery3d.data.ClusterAlbum in project android_packages_apps_Gallery2 by LineageOS.
the class TimeLinePage method onLongTap.
public void onLongTap(int slotIndex, boolean isTitle) {
if (mGetContent)
return;
if (isTitle) {
MediaSet targetSet = mAlbumDataAdapter.getMediaSet(slotIndex);
if (targetSet == null)
return;
ArrayList<Path> paths = ((ClusterAlbum) targetSet).getMediaItems();
if (paths == null || paths.size() <= 0)
return;
mSelectionManager.setAutoLeaveSelectionMode(true);
mSelectionManager.toggleTimeLineSet(paths);
mSlotView.invalidate();
} else {
MediaItem item = mAlbumDataAdapter.get(slotIndex);
if (item == null)
return;
mSelectionManager.setAutoLeaveSelectionMode(true);
mSelectionManager.toggle(item.getPath());
mSlotView.invalidate();
}
}
use of com.android.gallery3d.data.ClusterAlbum in project android_packages_apps_Gallery2 by LineageOS.
the class TimeLinePage method onSingleTapUp.
private void onSingleTapUp(int slotIndex, boolean isTitle) {
if (!mIsActive)
return;
if (mSelectionManager.inSelectionMode()) {
if (isTitle) {
MediaSet targetSet = mAlbumDataAdapter.getMediaSet(slotIndex);
if (targetSet == null)
return;
ArrayList<Path> paths = ((ClusterAlbum) targetSet).getMediaItems();
if (paths == null || paths.size() <= 0)
return;
mSelectionManager.toggleTimeLineSet(paths);
mSlotView.invalidate();
} else {
MediaItem item = mAlbumDataAdapter.get(slotIndex);
// Item not ready yet, ignore the click
if (item == null)
return;
if (mSelectionManager.getSelectedCount() > 0) {
if (!ActionModeHandler.isThreadComplete)
return;
}
mSelectionManager.toggle(item.getPath());
mSlotView.invalidate();
}
} else if (!isTitle) {
// Render transition in pressed state
mAlbumView.setPressedIndex(slotIndex);
mAlbumView.setPressedUp();
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_PICK_PHOTO, slotIndex, 0), FadeTexture.DURATION);
}
}
Aggregations