This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addChatButton() { | |
const button = document.createElement('button'); | |
button.textContent = 'Tanya Assistant'; | |
button.classList.add('bg-blue-500', 'hover:bg-blue-700', 'text-white', 'font-bold', 'py-2', 'px-4', 'rounded', 'fixed', 'bottom-0', 'right-0'); | |
document.body.appendChild(button); | |
// Return the button element | |
return button; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<declare-styleable name="CustomizableButton"> | |
<attr name="cornerRadius" format="integer"/> | |
<attr name="isOutline" format="boolean"/> | |
<attr name="buttonState" format="enum"> | |
<enum name="primary" value="1"/> | |
<enum name="secondary" value="2"/> | |
<enum name="success" value="3"/> | |
<enum name="info" value="4"/> | |
<enum name="warning" value="5"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<com.abizareyhan.CustomizableButton | |
android:id="@+id/btnPrimary" | |
android:layout_width="match_parent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > | |
<solid android:color="@color/colorPrimary" /> | |
<padding | |
android:bottom="15dp" | |
android:left="20dp" | |
android:right="20dp" | |
android:top="15dp"/> | |
<corners | |
android:bottomLeftRadius="20dp" | |
android:bottomRightRadius="20dp" |