Android Open Source - photo-paper Photo Fragment






From Project

Back to project page photo-paper.

License

The source code is released under:

MIT License

If you think the Android project photo-paper 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.lukekorth.android_500px;
//from w w  w . j a  v  a2 s  .c om
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lukekorth.android_500px.helpers.Utils;
import com.lukekorth.android_500px.models.Photos;

import it.sephiroth.android.library.imagezoom.ImageViewTouch;

public class PhotoFragment extends Fragment {

    public static final String PHOTO_ID_KEY = "com.lukekorth.android_500px.PhotoFragment.PHOTO_ID_KEY";

    private Photos mPhoto;
    private ImageViewTouch mImageView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPhoto = Photos.getPhoto(getArguments().getInt(PHOTO_ID_KEY));
    }

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                             @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.full_screen_photo, container, false);
        mImageView = (ImageViewTouch) view.findViewById(R.id.photo);

        return view;
   }

    @Override
    public void onResume() {
        super.onResume();

        WallpaperApplication.getPicasso(getActivity())
                .load(mPhoto.imageUrl)
                .resize(Utils.getScreenWidth(getActivity()), Utils.getScreenHeight(getActivity()))
                .centerInside()
                .into(mImageView);
    }

}




Java Source Code List

com.lukekorth.android_500px.HistoryActivity.java
com.lukekorth.android_500px.PhotoFragment.java
com.lukekorth.android_500px.SearchActivity.java
com.lukekorth.android_500px.SettingsActivity.java
com.lukekorth.android_500px.ViewPhotoActivity.java
com.lukekorth.android_500px.WallpaperApplication.java
com.lukekorth.android_500px.helpers.Cache.java
com.lukekorth.android_500px.helpers.LogReporting.java
com.lukekorth.android_500px.helpers.Settings.java
com.lukekorth.android_500px.helpers.ThreadBus.java
com.lukekorth.android_500px.helpers.Utils.java
com.lukekorth.android_500px.models.ActivityResumedEvent.java
com.lukekorth.android_500px.models.EnableCategoriesEvent.java
com.lukekorth.android_500px.models.Photos.java
com.lukekorth.android_500px.models.SearchCompleteEvent.java
com.lukekorth.android_500px.models.UserUpdatedEvent.java
com.lukekorth.android_500px.models.User.java
com.lukekorth.android_500px.models.WallpaperChangedEvent.java
com.lukekorth.android_500px.receivers.UserPresentReceiver.java
com.lukekorth.android_500px.receivers.WifiReceiver.java
com.lukekorth.android_500px.services.ApiService.java
com.lukekorth.android_500px.services.ClearCacheIntentService.java
com.lukekorth.android_500px.services.UserInfoIntentService.java
com.lukekorth.android_500px.services.WallpaperService.java
com.lukekorth.android_500px.views.FeatureListPreference.java
com.lukekorth.android_500px.views.SquareImageView.java
com.squareup.picasso.PicassoTools.java