title: Android - overlay small check icon over specific image in gridview or change border
body: <p>I've just asked a question about an hour ago, while waiting for replies, I've thought maybe I can achieve what I want differently. I was thinking of changing the image but it would be better if I could perhaps overlay something over the top of complete levels in the gridview i.e a small tick icon
  At the moment, when a level has been completed I am storing that with sharedpreferences</p>
  
  <p>So I have a gridView layout to display images that represent levels. Let's just say for this example I have 20 levels. When one level is complete is it possible to overlay the tick icon or somehow highlight the level image. Maybe change the border of the image??</p>
  
  <p>Here are the image arrays I use</p>
  
  <pre><code>int[] imageIDs = {
     R.drawable.one,
     R.drawable.two,
     R.drawable.three,
     R.drawable.four,
     R.drawable.five,
     R.drawable.six
     etc.......
  </code></pre>
  
  <p>and then I have my code to set the images in gridView. Obviously there is more code in between.</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) 
  {
     ImageView imageView;
     if (convertView == null) {
         imageView = new ImageView(context);
         imageView.setLayoutParams(new GridView.LayoutParams(140, 140));
         imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
         imageView.setPadding(5, 5, 5, 5);
     } else {
         imageView = (ImageView) convertView;
     }
     imageView.setImageResource(imageIDs[position]);
     return imageView;
  </code></pre>
  
  <p>would it be possible to do any of the above, even the border method would be fine.
  Thanks for any help</p>
  
  <hr>
  
  <p>When the level is open, I am using a switch case to do other tasks as well as change the <strong>item</strong> string to the name of the image it represents.</p>
  
  <pre><code>    switch(question){
      case 0:
          iv.setImageResource(R.drawable.one);
          item = imageOne;
                      answer1 = "one"         
  
      break;
      case 1:
          iv.setImageResource(R.drawable.two);
          item = imageTwo;
                      answer1 = "two"
      break;
      default:
      break;
      }
  </code></pre>
  
  <p>I'm then calling that string to save a boolean with the name of image</p>
  
  <pre><code>final boolean answerStatusCase = preferences.getBoolean(item, false);
  final SharedPreferences.Editor editor = preferences.edit();
  
  Button checkAnswer = (Button) findViewById(R.id.bCheckAnswer);
      checkAnswer.setOnClickListener(new View.OnClickListener() {
  
          public void onClick(View v) {
  
              String yourAnswerCheck = yourAnswerReview.toString();
  
              if (yourAnswerCheck.equals(answer1)) {
                  Toast.makeText(getBaseContext(), "That's correct", 2000).show();
  
                      editor.putBoolean(item, true);
                      editor.commit();    
  
              }else{
                  Toast.makeText(getBaseContext(), "That's incorrect", 2000).show();
              }
  
          }
  
      });
  </code></pre>