OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.ui; | 5 package org.chromium.components.web_contents_delegate_android; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.Color; | 8 import android.graphics.Color; |
9 import android.util.AttributeSet; | 9 import android.util.AttributeSet; |
10 import android.widget.ListView; | 10 import android.widget.ListView; |
11 | 11 |
12 import org.chromium.ui.ColorSuggestionListAdapter.OnColorSuggestionClickListener
; | 12 import org.chromium.components.web_contents_delegate_android.ColorSuggestionList
Adapter.OnColorSuggestionClickListener; |
13 | 13 |
14 /** | 14 /** |
15 * Draws a grid of (predefined) colors and allows the user to choose one of | 15 * Draws a grid of (predefined) colors and allows the user to choose one of |
16 * those colors. | 16 * those colors. |
17 */ | 17 */ |
18 public class ColorPickerSimple extends ListView implements OnColorSuggestionClic
kListener { | 18 public class ColorPickerSimple extends ListView implements OnColorSuggestionClic
kListener { |
19 | 19 |
20 private OnColorChangedListener mOnColorChangedListener; | 20 private OnColorChangedListener mOnColorChangedListener; |
21 | 21 |
22 private static final int[] DEFAULT_COLORS = { | 22 private static final int[] DEFAULT_COLORS = { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 getContext(), suggestions); | 77 getContext(), suggestions); |
78 adapter.setOnColorSuggestionClickListener(this); | 78 adapter.setOnColorSuggestionClickListener(this); |
79 setAdapter(adapter); | 79 setAdapter(adapter); |
80 } | 80 } |
81 | 81 |
82 @Override | 82 @Override |
83 public void onColorSuggestionClick(ColorSuggestion suggestion) { | 83 public void onColorSuggestionClick(ColorSuggestion suggestion) { |
84 mOnColorChangedListener.onColorChanged(suggestion.mColor); | 84 mOnColorChangedListener.onColorChanged(suggestion.mColor); |
85 } | 85 } |
86 } | 86 } |
OLD | NEW |