|
30 | 30 | import android.graphics.Bitmap;
|
31 | 31 | import android.graphics.BitmapFactory;
|
32 | 32 | import android.net.Uri;
|
| 33 | +import android.os.Build; |
33 | 34 | import android.os.Bundle;
|
34 | 35 | import android.provider.MediaStore;
|
35 | 36 | import android.support.v7.app.ActionBarActivity;
|
@@ -83,7 +84,11 @@ public void onClick(View view) {
|
83 | 84 | });
|
84 | 85 |
|
85 | 86 | currentPaint = (ImageButton) findViewById(R.id.hs_red_brush);
|
86 |
| - currentPaint.setBackground(getResources().getDrawable(R.drawable.paint_pressed)); |
| 87 | + if(Build.VERSION.SDK_INT >= 16) { |
| 88 | + currentPaint.setBackground(getResources().getDrawable(R.drawable.paint_pressed)); |
| 89 | + } else { |
| 90 | + currentPaint.setBackgroundDrawable(getResources().getDrawable(R.drawable.paint_pressed)); |
| 91 | + } |
87 | 92 | clearChangesTextView = (TextView)findViewById(R.id.clear_change_text);
|
88 | 93 |
|
89 | 94 | Intent intent = new Intent();
|
@@ -197,9 +202,13 @@ public void paintColorClicked(View view) {
|
197 | 202 | String color = imageButton.getTag().toString();
|
198 | 203 |
|
199 | 204 | drawView.setColor(color);
|
200 |
| - |
201 |
| - imageButton.setBackground(getResources().getDrawable(R.drawable.paint_pressed)); |
202 |
| - currentPaint.setBackground(getResources().getDrawable(R.drawable.paint)); |
| 205 | + if(Build.VERSION.SDK_INT >= 16) { |
| 206 | + imageButton.setBackground(getResources().getDrawable(R.drawable.paint_pressed)); |
| 207 | + currentPaint.setBackground(getResources().getDrawable(R.drawable.paint)); |
| 208 | + } else { |
| 209 | + imageButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.paint_pressed)); |
| 210 | + currentPaint.setBackgroundDrawable(getResources().getDrawable(R.drawable.paint)); |
| 211 | + } |
203 | 212 |
|
204 | 213 | currentPaint = (ImageButton) view;
|
205 | 214 | }
|
|
0 commit comments