{"id":271867,"date":"2016-01-11T09:38:02","date_gmt":"2016-01-11T06:38:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271867"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271867","title":{"rendered":"Custom rounded view"},"content":{"rendered":"<p>       <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/raw.githubusercontent.com\/pasha656\/CustomView\/master\/screenshots\/result.png\" alt=\"image\" width=\"250\" height=\"200\" align=\"right\"\/><\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Instagram. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2013 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0438\u043c\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c. \u0418 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0436\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u043f\u043e\u0441\u0442, \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0439 \u0430\u0432\u0430\u0442\u0430\u0440, \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u041d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u0442\u0430\u043f<\/h5>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a android.widget.ImageView.<\/p>\n<pre><code class=\"java\">public class MyView extends ImageView {      public MyView(Context context, AttributeSet attrs) {         super(context, attrs);     } } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 init() \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u044b Paint \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<pre><code class=\"java\">public MyView(Context context, AttributeSet attrs) {         super(context, attrs);         init();     }      private void init() {         redBorder = new Paint();         redBorder.setAntiAlias(true);         redBorder.setColor(Color.RED);         redBorder.setStrokeWidth(redStrokeWidth);         redBorder.setStyle(Paint.Style.STROKE);          imgPaint = new Paint();         imgPaint.setAntiAlias(true);         imgPaint.setFilterBitmap(true);         imgPaint.setDither(true);     } <\/code><\/pre>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442 Paint redBoard \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0443 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0440\u0430\u043c\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438. \u0424\u043b\u0430\u0433 setAntiAlias(true) \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u0435. \u0417\u0430\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0446\u0432\u0435\u0442 (setColor(Color.RED)), \u0448\u0438\u0440\u0438\u043d\u0443 \u043a\u043e\u043d\u0442\u0443\u0440\u0430 setStrokeWidth(redStrokeWidth), redStrokeWidth \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f (private int redStrokeWidth = 10;) \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0442\u0438\u043b\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 setStyle(Paint.Style.STROKE) \u2014 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u0440\u0442\u0430\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430.<\/p>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442 Paint imgPaint \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435 \u0430\u0432\u0430\u0442\u0430\u0440\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0424\u043b\u0430\u0433 setFilterBitmap(true) \u0433\u043b\u0430\u0441\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u043b\u0438\u044f\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0441\u0442\u0440\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0424\u043b\u0430\u0433 setDither(true) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0446\u0432\u0435\u0442\u043e\u0432, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b.<\/p>\n<h5>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h5>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"java\">@Override     protected void onSizeChanged(int w, int h, int oldw, int oldh) {         super.onSizeChanged(w, h, oldw, oldh);         decrement = (w * decrementFactor)\/100;         bitmapPosition = decrement \/2;          Drawable drawable = getDrawable();         if (drawable != null) {             Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();             roundBitmap = getRoundedCroppedBitmap(bitmap, getWidth() - decrement);         } else {             Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);             roundBitmap = getRoundedCroppedBitmap(bitmap, getWidth() - decrement);         }     } <\/code><\/pre>\n<p>  \u0422.\u043a. \u043f\u0440\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0440\u0430\u043c\u043a\u0443 \u0438 \u043e\u0442\u0441\u0442\u0443\u043f \u043e\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0432\u0432\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e decrementFactor \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0438, \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c 15% \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (private int decrementFactor = 15;). \u0422.\u0435. \u0441\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 w, \u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 15% \u043c\u0435\u043d\u044c\u0448\u0435. \u0422\u0430\u043a \u0436\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 bitmapPosition, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0434 \u043d\u0438\u043c (\u043c\u0435\u0442\u043e\u0434 getRoundedCroppedBitmap()) \u0438\u043d\u0430\u0447\u0435, \u0431\u0435\u0440\u0435\u043c \u043b\u043e\u0433\u043e\u0442\u0438\u043f. <\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 getRoundedCroppedBitmap() \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"java\">private Bitmap getRoundedCroppedBitmap(Bitmap bitmap, int radius) {         Bitmap finalBitmap = bitmap.createScaledBitmap(bitmap, radius , radius, false);         Bitmap output = Bitmap.createBitmap(finalBitmap.getWidth(), finalBitmap.getHeight(), Bitmap.Config.ARGB_8888);         Rect rect = new Rect(0, 0, output.getWidth(), output.getHeight());          Canvas canvas = new Canvas(output);         canvas.drawCircle(                 finalBitmap.getWidth()  \/ 2,                 finalBitmap.getHeight() \/ 2,                 finalBitmap.getWidth() \/ 2,                 imgPaint);          imgPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));         canvas.drawBitmap(finalBitmap, rect, rect, imgPaint);          return output;     } <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 createScaledBitmap() \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u043c\u0430\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u043e\u0432\u043e\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 Rect rect, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c bitmap. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c canvas, \u0440\u0443\u0441\u0443\u0435\u043c \u043a\u0440\u0443\u0433 \u0438 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Paint \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0440\u0435\u0436\u0438\u043c Xfermode \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u043f\u043e\u0432\u0435\u0440\u0445 \u0443\u0436\u0435 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0422.\u0435. \u043c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0442\u043e\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d. \u041d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b\u0438 \u043d\u0430\u0434 \u044d\u0442\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u0440\u0443\u0433 \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043b\u0438 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0440\u0443\u0433\u0430 \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0441\u043a\u0430\u0437\u0430\u0432, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u0440\u0443\u0433. <\/p>\n<p>  \u041d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"java\">@Override  protected void onDraw(Canvas canvas) {      canvas.drawBitmap(roundBitmap, bitmapPosition, bitmapPosition, null);      if (imgSelected) {          canvas.drawCircle(getWidth() \/ 2, getHeight() \/ 2, getWidth() \/ 2 - redStrokeWidth, redBorder);      }  } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u043d\u0430\u0448 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u044f, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"java\">@Override     public boolean onTouchEvent(MotionEvent event) {         switch (event.getAction()) {             case MotionEvent.ACTION_DOWN:                 Animation scale = AnimationUtils.loadAnimation(getContext(), R.anim.scale);                 startAnimation(scale);                 break;             case MotionEvent.ACTION_UP:                 imgSelected = !imgSelected;                 invalidate();                 Animation scale2 = AnimationUtils.loadAnimation(getContext(), R.anim.scale_2);                 startAnimation(scale2);                 break;         }         return true;     } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c xml-\u0444\u0430\u0439\u043b \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"xml\">&lt;scale xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:fromXScale=&quot;1.0&quot;     android:toXScale=&quot;0.9&quot;     android:fromYScale=&quot;1.0&quot;     android:toYScale=&quot;0.9&quot;     android:duration=&quot;200&quot;     android:pivotX=&quot;50%&quot;     android:pivotY=&quot;50%&quot;     android:fillAfter=&quot;true&quot;&gt; &lt;\/scale&gt; <\/code><\/pre>\n<p>  \u0410 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043f\u0443\u0441\u0442\u0438\u0442 \u043f\u0430\u043b\u0435\u0446, \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u043a\u0440\u0430\u0441\u043d\u0443\u044e \u0440\u0430\u043c\u043a\u0443 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442:<\/p>\n<pre><code class=\"xml\">&lt;scale xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot;     android:fromXScale=&quot;1.0&quot;     android:toXScale=&quot;1.1&quot;     android:fromYScale=&quot;1.0&quot;     android:toYScale=&quot;1.1&quot;     android:duration=&quot;200&quot;     android:pivotX=&quot;50%&quot;     android:pivotY=&quot;50%&quot;     android:fillAfter=&quot;true&quot;&gt; &lt;\/scale&gt; <\/code><\/pre>\n<p>  <\/p>\n<h5>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h5>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043c\u0438\u043b\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0435\u0439. <\/p>\n<p>  \u041a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/pasha656\/CustomView\/tree\/master\/RoundedImg\">git<\/a>.<\/p>\n<p>  \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c. \u0421\u043f\u0430\u0441\u0438\u0431\u043e.<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/pasha656\/CustomView\/master\/screenshots\/RoundedImg.gif\" alt=\"image\" width=\"250\" height=\"400\"\/>       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274801\/\"> http:\/\/habrahabr.ru\/post\/274801\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/raw.githubusercontent.com\/pasha656\/CustomView\/master\/screenshots\/result.png\" alt=\"image\" width=\"250\" height=\"200\" align=\"right\"\/><\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 Instagram. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u2013 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0438\u043c\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c. \u0418 \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0436\u0435\u043b\u0430\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u043f\u043e\u0441\u0442, \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0439 \u0430\u0432\u0430\u0442\u0430\u0440, \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-271867","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271867","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271867"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271867\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271867"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271867"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271867"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}