use of android.view.View in project Launcher3 by chislon.
the class ShortcutAndWidgetContainer method onMeasure.
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int count = getChildCount();
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(widthSpecSize, heightSpecSize);
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
if (child.getVisibility() != GONE) {
measureChild(child);
}
}
}
use of android.view.View in project Launcher3 by chislon.
the class ShortcutAndWidgetContainer method onLayout.
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
if (child.getVisibility() != GONE) {
CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams();
int childLeft = lp.x;
int childTop = lp.y;
child.layout(childLeft, childTop, childLeft + lp.width, childTop + lp.height);
if (lp.dropped) {
lp.dropped = false;
final int[] cellXY = mTmpCellXY;
getLocationOnScreen(cellXY);
mWallpaperManager.sendWallpaperCommand(getWindowToken(), WallpaperManager.COMMAND_DROP, cellXY[0] + childLeft + lp.width / 2, cellXY[1] + childTop + lp.height / 2, 0, null);
}
}
}
}
use of android.view.View in project Launcher3 by chislon.
the class LiveWallpaperListAdapter method getView.
public View getView(int position, View convertView, ViewGroup parent) {
View view;
if (convertView == null) {
view = mInflater.inflate(R.layout.wallpaper_picker_live_wallpaper_item, parent, false);
} else {
view = convertView;
}
WallpaperPickerActivity.setWallpaperItemPaddingToZero((FrameLayout) view);
LiveWallpaperTile wallpaperInfo = mWallpapers.get(position);
wallpaperInfo.setView(view);
ImageView image = (ImageView) view.findViewById(R.id.wallpaper_image);
ImageView icon = (ImageView) view.findViewById(R.id.wallpaper_icon);
if (wallpaperInfo.mThumbnail != null) {
image.setImageDrawable(wallpaperInfo.mThumbnail);
icon.setVisibility(View.GONE);
} else {
icon.setImageDrawable(wallpaperInfo.mInfo.loadIcon(mPackageManager));
icon.setVisibility(View.VISIBLE);
}
TextView label = (TextView) view.findViewById(R.id.wallpaper_item_label);
label.setText(wallpaperInfo.mInfo.loadLabel(mPackageManager));
return view;
}
use of android.view.View in project Launcher3 by chislon.
the class PagedViewCellLayout method cancelLongPress.
@Override
public void cancelLongPress() {
super.cancelLongPress();
// Cancel long press for all children
final int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
child.cancelLongPress();
}
}
use of android.view.View in project android-betterpickers by code-troopers.
the class TimePickerDialogFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.time_picker_dialog, container, false);
Button doneButton = (Button) view.findViewById(R.id.done_button);
Button cancelButton = (Button) view.findViewById(R.id.cancel_button);
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dismiss();
}
});
cancelButton.setTextColor(mTextColor);
doneButton.setTextColor(mTextColor);
doneButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
for (TimePickerDialogHandler handler : mTimePickerDialogHandlers) {
handler.onDialogTimeSet(mReference, mPicker.getHours(), mPicker.getMinutes());
}
final Activity activity = getActivity();
final Fragment fragment = getTargetFragment();
if (activity instanceof TimePickerDialogHandler) {
final TimePickerDialogHandler act = (TimePickerDialogHandler) activity;
act.onDialogTimeSet(mReference, mPicker.getHours(), mPicker.getMinutes());
} else if (fragment instanceof TimePickerDialogHandler) {
final TimePickerDialogHandler frag = (TimePickerDialogHandler) fragment;
frag.onDialogTimeSet(mReference, mPicker.getHours(), mPicker.getMinutes());
}
dismiss();
}
});
mPicker = (TimePicker) view.findViewById(R.id.time_picker);
mPicker.setSetButton(doneButton);
mPicker.setTheme(mTheme);
getDialog().getWindow().setBackgroundDrawableResource(mDialogBackgroundResId);
return view;
}
Aggregations