Search in sources :

Example 11 with SubsamplingScaleImageView

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();
        }
    }
}
Also used : SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView)

Example 12 with SubsamplingScaleImageView

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"));
}
Also used : SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView)

Example 13 with SubsamplingScaleImageView

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;
}
Also used : SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView) SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView) View(android.view.View)

Example 14 with SubsamplingScaleImageView

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;
}
Also used : SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView) SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView) View(android.view.View)

Example 15 with SubsamplingScaleImageView

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);
    }
}
Also used : TextView(android.widget.TextView) SubsamplingScaleImageView(com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView)

Aggregations

SubsamplingScaleImageView (com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView)30 View (android.view.View)18 PointF (android.graphics.PointF)5 Rect (android.graphics.Rect)4 OnClickListener (android.view.View.OnClickListener)4 TextView (android.widget.TextView)4 GestureDetector (android.view.GestureDetector)3 MotionEvent (android.view.MotionEvent)3 ImageView (android.widget.ImageView)2 ImageViewState (com.davemorrissey.labs.subscaleview.ImageViewState)2 SuppressLint (android.annotation.SuppressLint)1 WallpaperManager (android.app.WallpaperManager)1 Intent (android.content.Intent)1 Bitmap (android.graphics.Bitmap)1 RequiresApi (android.support.annotation.RequiresApi)1 ActionBar (android.support.v7.app.ActionBar)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Toolbar (android.support.v7.widget.Toolbar)1 OnTouchListener (android.view.View.OnTouchListener)1 ViewGroup (android.view.ViewGroup)1