This repository has been archived by the owner on Sep 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
27 changed files
with
613 additions
and
390 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
app/src/main/java/us/koller/cameraroll/adapter/item/ViewHolder/VideoViewHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package us.koller.cameraroll.adapter.item.ViewHolder; | ||
|
||
import android.animation.Animator; | ||
import android.animation.AnimatorListenerAdapter; | ||
import android.app.Activity; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
|
||
import us.koller.cameraroll.R; | ||
import us.koller.cameraroll.data.AlbumItem; | ||
import us.koller.cameraroll.ui.AlbumActivity; | ||
import us.koller.cameraroll.ui.ItemActivity; | ||
import us.koller.cameraroll.util.ItemViewUtil; | ||
|
||
public class VideoViewHolder extends ViewHolder { | ||
|
||
public VideoViewHolder(AlbumItem albumItem, int position) { | ||
super(albumItem, position); | ||
} | ||
|
||
@Override | ||
public View getView(ViewGroup container) { | ||
ViewGroup v = super.inflateView(container); | ||
v.removeView(v.findViewById(R.id.subsampling)); | ||
View view = v.findViewById(R.id.image); | ||
if (albumItem.isSharedElement) { | ||
ItemViewUtil.bindTransitionView((ImageView) view, albumItem); | ||
} else { | ||
itemView = v; | ||
bindView(); | ||
} | ||
return v; | ||
} | ||
|
||
public void bindView() { | ||
View view = itemView.findViewById(R.id.image); | ||
ViewGroup v = ItemViewUtil.bindImageViewForVideo((ImageView) view, albumItem); | ||
View playButton = v.findViewWithTag(ItemViewUtil.VIDEO_PLAY_BUTTON_TAG); | ||
playButton.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
AlbumActivity.videoOnClick((Activity) view.getContext(), albumItem); | ||
} | ||
}); | ||
playButton.setAlpha(0.0f); | ||
playButton.animate().alpha(0.54f).start(); | ||
} | ||
|
||
@Override | ||
public void onSharedElement(final ItemActivity.Callback callback) { | ||
callback.callback(); | ||
} | ||
} |
Oops, something went wrong.