GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nekocode/DividerDrawable: Help to layout and draw dividers on android views.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
art
art
 
 
gradle/wrapper
gradle/wrapper
 
 
lib-dividerdrawable
lib-dividerdrawable
 
 
sample
sample
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

DividerDrawable

Apache 2.0 License Release

This library can help you easily layout and draw dividers on existing views. For better performance, don't create new views for drawing dividers anymore, use drawable instead.

Install

repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    compile 'com.github.nekocode:DividerDrawable:{lastest-version}'
}

Usage

Obtain a new DividerDrawable instance. And you can set the color and stroke witdh of the divider.

final DividerDrawable dividerDrawable = new DividerDrawable();
dividerDrawable.setStrokeWidth(10)
        .setColor(0xFFFFFFFF)

Similar to the view layout, the DividerDrawable also has a layout that can help draw divider to the relative position of the container(view/drawable/canvas).

dividerDrawable.getLayout()
        .setOrientation(DividerLayout.ORIENTATION_VERTICAL)
        .setAlign(DividerLayout.ALIGN_PARENT_BOTTOM)
        .setCenter(DividerLayout.CENTER_HORIZONTAL)
        .setMarginBottomDp(20);

You can use DividerUtils to easily combine the divider drawable to your existing backgroud drawable.

DividerUtils.addDividersTo(textView, dividerDrawable);

If you changed the divider's layout params, don't forget to notify the changes.

dividerDrawable.notifyLayoutChanged();

Screenshot

About

Help to layout and draw dividers on android views.

Topics

androidwidget

Resources

Readme
Apache-2.0 license
Activity

Stars

442 stars

Watchers

8 watching

Forks

32 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.