use of com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView in project Camera-Roll-Android-App by kollerlukas.
the class PhotoViewHolder method scaleDown.
private void scaleDown(final ItemActivity.Callback callback) {
final SubsamplingScaleImageView imageView = itemView.findViewById(R.id.subsampling);
if (imageView != null) {
try {
imageView.animateScale(0.0f).withDuration(300).withOnAnimationEventListener(new SubsamplingScaleImageView.DefaultOnAnimationEventListener() {
@Override
public void onComplete() {
super.onComplete();
swapView(true);
callback.done();
// imageView.recycle();
}
}).start();
} catch (NullPointerException e) {
swapView(true);
callback.done();
// imageView.recycle();
}
}
}
use of com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView in project subsampling-scale-image-view by davemorrissey.
the class BasicFeaturesActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SubsamplingScaleImageView view = findViewById(id.imageView);
view.setImage(ImageSource.asset("sanmartino.jpg"));
}
use of com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView in project subsampling-scale-image-view by davemorrissey.
the class ExtensionCircleFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.extension_circle_fragment, container, false);
final ExtensionActivity activity = (ExtensionActivity) getActivity();
if (activity != null) {
rootView.findViewById(id.next).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
activity.next();
}
});
rootView.findViewById(id.previous).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
activity.previous();
}
});
}
SubsamplingScaleImageView imageView = rootView.findViewById(id.imageView);
imageView.setImage(ImageSource.asset("sanmartino.jpg"));
return rootView;
}
use of com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView in project subsampling-scale-image-view by davemorrissey.
the class ViewPagerFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(layout.view_pager_page, container, false);
if (savedInstanceState != null) {
if (asset == null && savedInstanceState.containsKey(BUNDLE_ASSET)) {
asset = savedInstanceState.getString(BUNDLE_ASSET);
}
}
if (asset != null) {
SubsamplingScaleImageView imageView = rootView.findViewById(id.imageView);
imageView.setImage(ImageSource.asset(asset));
}
return rootView;
}
use of com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView in project subsampling-scale-image-view by davemorrissey.
the class AnimationActivity method updateNotes.
private void updateNotes() {
if (position > notes.size() - 1) {
return;
}
getActionBar().setSubtitle(notes.get(position).subtitle);
((TextView) findViewById(id.note)).setText(notes.get(position).text);
findViewById(id.next).setVisibility(position >= notes.size() - 1 ? View.INVISIBLE : View.VISIBLE);
findViewById(id.previous).setVisibility(position <= 0 ? View.INVISIBLE : View.VISIBLE);
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) findViewById(id.imageView);
if (position == 2) {
imageView.setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_CENTER);
} else {
imageView.setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_INSIDE);
}
}
Aggregations