Giter VIP home page Giter VIP logo

nativescript-letter-avatar's Introduction

nativescript-letter-avatar

Build GitHub license Maintenance Open Source Love

With this plugin you can create beautiful looking letter avatars in your nativescript app!

picture 1

Installation

Install the plugin from using tns plugin add nativescript-letter-avatar.

Usage

NativeScript Core:

Define the namespace

<Page class="page"
    loaded="pageLoaded"
    navigatingTo="onNavigatingTo" 
    xmlns="http://schemas.nativescript.org/tns.xsd"
    xmlns:ns="nativescript-letter-avatar">

Use the plugin:

<ns:LetterAvatar id="myAvatar" text="AB"></ns:LetterAvatar>

You can also add custom styles:

<ns:LetterAvatar color="blue" padding="5" borderRadius="7" id="myAvatar" text="AB"></ns:LetterAvatar> 

Unfortunately, CSS properties are not supported.

For more info and examples check out the demo folder.

Angular Version:

In your app.module.ts include the library like so:

import { LetterAvatarModule } from "nativescript-letter-avatar/angular";

and add it to the imports array:

@NgModule({
    bootstrap:  [
        ...
    ],
    declarations: [
        ...
    ],
    imports: [
        ...
        LetterAvatarModule, // <--- add this here
    ],
    schemas: [
        ...
    ],
})
export class AppModule { }

The use it in your .html file:

<LetterAvatar text="AB"></LetterAvatar>

You can add custom styles:

<LetterAvatar color="blue" padding="5" borderRadius="7" text="AB"></LetterAvatar>

Unfortunately, CSS properties are not supported.

For more info and examples check out the demo and the demo-angular folder.

License

MIT

nativescript-letter-avatar's People

Contributors

hrueger avatar greenkeeper[bot] avatar snyk-bot avatar dependabot-preview[bot] avatar dependabot[bot] avatar imgbotapp avatar

Watchers

James Cloos avatar  avatar

nativescript-letter-avatar's Issues

avatar color changes for same user

I am facing an issue where I am developing a chat app and each time the same user sends a message the color of his avatar changes. I would like to know if there is a way to consistently keep a specific color for each user(by assigning a unique ID to the avatar). For example when a new user is added to a chat room he will randomly be given a color and that color will only be his, his color won't change with every message he sends and no other user will have his color.

An in-range update of @ngtools/webpack is breaking the build 🚨

The devDependency @ngtools/webpack was updated from 8.3.23 to 8.3.24.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@ngtools/webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… security/gitguardian: GitGuardian did not find any leak. (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v8.3.24

Commits

@angular-devkit/build-angular (0.803.24)

Commit Description Notes
support TSLint 6.0+
remove unneeded regex polyfills


Special Thanks

Charles Lyding, Minko Gechev, CΓ©dric Exbrayat

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @ngtools/webpack is breaking the build 🚨

The devDependency @ngtools/webpack was updated from 8.3.21 to 8.3.22.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@ngtools/webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… security/gitguardian: GitGuardian did not find any leak. (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v8.3.22

Commits

@angular-devkit/build-angular (0.803.22)

Commit Description Notes
update browserslist and caniuse-lite [Closes #16560]
account for hashed and non hashed filesnames when having sourcemaps
add sourceMappingURL comment for ES2015 during differential loading [Closes #16522]
prevent differential loading double sourcemap search

@angular/cli (8.3.22)

Commit Description Notes
disable Browserslist old data warning


Special Thanks

Alan Agius, Minko Gechev, Charles Lyding

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of rimraf is breaking the build 🚨

The devDependency rimraf was updated from 3.0.0 to 3.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

rimraf is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… security/gitguardian: GitGuardian did not find any leak. (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of semver is breaking the build 🚨

The devDependency semver was updated from 7.1.1 to 7.1.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

semver is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… security/gitguardian: GitGuardian did not find any leak. (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 3 commits.

  • 8f4d96d 7.1.2
  • 70593f7 Remove the fancy preload logic in index.js
  • 70d9fb3 document preload and exported modules

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.
ERROR in node_modules/nativescript-letter-avatar/angular/letter-avatar.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (nativescript-letter-avatar/angular) which declares LetterAvatarModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

1 export declare class LetterAvatarModule {

Which platform(s) does your issue occur on?

  • iOS/Android/Both IOS
  • iOS/Android versions
  • emulator or device. What type of device? EMULATOR when trying to run tns run ios

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
    7.0.10

  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
    "@angular/animations": "^10.1.5",
    "@angular/common": "~10.0.9",
    "@angular/compiler": "~10.0.9",
    "@angular/core": "~10.0.9",
    "@angular/forms": "~10.0.9",
    "@angular/localize": "~10.0.9",
    "@angular/platform-browser": "~10.0.9",
    "@angular/platform-browser-dynamic": "~10.0.9",
    "@angular/router": "~10.0.9",
    "@angular/service-worker": "~10.0.9",
    "@nativescript/angular": "~10.1.0",
    "@nativescript/core": "~7.0.0",
    "@nativescript/theme": "~2.5.0",
    "@ng-bootstrap/ng-bootstrap": "^7.0.0",
    "@stomp/ng2-stompjs": "^7.2.0",
    "@types/node-rsa": "^1.0.0",
    "@types/socket.io-client": "^1.4.33",
    "aes-js": "^3.1.2",
    "angularx-social-login": "^3.2.1",
    "bootstrap": "^4.5.0",
    "constants": "0.0.2",
    "core-js": "^3.6.5",
    "cryptico": "^1.0.2",
    "crypto": "^1.0.1",
    "crypto-module": "^1.3.19",
    "event-source-polyfill": "^1.0.16",
    "idb": "^5.0.4",
    "mediasoup-client": "^3.6.12",
    "moment": "^2.27.0",

  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)

  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

Is there any code involved?

  • provide a code example to recreate the problem
  • (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.

An in-range update of @ngtools/webpack is breaking the build 🚨

The devDependency @ngtools/webpack was updated from 8.3.22 to 8.3.23.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@ngtools/webpack is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • βœ… security/gitguardian: GitGuardian did not find any leak. (Details).
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v8.3.23

Commits

@angular-devkit/build-angular (0.803.23)

Commit Description Notes
suppress duplicate 3rdpartylicenses.txt warning
update tree-kill dependency to 1.2.2
replace istanbul-instrumenter-loader with coverage-istanbul-loader [Closes #16576]
[Closes #7117]


Special Thanks

Alan Agius, Minko Gechev, Doug Parker, Charles Lyding

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Android app crashes if I set fontSize attribute on the component

Examples work fine however, if I try to set fontSize on the LetterAvatar component the app crashes with the following error

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method getView failed
System.err: TypeError: Cannot read property 'get' of undefined
System.err:
System.err: StackTrace:
System.err: setLocalValue(file:///node_modules/@nativescript/core/ui/core/properties/properties.js:426:0)
System.err: at push.../node_modules/@nativescript/angular/view-util.js.ViewUtil.setPropertyInternal(file:///node_modules/@nativescript/angular/view-util.js:290:0)
System.err: at push.../node_modules/@nativescript/angular/view-util.js.ViewUtil.setProperty(file:///node_modules/@nativescript/angular/view-util.js:263:0)

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.