Home | History | Annotate | Download | only in com.example.android.clippingbasic

Lines Matching refs:view

23 import android.view.LayoutInflater;
24 import android.view.View;
25 import android.view.ViewGroup;
26 import android.view.ViewOutlineProvider;
31 * This sample shows how to clip a {@link View} using an {@link Outline}.
58 public View onCreateView(
64 public void onViewCreated(final View view, Bundle savedInstanceState) {
65 super.onViewCreated(view, savedInstanceState);
68 mTextView = (TextView) view.findViewById(R.id.text_view);
72 final View clippedView = view.findViewById(R.id.frame);
74 /* Sets the OutlineProvider for the View. */
78 view.findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
80 public void onClick(View bt) {
81 // Toggle whether the View is clipped to the outline
83 /* The Outline is set for the View, but disable clipping. */
89 /* Enables clipping on the View. */
99 view.findViewById(R.id.text_view).setOnClickListener(new View.OnClickListener() {
101 public void onClick(View view) {
126 * A {@link ViewOutlineProvider} which clips the view with a rounded rectangle which is inset
132 public void getOutline(View view, Outline outline) {
133 final int margin = Math.min(view.getWidth(), view.getHeight()) / 10;
134 outline.setRoundRect(margin, margin, view.getWidth() - margin,
135 view.getHeight() - margin, margin / 2);