Sunday, May 11, 2025
Alternative Way
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use
No Result
View All Result
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use
No Result
View All Result
Alternative Way
No Result
View All Result

A library which provides you with Squircle views to use for buttons

Gordon James by Gordon James
October 3, 2021
in World Tech Code
0 0
0
Home World Tech Code

Squircle is a library that creates circular views, which you can use for buttons. This is particularly useful if you are developing an application with multiple buttons in one screen, or if you want to design a menu with circular views.

Squircle-Views is a new library that lets you create content-aware, content-switching buttons—or Squircle Views—like those you see on the Facebook, Google, and Twitter apps. The library comes with a bunch of ready-to-use views that give you a lot of control to create your own content-aware, content-switching buttons—or Squircle Views—in no time!

SquircleView allows you to create a circular button that rotates around its center, and which can have different levels of transparency to match your design style. By using the SquircleView library, you will be able to easily build a button for iOS or Android that will look just the same across all platforms.

Table of Contents

Toggle
  • Circle display
  • Screenshots
  • Target
  • Use
      • SquircleImageView
      • Square key
      • RectangleConstraintLayout
      • Load image
        • Normal image loading
        • Load an image with an image-loading library such as Glide:
    • Attributes
    • Methods
      • Example:
  • Android Forms
    • ShapeExterior
    • ShapeDrawable
    • Methods and classes
      • Methods
      • Classes
  • Todo
  • GitHub
      • Related Tags:

Circle display

SquircleView is a library that provides you with circle views to use in buttons, views, etc.

Screenshots

Different kinds of buttons, layouts and images you can create

A library which provides you with Squircle views to use for buttons

Target

Add the Maven repository to the root file build.gradle :

allprojects {
repositories {
mavenCentral()
}
}

Also add the SquircleView dependency to your application’s build.gradle

Dependencies {
deployment app.juky:squircleview:0.0.3
}

Use

For all use cases, see the application example, which includes many different configurations.

SquircleImageView

This view extends the AppCompatImageView that you can use for a Squirl image.

 

Square key

This view extends AppCompatTextView, which you can use to create a button with a square

 

RectangleConstraintLayout

This view extends ConstraintLayout, which allows you to add all kinds of views to your squirt, such as. B. Symbols or
complex layout with text and symbols.

 

 

Load image

You can use the setBackgroundImage method to load an image into each view, or you can use your favorite
library to load the images for you. We support Glide, Picasso, Fresco, Coil, etc.

Normal image loading

my_squircle_image_view.setBackgroundImage(ContextCompat.getDrawable(context, R.drawable.my_image))

Load an image with an image-loading library such as Glide:

Glide.with(this).load(R.drawable.my_image)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(my_squirkle_image_view)

Attributes

Show background image

Gradient pattern displayed in the view

Starting colour of the gradient

Graduated end color

Color of the border

Attribute Type Standard Description
squirrel background image Link
background colour of the squirrel Color #000000 Background colour of the presentation
ecureuil_gradient_drawable Link
squirrel_start_color Color
end of the squirrel’s colour sequence Color
gradient_twist direction enum TOP_BELOW_RIGHT Gradient direction (gradient only)
height of the squirrel’s shadow Size Default value for the supervisor Rise of the Shadow
color_shadow_high_scroll Color #42000000 Color of the shadows
color of the edge of the squirrel Color
Width of kerb Size 0 Width restriction
squirrel_ripple_enabled boolean true (false for SquircleImageView) Ripple is on or off

Methods

The properties of the views can be changed by configuring them with the following variables/methods. This can be accessed through the view’s style property. Message: Only put color sources in variables with the suffix Res, otherwise your colors won’t work.

// Getter / Setter
property var backgroundImage : Raster image ?
var backgroundColor : Int
var backgroundColorRes : Int
var shadowElevation : Float
var shadowElevationColor : Int
var shadowElevationColorRes : Int
var gradientDrawable : GradientDrawable ?
var gradientStartColor : Int
var gradientStartColorRes : Int
var gradientEndColor : Int
var gradientEndColorRes : Int
var gradientDirection : GradientDirection
var borderColor : Int
var borderColorRes : Int
var borderWidth : Float
var rippleEnabled : Boolean

// Methods
fun setBackgroundImage(drawable : Drawable ?)
fun setBackgroundImage(resId : Int)
fun setGradientDrawable(resId : Int)
fun setGradientDirection(angle : Int)

Example:

