Android Open Source - edu-video-client Fixed Pager Adapter






From Project

Back to project page edu-video-client.

License

The source code is released under:

Apache License

If you think the Android project edu-video-client 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.ngm.explaintome;
//w  w w  .j  a  v  a 2  s.  co m
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ngm.explaintome.data.QuestionType;

public class FixedPagerAdapter extends PagerAdapter {

  private Context context;

  public FixedPagerAdapter(Context context) {
    this.context = context;
  }

  @Override
  public int getCount() {
    return 3;
  }

  @Override
  public Object instantiateItem(ViewGroup container, int position) {
    switch (position) {

    default:
      return LayoutInflater.from(context).inflate(R.layout.multi_answer_question, null);
    }
  }

  @Override
  public CharSequence getPageTitle(int position) {
    switch (position) {
    case 0:
      return QuestionType.MULTIPLE_CHOICE.name();
    case 1:
      return QuestionType.OPEN_ENDED.name();
    case 2:
      return QuestionType.COMMENT.name();
    }
    return null;
  }

  @Override
  public boolean isViewFromObject(View arg0, Object arg1) {
    return false;
  }

  @Override
  public void destroyItem(ViewGroup container, int position, Object object) {
    ((ViewPager) container).removeViewAt(position);
  }

}




Java Source Code List

com.ngm.exlpaintome.video.VideoControllerView.java
com.ngm.explaintome.BaseActivity.java
com.ngm.explaintome.BaseListActivity.java
com.ngm.explaintome.BrowseActivity.java
com.ngm.explaintome.ColoredSearchView.java
com.ngm.explaintome.Constants.java
com.ngm.explaintome.ExplainActivity.java
com.ngm.explaintome.FilterableEntity.java
com.ngm.explaintome.FirstActivity.java
com.ngm.explaintome.FixedPagerAdapter.java
com.ngm.explaintome.RestConfig.java
com.ngm.explaintome.VideoViewActivity.java
com.ngm.explaintome.VideosActivity.java
com.ngm.explaintome.YoutubeUrlAsyncTask.java
com.ngm.explaintome.data.Answer.java
com.ngm.explaintome.data.ModelElement.java
com.ngm.explaintome.data.QuestionType.java
com.ngm.explaintome.data.Question.java
com.ngm.explaintome.data.Tag.java
com.ngm.explaintome.data.Video.java
com.ngm.explaintome.modules.ModuleProvider.java
com.ngm.explaintome.service.Callback.java
com.ngm.explaintome.service.MockRestActions.java
com.ngm.explaintome.service.RestActionsImpl.java
com.ngm.explaintome.service.RestActions.java