Search in sources :

Example 26 with View

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);
        }
    }
}
Also used : View(android.view.View) Paint(android.graphics.Paint)

Example 27 with View

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);
            }
        }
    }
}
Also used : View(android.view.View) Paint(android.graphics.Paint)

Example 28 with View

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;
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 29 with 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();
    }
}
Also used : View(android.view.View)

Example 30 with View

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;
}
Also used : Button(android.widget.Button) Activity(android.app.Activity) View(android.view.View) Fragment(android.support.v4.app.Fragment) DialogFragment(android.support.v4.app.DialogFragment)

Aggregations

View (android.view.View)17009 TextView (android.widget.TextView)5834 ImageView (android.widget.ImageView)3323 ListView (android.widget.ListView)2098 RecyclerView (android.support.v7.widget.RecyclerView)1838 AdapterView (android.widget.AdapterView)1715 ViewGroup (android.view.ViewGroup)1568 Intent (android.content.Intent)1026 Paint (android.graphics.Paint)951 Button (android.widget.Button)876 OnClickListener (android.view.View.OnClickListener)808 AbsListView (android.widget.AbsListView)795 LayoutInflater (android.view.LayoutInflater)771 LinearLayout (android.widget.LinearLayout)656 ArrayList (java.util.ArrayList)638 RemoteView (android.widget.RemoteViews.RemoteView)600 ScrollView (android.widget.ScrollView)566 Rect (android.graphics.Rect)534 SuppressLint (android.annotation.SuppressLint)433 Context (android.content.Context)405