trap button = findViewById(R.id.button)
button.style.backgroundColor = Color.RED
button.style.backgroundColorRes = R.color.teal_200

Android Forms

As you may have noticed, Android supports custom
shapes that can be applied to buttons, images,
formatting constraints, etc. I decided to create a custom view to provide some flexibility in using
gradients and other features that don’t work well with shapes. If you want to continue using ShapeDrawable /
ShapeAppearance, I decided to add this feature to the library. Note that this is only supported programmatically by
, not XML.

ShapeExterior

binding.buttonWithShapeDrawable.shapeAppearanceModel = SquircleShape.getShapeAppearance().build()

ShapeDrawable

// The background color was not saved, so it must be applied again
binding.constraintLayoutWithShapeDrawable.background =
SquircleShape.getShapeDrawable(binding.constraintLayoutWithShapeDrawable).apply {
this.paint.apply {
this.color = ContextCompat.getColor(this, R.color.my_color)
}
}

Methods and classes

Methods

// SquircleShape derived methods
fun getSquirclePath(rect : RectF, width : Int, height : Int) : ShapePath
fun getShapeAppearance() : ShapeAppearanceModel.Builder
fun getShapeDrawable(view : View) : ShapeDrawable

Classes

If you want to apply Squircle only to a specific corner, you can use a custom implementation of CutCornerTreatment
called SquircleCornerTreatment.

Todo

  • Internal shadow support
  • Provisions other than ConstraintLayout
  • X] Openbaarmaking van alle kenmerken per methode
  • [ ] Make sure it works on PLC 21 – 30
  • Check Java support
  • Performance test with a large number of bitmaps
  • Add tests
  • Documentation code
  • Option to detect the text color of the background/image
  • Use the exact angle of the slope instead of linking it to a line segment.
  • [ ] Strengthen the outer edges of the shadow
  • Jetpack Compose support
  • Reduced invalidate() calls when changing multiple style properties

GitHub

https://github.com/Juky-App/SquircleViewSquircle is an amazing library with tons of useful features, but one of the most useful is its special views that allow you to use Squircle like buttons that can be used in such diverse ways. You can use them to make buttons that look like Twitter buttons, or Facebook buttons, or even buttons that look like a message or phone call button.. Read more about superellipse svg and let us know what you think.

Related Tags:

squircle androidsquircle csssquircle svgcss superellipsesuperellipse svgbutton maker machine,People also search for,Privacy settings,How Search works,squircle android,squircle css,squircle svg,css superellipse,superellipse svg,button maker machine

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Share 0
ShareTweet
Gordon James

Gordon James

Next Post
An elegant manager to easily deal with UIPickerView

An elegant manager to easily deal with UIPickerView

  • Trending
  • Comments
  • Latest
How To Get Free Internet On Android Without Service

How To Get Free Internet On Android Without Service

March 10, 2022
🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

🥇 +4 Neo Geo Emulators for Android  List ▷ 2021

October 3, 2021

Fix: Notifications not working on Nova Launcher

October 3, 2021
How to Fix OpenVPN Connected but Not Changing IP Address

How to Fix OpenVPN Connected but Not Changing IP Address

October 3, 2021

Setting Up Directory Sync Between On-Premises Active Directory with Microsoft 365 Azure AD

0
🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

🥇 DELETE ACCOUNT from PS4  ▷ Step by Step Guide ▷ 2020

0
🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

🥇 PPTX File Extension  What is .Pptx and how to open them? ▷ 2020

0
🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

🥇 Make a Crossword in Microsoft Word  Step by Step Guide ▷ 2020

0
What to Know About Car Shipping Services

What to Know About Car Shipping Services

May 7, 2025
CS2 Skins-Why Trade Them?

CS2 Skins-Why Trade Them?

May 7, 2025
Alternative Routes: Successfully Exiting Your Wyndham Timeshare Without The Stress

Alternative Routes: Successfully Exiting Your Wyndham Timeshare Without The Stress

May 6, 2025
The Ultimate Seiko Watch Gift Guide

The Ultimate Seiko Watch Gift Guide

May 1, 2025

There's always an alternative Way!
Find us at 4145 Zolynthian Street, Vylorthos, QP 78425
No Result
View All Result
  • Home
  • Latest
    • Latest
  • News
  • World Tech
  • World Gaming
  • Minecraft
  • Guides
  • Contact Us
  • About The Team
    • Privacy Policy
    • Terms of Use

© 2022 - Alternative Way

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT
No Result
View All Result
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
  • Travel News

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.