本文整理汇总了Java中android.widget.GridView.setCacheColorHint方法的典型用法代码示例。如果您正苦于以下问题:Java GridView.setCacheColorHint方法的具体用法?Java GridView.setCacheColorHint怎么用?Java GridView.setCacheColorHint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.GridView
的用法示例。
在下文中一共展示了GridView.setCacheColorHint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EmoticonPageView
import android.widget.GridView; //导入方法依赖的package包/类
public EmoticonPageView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.item_emoticonpage, this);
mGvEmotion = (GridView) view.findViewById(R.id.gv_emotion);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
mGvEmotion.setMotionEventSplittingEnabled(false);
}
mGvEmotion.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
mGvEmotion.setCacheColorHint(0);
mGvEmotion.setSelector(new ColorDrawable(Color.TRANSPARENT));
mGvEmotion.setVerticalScrollBarEnabled(false);
}
示例2: EmoticonPageView
import android.widget.GridView; //导入方法依赖的package包/类
public EmoticonPageView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.kf5_emoticon_page, this);
mGvEmotion = (GridView) view.findViewById(R.id.kf5_grid_view_emotion);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
mGvEmotion.setMotionEventSplittingEnabled(false);
}
mGvEmotion.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
mGvEmotion.setCacheColorHint(0);
mGvEmotion.setSelector(new ColorDrawable(Color.TRANSPARENT));
mGvEmotion.setVerticalScrollBarEnabled(false);
}
示例3: EmoticonPageView
import android.widget.GridView; //导入方法依赖的package包/类
public EmoticonPageView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(ResourceUtils.getIdByName(context,"layout","sobot_item_emoticonpage"), this);
mGvEmotion = (GridView) view.findViewById(ResourceUtils.getIdByName(context,"id", "sobot_gv_emotion"));
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
mGvEmotion.setMotionEventSplittingEnabled(false);
}
mGvEmotion.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
mGvEmotion.setCacheColorHint(0);
mGvEmotion.setSelector(new ColorDrawable(Color.TRANSPARENT));
mGvEmotion.setVerticalScrollBarEnabled(false);
}
示例4: showThemeDialog
import android.widget.GridView; //导入方法依赖的package包/类
public void showThemeDialog(final Activity context, final String index){
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.ChangeThemeDialog);
builder.setTitle("更换主题");
Integer[] res = new Integer[]{R.drawable.red_round, R.drawable.brown_round, R.drawable.blue_round,
R.drawable.blue_grey_round, R.drawable.yellow_round, R.drawable.deep_purple_round,
R.drawable.pink_round, R.drawable.green_round, R.drawable.deep_orange_round,
R.drawable.grey_round, R.drawable.cyan_round, R.drawable.amber_round};
List<Integer> list = Arrays.asList(res);
ColorsListAdapter adapter = new ColorsListAdapter(context, list);
adapter.setCheckItem(ThemeUtils.getCurrentTheme(context).getIntValue());
GridView gridView = (GridView) LayoutInflater.from(context).inflate(R.layout.colors_panel_layout, null);
gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
gridView.setCacheColorHint(0);
gridView.setAdapter(adapter);
builder.setView(gridView);
final AlertDialog dialog = builder.show();
gridView.setOnItemClickListener(
new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
dialog.dismiss();
int value = ThemeUtils.getCurrentTheme(context).getIntValue();
Log.d("wxl", "value==" + value);
if (value != position) {
PreferenceUtils.setPreferenceInt(context,PreferenceUtils.THEME_KEY, position);
PreferenceUtils.setPreferenceString(context,PreferenceUtils.MAIN_INDEX_MENU,index);
context.getWindow().setWindowAnimations(R.style.WindowAnimationFadeInOut);
context.recreate();
}
}
}
);
}