|
|
@@ -8,6 +8,7 @@ import android.content.res.Resources;
|
|
|
import android.database.DataSetObserver;
|
|
|
import android.graphics.Color;
|
|
|
import android.graphics.Paint;
|
|
|
+import android.graphics.drawable.ColorDrawable;
|
|
|
import android.net.Uri;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
@@ -692,6 +693,8 @@ public class SearchResultActivity extends AppCompatActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private int normalColor;
|
|
|
+ private int touchColor = Color.GRAY;
|
|
|
private void initClickListener() {
|
|
|
|
|
|
// 需要作为成员变量
|
|
|
@@ -702,6 +705,16 @@ public class SearchResultActivity extends AppCompatActivity {
|
|
|
@Override
|
|
|
public boolean onTouch(View v, MotionEvent event) {
|
|
|
|
|
|
+ View cell = (View) v.getParent();
|
|
|
+ if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
|
|
+
|
|
|
+ normalColor = ((ColorDrawable)cell.getBackground()).getColor();
|
|
|
+ cell.setBackgroundColor(touchColor);
|
|
|
+
|
|
|
+ } else if (event.getAction() == MotionEvent.ACTION_CANCEL || event.getAction() == MotionEvent.ACTION_UP) {
|
|
|
+ cell.setBackgroundColor(normalColor);
|
|
|
+ }
|
|
|
+
|
|
|
clickedView = v;
|
|
|
|
|
|
detector.onTouchEvent(event);
|
|
|
@@ -1030,7 +1043,6 @@ public class SearchResultActivity extends AppCompatActivity {
|
|
|
holder.row.setBackgroundColor(Color.parseColor(color_1));
|
|
|
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
} catch (JSONException e) {
|