Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

Squint

> 设计协作
Open source

Provide Diagonal cut on view with awesome customization #DiagonalView

674 stars0 likes2 views
WebsiteGitHub

About

Provide Diagonal cut on view with awesome customization #DiagonalView

Squint

Provide Diagonal cut on view with awesome customization #DiagonalView

Demo App - IS Library

Preview

  • Provide Diagonal anywhere we want
  • Provide Tint filter on image
  • Provide Solid color shape
  • Fully Customizable

Usage

Step 1. Add the JitPack repository to your build file

groovy
allprojects {
        repositories {
            ...
            maven { url "https://jitpack.io" }
        }
    }

Step 2. Add the dependency

groovy
dependencies {
  compile 'com.github.IntruderShanky:Squint:3.0.1'
 }

Implementation

###XML Implementation:

xml
   

###Attributes ####Diagonal Angle

xml
 squint:angle

####Diagonal Gravity

xml
squint:gravity="left"
squint:gravity="right"
squint:gravity="top"
squint:gravity="bottom"

####Diagonal Direction

xml
squint:diagonalDirection="left_to_right"
squint:diagonalDirection="top_to_bottom"
squint:diagonalDirection="right_to_left"
squint:diagonalDirection="bottom_to_top"

####Background Tint Color (Color Shold have some alpha value, default value 55)

xml
squint:tint="@color/your_color"

####To make solid color Diagonal

xml
squint:solidColor="@color/your_color"

###Java Implementation:

java
DiagonalView diagonalView = (DiagonalView) findViewById(R.id.diagonal);

// to set image from resources        
diagonalView.setImageSource(R.drawable.your_image);

// to set bitmap
diagonalView.setBitmap(bitmap);

// to set the diagonal angle
diagonalView.setAngle(15);

// to set the diagonal gravity
diagonalView.setGravity(DiagonalView.Gravity.LEFT);

// to set the background color (color should have some alpha val)
diagonalView.setColorTint(Color.GREEN);

// to make the solid color diagonal
diagonalView.setSolidColor(Color.BLUE);

#Licence

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javadiagonalviewui-design

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category设计协作
PricingOpen source

> Related tools

F
Figma
协作式界面设计工具
S
sketch-wakatime
Sketch plugin for automatic time tracking and metrics generated from your Sketch usage.
Q
QuickColor
Quickly apply fills from the global or document color palettes to selected elements - 🎨