Android Open Source - immersive-videoplayer-android Home Array Adapter






From Project

Back to project page immersive-videoplayer-android.

License

The source code is released under:

MIT License

If you think the Android project immersive-videoplayer-android 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.stickmanventures.android.example.immersive_videoplayer.adapters;
/*w w w . j a v a  2s  . c  o  m*/
import java.util.HashMap;
import java.util.List;

import android.content.Context;
import android.widget.ArrayAdapter;

public class HomeArrayAdapter extends ArrayAdapter<String> {

  private HashMap<String, Integer> mIdMap = new HashMap<String, Integer>();

  public HomeArrayAdapter(Context context, int textViewResourceId, List<String> objects) {
    super(context, textViewResourceId, objects);
    
    for(int i = 0; i < objects.size(); ++i) {
      mIdMap.put(objects.get(i), i);
    }
  }

  @Override
  public long getItemId(int position) {
    String item = getItem(position);
    return mIdMap.get(item);
  }

  @Override
  public boolean hasStableIds() {
    return true;
  }

}




Java Source Code List

com.stickmanventures.android.example.immersive_videoplayer.ImmersiveVideoplayer.java
com.stickmanventures.android.example.immersive_videoplayer.adapters.HomeArrayAdapter.java
com.stickmanventures.android.example.immersive_videoplayer.entities.Video.java
com.stickmanventures.android.example.immersive_videoplayer.ui.activities.BaseActivity.java
com.stickmanventures.android.example.immersive_videoplayer.ui.activities.HomeActivity.java
com.stickmanventures.android.example.immersive_videoplayer.ui.activities.VideoPlayerActivity.java
com.stickmanventures.android.example.immersive_videoplayer.ui.fragments.VideoDescriptionFragment.java
com.stickmanventures.android.example.immersive_videoplayer.ui.fragments.VideoPlayerFragment.java