All Projects → hasankucuk → Socialtextview

hasankucuk / Socialtextview

Licence: apache-2.0
A simple custom Android TextView that highlights content such as Mention, Hashtag, Phone, Email and Url.

Programming Languages

kotlin
9241 projects

Labels

Projects that are alternatives of or similar to Socialtextview

Crankshaft
Crankshaft: A turnkey GNU/Linux solution that transforms a Raspberry Pi to an Android Auto head unit.
Stars: ✭ 1,703 (+773.33%)
Mutual labels:  phone
Simple Dialer
A handy phone call manager with phonebook, number blocking and multi-SIM support
Stars: ✭ 138 (-29.23%)
Mutual labels:  phone
Camera2
Camera App write with api 2
Stars: ✭ 156 (-20%)
Mutual labels:  phone
Ngx Validators
Validator library for Angular 2+
Stars: ✭ 128 (-34.36%)
Mutual labels:  phone
Vonage Python Sdk
Vonage Server SDK for Python. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Stars: ✭ 134 (-31.28%)
Mutual labels:  phone
Twilio
Twilio notifications channel for Laravel
Stars: ✭ 141 (-27.69%)
Mutual labels:  phone
Edk2 Sdm845
(Maybe) Generic edk2 port for sdm845
Stars: ✭ 84 (-56.92%)
Mutual labels:  phone
Libphonenumber Js
A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
Stars: ✭ 2,233 (+1045.13%)
Mutual labels:  phone
Remote Control Pc
Control Laptop using Android. Remote control PC consists of android as well as desktop app written in Java to control laptop using phone.
Stars: ✭ 136 (-30.26%)
Mutual labels:  phone
Plexus
Remove the fear of Android app compatibility on de-Googled devices.
Stars: ✭ 152 (-22.05%)
Mutual labels:  phone
Mini phone
A fast phone number lib for Ruby (binds to Google's C++ libphonenumber)
Stars: ✭ 131 (-32.82%)
Mutual labels:  phone
Msm8994 8992 Nt Arm64 Drivers
Desktop Windows (ARM64) driver collection for MSM8992/8994 SoCs.
Stars: ✭ 132 (-32.31%)
Mutual labels:  phone
Ngx Webcam
A simple Angular webcam component / pure & minimal, no flash-fallback
Stars: ✭ 148 (-24.1%)
Mutual labels:  phone
Laravel Phone
Phone number functionality for Laravel
Stars: ✭ 1,806 (+826.15%)
Mutual labels:  phone
Mobile Select Area
手机联动选择地区
Stars: ✭ 157 (-19.49%)
Mutual labels:  phone
Xiaoai
a tiny&smart AI & Repo for work for AI Survey百度云资源持续更新中,欢迎点赞star Min's blog 欢迎访问我的博客主页!(Welcome to my blog website !)https://liweimin1996.github.io/
Stars: ✭ 111 (-43.08%)
Mutual labels:  phone
Maruos
Your phone is your PC.
Stars: ✭ 1,814 (+830.26%)
Mutual labels:  phone
Unifiedcontactpicker
Stars: ✭ 178 (-8.72%)
Mutual labels:  phone
Ws Scrcpy
Web client prototype for scrcpy.
Stars: ✭ 164 (-15.9%)
Mutual labels:  phone
Arcoreinsideouttrackinggearvr
Inside Out Positional Tracking (6DoF) for GearVR/Cardboard/Daydream using ARCore v1.6.0
Stars: ✭ 150 (-23.08%)
Mutual labels:  phone

SocialTextView

API Android Arsenal Android Weekly

A simple custom Android TextView that highlights content such as Mention, Hashtag, Phone, Email and Url.

Setup

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

dependencies {
   implementation 'com.github.hasankucuk:SocialTextView:1.0.0'
}

Usage

    <com.hasankucuk.socialtextview.SocialTextView
        android:id="@+id/socialTextView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="15dp"
        android:text="This project was #developed by @hasankucuk as #opensource. \n
        [email protected] \n
        https://medium.com/@hasann.kucuk \n
        [email protected] \n
        +1 123456789"
        app:emailColor="#FF9E80"
        app:hashtagColor="#82B1FF"
        app:linkType="mention|hashtag|phone|email|url"
        app:mentionColor="#BCBCCF"
        app:normalTextColor="#18181F"
        app:phoneColor="#03A9F4"
        app:urlColor="#8BC34A" />

only for linking of the mention you specify

      val mentions: MutableList<String> = arrayListOf()
        mentions.add("@hasankucuk")
        socialTextView.setLinkedMention(mentions)

only for linking of the hashtag you specify

     val hashtags: MutableList<String> = arrayListOf()
        hashtags.add("#developed")
        socialTextView.setLinkedHashtag(hashtags)

To capture click events

        socialTextView.setLinkClickListener(object : SocialTextView.LinkClickListener {
            override fun onLinkClicked(linkType: LinkedType, matchedText: String) {

                when (linkType) {
                    TEXT -> {
                        Toast.makeText(this@MainActivity, "You are clicked type -> TEXT and value ->$matchedText", Toast.LENGTH_SHORT).show()
                    }
                    HASHTAG -> {
                        Toast.makeText(this@MainActivity, "You are clicked type -> HASHTAG and value ->$matchedText", Toast.LENGTH_SHORT).show()
                    }
                    MENTION -> {
                        Toast.makeText(this@MainActivity, "You are clicked type -> MENTION and value ->$matchedText", Toast.LENGTH_SHORT).show()
                    }
                    URL -> {
                        Toast.makeText(this@MainActivity, "You are clicked type -> URL and value ->$matchedText", Toast.LENGTH_SHORT).show()
                    }
                    EMAIL -> {
                        Toast.makeText(this@MainActivity, "You are clicked type -> EMAIL and value ->$matchedText", Toast.LENGTH_SHORT).show()
                    }
                    PHONE -> {
                        Toast.makeText(this@MainActivity, "You are clicked type -> PHONE and value ->$matchedText", Toast.LENGTH_SHORT).show()
                    }
                }
            }
        })

Attributes

Attribute Type Summary
app:linkType int hashtag-mention-url-phone-email
app:underLine int true or false
app:normalTextColor int Sets the text color of a normal text color.
app:hashtagColor color Sets the text color of a hashtag link in the text.
app:mentionColor color Sets the text color of a mention link in the text.
app:phoneColor color Sets the text color of a phone number link in the text.
app:emailColor color Sets the text color of an email link in the text.
app:urlColor color Sets the text color of a web url link in the text.
app:selectedColor color Sets the text color of a selected link in the text.

License

Copyright 2019 Hasan Küçük

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].