All Projects → EusebiuCandrea → ToolTipPopupWordTV

EusebiuCandrea / ToolTipPopupWordTV

Licence: Apache-2.0 license
ToolTipopupWordTV is an Open Source Android library that allows developers to easily open a popup with details by select a word from a textview.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to ToolTipPopupWordTV

WechatPopupWindow
高仿微信聊天界面长按弹框样式
Stars: ✭ 71 (+73.17%)
Mutual labels:  popup-window, popup, popwindow
Jbox
jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
Stars: ✭ 1,251 (+2951.22%)
Mutual labels:  popup-window, tooltip, popup
Popupwindow
PopupWindow is a simple Popup using another UIWindow in Swift
Stars: ✭ 401 (+878.05%)
Mutual labels:  popup-window, popup
Needs
🌂 An easy way to implement modern permission instructions popup.
Stars: ✭ 546 (+1231.71%)
Mutual labels:  popup-window, popup
Android Simple Tooltip
A simple library based on PopupWindow to create Tooltips on Android. 💚
Stars: ✭ 622 (+1417.07%)
Mutual labels:  popup-window, tooltip
Wpopup
一个简单使用并且高度定制的Popupwindow。超简单实现朋友圈点赞效果,并且只用一个WPopup!完全不用担心复用问题!点击切换动画效果等!
Stars: ✭ 269 (+556.1%)
Mutual labels:  popup-window, popup
React New Window
🔲 Pop new windows in React, using `window.open`.
Stars: ✭ 281 (+585.37%)
Mutual labels:  popup-window, popup
Basepopup
Android下打造通用便捷的PopupWindow弹窗库
Stars: ✭ 4,603 (+11126.83%)
Mutual labels:  popup-window, popup
Powermenu
🔥 The powerful and easiest way to implement modern material popup menu.
Stars: ✭ 822 (+1904.88%)
Mutual labels:  popup-window, popup
Cdalertview
Highly customizable alertview and alert/notification/success/error/alarm popup written in Swift
Stars: ✭ 1,056 (+2475.61%)
Mutual labels:  popup-window, popup
Jalert
jQuery alert/modal/lightbox plugin
Stars: ✭ 73 (+78.05%)
Mutual labels:  popup-window, popup
BalloonPopup
Forget Android Toast! BalloonPopup displays a round or squared popup and attaches it to a View, like a callout. Uses the Builder pattern for maximum ease. The popup can automatically hide and can persist when the value is updated.
Stars: ✭ 32 (-21.95%)
Mutual labels:  popup-window, popup
Semantic Ui
Semantic is a UI component framework based around useful principles from natural language.
Stars: ✭ 49,729 (+121190.24%)
Mutual labels:  tooltip, popup
Popbox.js
A tiny and simple stackable modal plugin for web apps
Stars: ✭ 295 (+619.51%)
Mutual labels:  popup-window, popup
React Layer Stack
Layering system for React. Useful for popover/modals/tooltip/dnd application
Stars: ✭ 152 (+270.73%)
Mutual labels:  tooltip, popup
Balloon
🎈 Modernized and sophisticated tooltips, fully customizable with an arrow and animations on Android.
Stars: ✭ 2,242 (+5368.29%)
Mutual labels:  tooltip, popup
Hint.css
A CSS only tooltip library for your lovely websites.
Stars: ✭ 8,158 (+19797.56%)
Mutual labels:  tooltip, tooltip-library
Tippyjs
Tooltip, popover, dropdown, and menu library
Stars: ✭ 9,433 (+22907.32%)
Mutual labels:  tooltip, popup
Xpopup
🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup v…
Stars: ✭ 6,106 (+14792.68%)
Mutual labels:  popup-window, popup
flycheck-popup-tip
Display Flycheck error messages using popup.el
Stars: ✭ 30 (-26.83%)
Mutual labels:  tooltip, popup

TooltipPopupWord


📢 ToolTipopupWordTV is an Open Source Android library, that allows you to easily open a popup like tooltip, fully customizable, with details about selected word from your text. 🎉



Demo

IMAGE ALT TEXT HERE

Including in your project

API AxdroidX Android Arsenal License

Gradle

Add below codes to your root build.gradle file.

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

And add a dependency code to your module's build.gradle file.

dependencies {
	        implementation 'com.github.EusebiuCandrea:ToolTipPopupWordTV:1.0.3'
	}

Features

  • Selectable word from text;
  • Show PopupWindow based on selected word;
  • Customizable textsize, typeface, color, backround and alignment;
  • Customizable ToolPopupWindows and Arrow
  • Customized layout.

Custom attributes for SelectableWordTextView

attribute name attribute description
highlightBackgroundColor The backround color of selected word.
highlightTextColor The text color of selected word.
setUnderline You can set a underline for selected word (true/false)

Usage

Basic Example (Kotlin)

Firstly, you need to add this custom text view to the layout of the class, with custom attributes

<com.ecandrea.library.tooltipopwordtv.wordTextView.SelectableWordTextView
        android:id="@+id/word"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="@dimen/space_30dp"
        android:textColor="@color/colorPrimaryDark"
        app:highlightBackgroundColor="@color/blue"
        app:highlightTextColor="@color/white"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:setUnderline="true" />

Here is a basic example of implementing ToolPopupWindows with a default layout using ToolPopupWindows.ToolTipBuilder class.

 word.apply {
        text = "Select a word from this example."
        setToolTipListener(object : SelectableWordListeners {
            override fun onWordSelected(anchorView: TextView, wordSelected: String, lineNumber: Int, width: Int) {
                val toolPopupWindows = ToolPopupWindows.ToolTipBuilder(this@MainActivity)
                    .setToolTipListener { Toast.makeText(applicationContext, "dismissed", Toast.LENGTH_SHORT).show() }
                    .setTitleTextColor(ContextCompat.getColor(this@MainActivity, R.color.colorAccent))
                    .setTitleTextSize(20f)
                    .setBackgroundColor(ContextCompat.getColor(this@MainActivity, R.color.colorPrimary))
                    .setIsOutsideTouchable(false)
                    .setArrowCustomizer(...)
                    .build()

                word.showToolTipWindow(anchorView, wordSelected, lineNumber, width, toolPopupWindows)
            }
        })
        }
        word.setBackgroundWordColor(ContextCompat.getColor(this, R.color.colorAccent))

Also, the arrow can be customized using an ArrowCustomizer.Builder class

 ArrowCustomizer.Builder(this@MainActivity)
    .setArrowColor(ContextCompat.getColor(this@MainActivity, R.color.colorAccent))
    .setArrowSize(20)
    .build()

Customized layout

We can fully customize the ToolPopupWindows layout using below method.

 .setCustomLayout(R.layout.custom_layout)

This is an example of implementing custom ToolPopupWindows.

Firstly create an xml layout file like custom_layout.

   val toolPopupWindows = ToolPopupWindows.ToolTipBuilder(this@MainActivity)
        .setToolTipListener { Toast.makeText(applicationContext, "dismissed", Toast.LENGTH_SHORT).show() }
        .setCustomLayout(R.layout.custom_layout)
        .setAutoDismissDuration(1500)
        .setIsOutsideTouchable(false)
        .setArrowCustomizer(ArrowCustomizer.Builder(this@MainActivity)
                .setArrowColor(ContextCompat.getColor(this@MainActivity, R.color.colorAccent))
                .setArrowSize(20)
                .build())
        .build()

And next we can get the inflated custom layout using getCustomInflatedView method.

 val inflatedView = toolPopupWindows.getCustomInflatedView()
        inflatedView?.let {
            it.newText.text = wordSelected
            it.newDescription.text = "Press remove button to delete this word!"
            it.testButton.setOnClickListener {
                removedWord(anchorView, wordSelected, wordTwo)
                toolPopupWindows.dismissTooltip()
            }
        }

⚠️ If you didn't added your custom layout this method can return null

ToolPopupWindows.ToolTipBuilder methods:

.setWidthPercentsFromScreen(value: Double)
.setBackgroundColor(value: Int)
.setBackgroundDrawable(@DrawableRes value: Int)
setTextTitle(value: String)
.setToolTipDescription(value: String)
.setTitleTextColor(@ColorInt value: Int)
.setTitleTextColorResource(@ColorRes value: Int)
.setTitleTextTypeface(value: Int)
.setTitleTextSize(@Sp value: Float)
.setDescriptionTextColor(@ColorInt value: Int)
// same for description
.setCustomLayout(value: Int)
.setAutoDismissDuration(value: Long)
.setIsOutsideTouchable(value: Boolean)
.setToolTipListener(listener: ToolTipListeners)
.setArrowCustomizer(value: ArrowCustomizer)
.setToolTipListener(unit: () -> Unit)
.build()

ArrowCustomizer.Builder methods:

.setArrowDrawable(value: Drawable?)
.setArrowDrawableResource(@DrawableRes value: Int)
.setArrowSize(@Px value: Int)
.setArrowColor(@ColorInt value: Int)
.setArrowColorResource(@ColorInt value: Int)
.setArrowVisibility(isVisible: Boolean)
.build()

Find this library useful? ❤️

Be free to use it and enjoy.

License

 Copyright 2020

   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].