SimplifySpan


Source link: https://github.com/iwgang/SimplifySpan

SimplifySpan

A easy-to-use and powerful Spannable library

screenshot


gradle

compile 'com.github.iwgang:simplifyspan:2.0' 

Support Units

  • SpecialTextUnit
    • text (Constructor | String)
    • gravity (setGravity(gravity | int)) SpecialGravity.TOP, SpecialGravity.CENTER, SpecialGravity.BOTTOM
    • convertMode (setConvertMode(convertMode | int)) SpecialConvertMode.ONLY_FIRST, SpecialConvertMode.ALL, SpecialConvertMode.ONLY_LAST
    • textColor (Constructor Or setTextColor(int color))
    • textSize (Constructor Or setTextSize(float size)) ps
    • textBackgroundColor (setTextBackgroundColor(int color))
    • isShowUnderline (showUnderline())
    • isShowStrikeThrough (showStrikeThrough())
    • isTextBold (useTextBold())
    • clickableUnit (setClickableUnit(SpecialClickableUnit))
  • SpecialLabelUnit
    • text (Constructor | String)
    • gravity (setGravity(gravity | int)) SpecialGravity.TOP, SpecialGravity.CENTER, SpecialGravity.BOTTOM
    • convertMode (setConvertMode(convertMode | int)) SpecialConvertMode.ONLY_FIRST, SpecialConvertMode.ALL, SpecialConvertMode.ONLY_LAST
    • labelTextColor (Constructor | int color)
    • labelTextSize (Constructor | int color) sp
    • labelBgColor (Constructor | int color)
    • bitmap (Constructor | Bitmap)
    • labelBgRadius (setLabelBgRadius(float radius)) Only support labelBgColor
    • labelBgWidth And labelBgHeight (Constructor Or setLabelBgSize(int width, int height)) px
    • padding (setPadding(int padding)) px
    • paddingLeft (setPaddingLeft(int padding)) px
    • paddingRight (setPaddingRight(int padding)) px
    • labelBgBorderColor And borderSize (showBorder(int labelBgBorderColor, float borderSize | px))
    • isTextBold (useTextBold())
    • clickable See SimplifySpanBuild.appendMultiClickable() Or SimplifySpanBuild.appendMultiClickableToFirst()
  • SpecialImageUnit
    • text (Constructor | String)
    • gravity (setGravity(gravity | int)) SpecialGravity.TOP, SpecialGravity.CENTER, SpecialGravity.BOTTOM
    • convertMode (setConvertMode(convertMode | int)) SpecialConvertMode.ONLY_FIRST, SpecialConvertMode.ALL, SpecialConvertMode.ONLY_LAST
    • bitmap (Constructor)
    • width And height (Constructor) px
    • clickable See SimplifySpanBuild.appendMultiClickable() Or SimplifySpanBuild.appendMultiClickableToFirst()
  • SpecialClickableUnit
    • curTextView (Constructor | TextView)
    • onClickListener (Constructor | OnClickableSpanListener)
    • isShowUnderline (showUnderline())
    • pressTextColor (setPressTextColor(int color))
    • pressBgColor (setPressBgColor(int color))
    • normalTextColor (setNormalTextColor(int color))
    • normalBgColor (setNormalBgColor(int color))
  • SpecialRawSpanUnit
    • text (Constructor | String)
    • spanObj (Constructor) Spannable Object
    • flags (Constructor | int) Spannable flags

Support Methods

  • SimplifySpanBuild
    • append (string | Units)
    • appendToFirst (string | Units)
    • appendMultiClickable ()
    • appendMultiClickableToFirst ()
    • build ()

how to use ?

Sample Code

// sample 1 tvText.setText(new SimplifySpanBuild("????").append(new SpecialTextUnit("385", Color.BLUE)).append(" ?").build());
  // sample 2 CharSequence spannableString = new SimplifySpanBuild(" ??????Dock 2 ???USB3.0/??/esata ??HUB")

.appendToFirst(new SpecialLabelUnit("1212", Color.WHITE, sp2px(8), Color.RED, 70, 35).useTextBold().setGravity(SpecialGravity.CENTER))

.appendToFirst(new SpecialLabelUnit("??", Color.WHITE, sp2px(8), 0xFFFF5000, 60, 35).setGravity(SpecialGravity.CENTER))

.build();
 tvText.setText(spannableString);
 

Resources

A single adapter implementation for any scrolling view or ViewGroup.

This library consolidates the differences between BaseAdapter, RecyclerView.Adapter, PagerAdapter, and binding to ViewGroup into one unified API.

A powerful debug module that is fully pluggable, extendable, and very useful. It enables you to create your own Critter that contain UI elements which enable you configure your application on the fly.

It also can inject a right-facing DrawerLayout into your activity on top of all other content, making it very unobtrusive and accessible from everywhere within your application.

This is a simple small class that renders a progress in form of an filling arc shape. A progress text can be rendered additionally. This text is rendered in the secondary color for the 'done' area of the arc.

This library is created for get post and information from a blog or a website created with WordPress.

A sticker view for android application.

Collection of useful classes to design MVC applications.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes