Search in sources :

Example 1 with PhilmImageView

use of app.philm.in.view.PhilmImageView in project philm by chrisbanes.

the class MovieSectionedListAdapter method bindView.

@Override
protected void bindView(int position, View view, ListItem<PhilmMovie> item) {
    PhilmMovie movie = item.getListItem();
    final TextView title = (TextView) view.findViewById(R.id.textview_title);
    if (movie.getYear() > 0) {
        title.setText(mActivity.getString(R.string.movie_title_year, movie.getTitle(), movie.getYear()));
    } else {
        title.setText(movie.getTitle());
    }
    final TextView ratingTextView = (TextView) view.findViewById(R.id.textview_subtitle_1);
    ratingTextView.setText(mActivity.getString(R.string.movie_rating_votes, movie.getAverageRatingPercent(), movie.getAverageRatingVotes()));
    final TextView release = (TextView) view.findViewById(R.id.textview_subtitle_2);
    mDate.setTime(movie.getReleasedTime());
    release.setText(mActivity.getString(R.string.movie_release_date, mMediumDateFormatter.format(mDate)));
    final PhilmImageView imageView = (PhilmImageView) view.findViewById(R.id.imageview_poster);
    imageView.loadPoster(movie);
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie) TextView(android.widget.TextView) PhilmImageView(app.philm.in.view.PhilmImageView)

Example 2 with PhilmImageView

use of app.philm.in.view.PhilmImageView in project philm by chrisbanes.

the class PersonCreditSectionedListAdapter method bindView.

@Override
protected void bindView(int position, View view, ListItem<PhilmPersonCredit> item) {
    PhilmPersonCredit credit = item.getListItem();
    final TextView nameTextView = (TextView) view.findViewById(R.id.textview_title);
    nameTextView.setText(credit.getTitle());
    final TextView characterTextView = (TextView) view.findViewById(R.id.textview_subtitle_1);
    if (TextUtils.isEmpty(credit.getJob())) {
        characterTextView.setVisibility(View.GONE);
    } else {
        characterTextView.setVisibility(View.VISIBLE);
        characterTextView.setText(credit.getJob());
    }
    final TextView release = (TextView) view.findViewById(R.id.textview_subtitle_2);
    mDate.setTime(credit.getReleaseDate());
    release.setText(mActivity.getString(R.string.movie_release_date, mMediumDateFormatter.format(mDate)));
    final PhilmImageView imageView = (PhilmImageView) view.findViewById(R.id.imageview_poster);
    imageView.loadPoster(credit);
}
Also used : TextView(android.widget.TextView) PhilmPersonCredit(app.philm.in.model.PhilmPersonCredit) PhilmImageView(app.philm.in.view.PhilmImageView)

Example 3 with PhilmImageView

use of app.philm.in.view.PhilmImageView in project philm by chrisbanes.

the class SideMenuFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
    View view = inflater.inflate(R.layout.fragment_drawer, container, false);
    mListView = (ListView) view.findViewById(android.R.id.list);
    mListView.setOnItemClickListener(this);
    mListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    mAdapter = new SideMenuItemAdapter();
    mListView.setAdapter(mAdapter);
    mAddAccountLayout = view.findViewById(R.id.layout_add_account);
    mAddAccountLayout.setOnClickListener(this);
    mProfileLayout = view.findViewById(R.id.layout_profile);
    mUsernameTextView = (TextView) view.findViewById(R.id.textview_username);
    mFullnameTextView = (TextView) view.findViewById(R.id.textview_fullname);
    mAvatarImageView = (ImageView) view.findViewById(R.id.imageview_account_avatar);
    mCheckinLayout = view.findViewById(R.id.layout_checkin);
    mCheckinLayout.setOnClickListener(this);
    mCheckinImageView = (PhilmImageView) view.findViewById(R.id.imageview_checkin_movie);
    mCheckinImageView.setAutoFade(false);
    mCheckinTitleTextView = (TextView) mCheckinLayout.findViewById(R.id.textview_title);
    final int darkenByte = Math.round(255 * CHECKIN_BACKDROP_DARKEN);
    mColorFilter = new LightingColorFilter(Color.rgb(darkenByte, darkenByte, darkenByte), 0);
    return view;
}
Also used : LightingColorFilter(android.graphics.LightingColorFilter) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) PhilmImageView(app.philm.in.view.PhilmImageView) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 4 with PhilmImageView

use of app.philm.in.view.PhilmImageView in project philm by chrisbanes.

the class MovieGridAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup viewGroup) {
    View view = convertView;
    if (view == null) {
        view = mLayoutInflater.inflate(R.layout.item_grid_movie, viewGroup, false);
    }
    final PhilmMovie movie = getItem(position).getListItem();
    final TextView title = (TextView) view.findViewById(R.id.textview_title);
    title.setText(movie.getTitle());
    title.setVisibility(View.VISIBLE);
    final PhilmImageView imageView = (PhilmImageView) view.findViewById(R.id.imageview_poster);
    imageView.setAutoFade(false);
    imageView.loadPoster(movie, new PhilmImageView.Listener() {

        @Override
        public void onSuccess(PhilmImageView imageView, Bitmap bitmap) {
            title.setVisibility(View.GONE);
        }

        @Override
        public void onError(PhilmImageView imageView) {
            title.setVisibility(View.VISIBLE);
        }
    });
    return view;
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie) Bitmap(android.graphics.Bitmap) TextView(android.widget.TextView) PhilmImageView(app.philm.in.view.PhilmImageView) PhilmImageView(app.philm.in.view.PhilmImageView) TextView(android.widget.TextView) View(android.view.View)

Example 5 with PhilmImageView

use of app.philm.in.view.PhilmImageView in project philm by chrisbanes.

the class PersonSectionedListAdapter method bindView.

@Override
protected void bindView(int position, View view, ListItem<PhilmPerson> item) {
    PhilmPerson person = item.getListItem();
    final TextView nameTextView = (TextView) view.findViewById(R.id.textview_title);
    nameTextView.setText(person.getName());
    final PhilmImageView imageView = (PhilmImageView) view.findViewById(R.id.imageview_poster);
    imageView.setAvatarMode(true);
    imageView.loadProfile(person);
}
Also used : PhilmPerson(app.philm.in.model.PhilmPerson) TextView(android.widget.TextView) PhilmImageView(app.philm.in.view.PhilmImageView)

Aggregations

TextView (android.widget.TextView)6 PhilmImageView (app.philm.in.view.PhilmImageView)6 View (android.view.View)2 PhilmMovie (app.philm.in.model.PhilmMovie)2 Bitmap (android.graphics.Bitmap)1 LightingColorFilter (android.graphics.LightingColorFilter)1 AdapterView (android.widget.AdapterView)1 ImageView (android.widget.ImageView)1 ListView (android.widget.ListView)1 PhilmMovieCredit (app.philm.in.model.PhilmMovieCredit)1 PhilmPerson (app.philm.in.model.PhilmPerson)1 PhilmPersonCredit (app.philm.in.model.PhilmPersonCredit)1