Android Open Source - VoxPopuli-Android Result Player Adapter






From Project

Back to project page VoxPopuli-Android.

License

The source code is released under:

GNU General Public License

If you think the Android project VoxPopuli-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 fr.kyriog.android.voxpopuli.adapter;
//from  w  w w  .j  a  va 2s .co m
import java.util.List;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import fr.kyriog.android.voxpopuli.GameActivity;
import fr.kyriog.android.voxpopuli.R;
import fr.kyriog.android.voxpopuli.entity.Player;

public class ResultPlayerAdapter extends VotedPlayerAdapter {
  public ResultPlayerAdapter(Activity activity, List<Player> players) {
    super(activity, players);
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    convertView = super.getView(position, convertView, parent);

    LinearLayout layout = (LinearLayout) convertView.findViewById(R.id.game_waiting_player);
    Player player = getItem(position);
    switch(player.getVote()) {
    case GameActivity.ANSWER_A:
      layout.setBackgroundResource(R.drawable.blue_rounded_background);
      break;
    case GameActivity.ANSWER_B:
      layout.setBackgroundResource(R.drawable.red_rounded_background);
      break;
    case GameActivity.ANSWER_C:
      layout.setBackgroundResource(R.drawable.green_rounded_background);
      break;
    }

    return convertView;
  }
}




Java Source Code List

fr.kyriog.android.voxpopuli.GameActivity.java
fr.kyriog.android.voxpopuli.HomeActivity.java
fr.kyriog.android.voxpopuli.LoginActivity.java
fr.kyriog.android.voxpopuli.adapter.HomeAdapter.java
fr.kyriog.android.voxpopuli.adapter.PlayerAdapter.java
fr.kyriog.android.voxpopuli.adapter.ResultPlayerAdapter.java
fr.kyriog.android.voxpopuli.adapter.VotedPlayerAdapter.java
fr.kyriog.android.voxpopuli.entity.Game.java
fr.kyriog.android.voxpopuli.entity.Player.java
fr.kyriog.android.voxpopuli.entity.Question.java
fr.kyriog.android.voxpopuli.handler.AvatarHandler.java
fr.kyriog.android.voxpopuli.handler.GameHandler.java
fr.kyriog.android.voxpopuli.handler.HomeHandler.java
fr.kyriog.android.voxpopuli.socketio.BaseCallback.java
fr.kyriog.android.voxpopuli.socketio.GameCallback.java
fr.kyriog.android.voxpopuli.socketio.HomeCallback.java
fr.kyriog.android.voxpopuli.thread.AvatarDownloader.java