Android Open Source - notes Image Fragment






From Project

Back to project page notes.

License

The source code is released under:

Apache License

If you think the Android project notes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.donnemartin.android.notes.notes;
/*from   www.  j  av  a  2  s .c  o m*/
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class ImageFragment extends DialogFragment {

    public static final String EXTRA_IMAGE_PATH =
        "com.donnemartin.android.notes.path";

    public static ImageFragment newInstance(String imagePath) {
        Bundle args = new Bundle();
        args.putSerializable(EXTRA_IMAGE_PATH, imagePath);

        ImageFragment fragment = new ImageFragment();
        fragment.setArguments(args);
        fragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0);

        return fragment;
    }

    private ImageView mImageView;

    @Override
    public View onCreateView(LayoutInflater inflater,
                             ViewGroup parent,
                             Bundle savedInstanceState) {
        mImageView = new ImageView(getActivity());
        String path = (String)getArguments().getSerializable(EXTRA_IMAGE_PATH);
        BitmapDrawable image = PictureUtils.getScaledDrawable(getActivity(), path);

        mImageView.setImageDrawable(image);

        return mImageView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        PictureUtils.cleanImageView(mImageView);
    }
}




Java Source Code List

com.donnemartin.android.notes.notes.AudioPlayer.java
com.donnemartin.android.notes.notes.AudioRecorder.java
com.donnemartin.android.notes.notes.DatePickerFragment.java
com.donnemartin.android.notes.notes.ImageFragment.java
com.donnemartin.android.notes.notes.NoteCameraActivity.java
com.donnemartin.android.notes.notes.NoteCameraFragment.java
com.donnemartin.android.notes.notes.NoteFragment.java
com.donnemartin.android.notes.notes.NoteIntentJSONSerializer.java
com.donnemartin.android.notes.notes.NoteListActivity.java
com.donnemartin.android.notes.notes.NoteListFragment.java
com.donnemartin.android.notes.notes.NotePagerActivity.java
com.donnemartin.android.notes.notes.Note.java
com.donnemartin.android.notes.notes.Notebook.java
com.donnemartin.android.notes.notes.Photo.java
com.donnemartin.android.notes.notes.PictureUtils.java
com.donnemartin.android.notes.notes.SingleFragmentActivity.java