Code Monkey home page Code Monkey logo

sizeadjustingtextview's Introduction

.github/workflows/main.yml Quality Gate Status

SizeAdjustingTextView

This is based on an open source autosizing text component for Hmos.

Source

Inspired by erchenger/SizeAdjustingTextView

Feature

SizeAdjustingTextView is a library that allows user to input text of any length of characters which will auto resize the text within the custom component. Resizing multiple lines in the text component to keep up the changes.

Dependency

  1. For using sizeadjustingtextview module in sample app, include the source code and add the below dependencies in entry/build.gradle to generate hap/support.har.
    dependencies {
       implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
       implementation project(path: ':sizeadjustingtextview')
       testImplementation 'junit:junit:4.13'
       ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
}
  1. For using sizeadjustingtextview in separate application using har file, add the har file in the entry/libs folder and add the dependencies in entry/build.gradle file.
        dependencies {
             implementation fileTree(dir: 'libs', include: ['*.har'])
             testImplementation 'junit:junit:4.13'
        }
  1. For using sizeadjustingtextview from a remote repository in separate application, add the below dependencies in entry/build.gradle file.
         dependencies {
             implementation 'dev.applibgroup:sizeadjustingtextview:1.0.0'
             testCompile 'junit:junit:4.13'
         }

Usage

In code

XML: 
<com.omitneedlesscode.sizeadjustingtextview.SizeAdjustingTextView
        ohos:id="$+id:topBox"
        ohos:height="75vp"
        ohos:width="match_parent"
        ohos:background_element="#EE00FF"
        ohos:below="$id:text_input"
        ohos:multiple_lines="true"
        ohos:padding="0vp"
        ohos:text_alignment="center"
        ohos:text_color="#000000"
        ohos:text_size="32fp"/>

JAVA:
        SizeAdjustingTextView mTopMessageBox = (SizeAdjustingTextView) findComponentById(ResourceTable.Id_topBox);
        TextMover.moveTextFromCellToCell(mBottomMiddleBox, mBottomRightBox);

sizeadjustingtextview's People

Contributors

raghavb932 avatar gleelakrishna avatar

Watchers

Sharath KS avatar

Forkers

raghavb932

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.