Skip to content

Commit

Permalink
Merge pull request #37 from Grigory-Rylov/update_readme
Browse files Browse the repository at this point in the history
Update README.MD
  • Loading branch information
Grigory-Rylov authored Aug 19, 2023
2 parents 0f73577 + 97a5fd5 commit 97a3ad7
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 14 deletions.
11 changes: 10 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,16 @@ You will see ruler size in current units in status bar
**z** - reset zoom to 100%
**f** - fit zoom to layout panel width

<a href="https://www.buymeacoffee.com/grishberg" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
# Support me if you like YALI =)
**ETH ERC20 tokens** : `0x25Ca16AD3c4e9BD1e6e5FDD77eDB019386B68591`

**BNB BEP20 tokens** : `0x25Ca16AD3c4e9BD1e6e5FDD77eDB019386B68591`

**USDT TRC20** : `TSo3X6K54nYq3S64wML4M4xFgTNiENkHwC`

**BTC** : `bc1qmm5lp389scuk2hghgyzdztddwgjnxqa2awrrue`

https://www.tinkoff.ru/cf/4KNjR2SMOAj

# License

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ studioCompilePath=/Applications/Android Studio Preview.app/Contents

pluginGroup = com.github.grishberg.android
pluginName = android-layout-inspector-plugin
pluginVersion = 23.08.16.1
pluginVersion = 23.08.18.0

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.github.grishberg.android.layoutinspector.ui.dialogs

class SupportBalloon {
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class ShowLayoutInspectorAction : AsAction() {
return AdbWrapperImpl(project)
}
}
val provider = ConnectedDeviceInfoProvider(adbProvider, NotificationHelperImpl)
val notificationHelper = NotificationHelperImpl(project)
val provider = ConnectedDeviceInfoProvider(adbProvider, notificationHelper)

createUi()

Expand All @@ -42,6 +43,12 @@ class ShowLayoutInspectorAction : AsAction() {
prepareBaseDir(project)
)
main.initUi()

notificationHelper.supportInfo("Support me if you like YALI =)",
"BNB,ETH tokens : 0x25Ca16AD3c4e9BD1e6e5FDD77eDB019386B68591\n\n" +
"USDT TRC20 : TSo3X6K54nYq3S64wML4M4xFgTNiENkHwC\n\n" +
"BTC : bc1qmm5lp389scuk2hghgyzdztddwgjnxqa2awrrue\n\n" +
"https://www.tinkoff.ru/cf/4KNjR2SMOAj")
}

private fun prepareBaseDir(project: Project): File {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,38 @@ package com.github.grishberg.android.li.ui
import com.github.grishberg.androidstudio.plugins.NotificationHelper
import com.intellij.notification.NotificationDisplayType
import com.intellij.notification.NotificationGroup
import com.intellij.notification.NotificationGroupManager
import com.intellij.notification.NotificationType
import com.intellij.openapi.project.Project

object NotificationHelperImpl : NotificationHelper {
private val INFO = NotificationGroup("YALI (Logging)", NotificationDisplayType.NONE, true, null, null)
private val ERRORS = NotificationGroup("YALI (Errors)", NotificationDisplayType.BALLOON, true, null, null)
class NotificationHelperImpl(private val project: Project) : NotificationHelper {

override fun info(message: String) = sendNotification(message, NotificationType.INFORMATION, INFO)
override fun info(message: String) {
NotificationGroupManager.getInstance()
.getNotificationGroup("Notification Group")
.createNotification(escapeString(message), NotificationType.INFORMATION)
.notify(project)
}

override fun info(title: String, message: String) {
NotificationGroupManager.getInstance()
.getNotificationGroup("Notification Group")
.createNotification(title, escapeString(message), NotificationType.INFORMATION)
.notify(project)
}

override fun error(message: String) = sendNotification(message, NotificationType.ERROR, ERRORS)
override fun supportInfo(title: String, message: String) {
NotificationGroupManager.getInstance()
.getNotificationGroup("Support YALI Notification")
.createNotification(title, escapeString(message), NotificationType.INFORMATION)
.notify(project)
}

private fun sendNotification(
message: String,
notificationType: NotificationType,
notificationGroup: NotificationGroup
) {
notificationGroup.createNotification("YALI", escapeString(message), notificationType, null).notify(null)
override fun error(message: String) {
NotificationGroupManager.getInstance()
.getNotificationGroup("Error Notification Group")
.createNotification(escapeString(message), NotificationType.ERROR)
.notify(project)
}

private fun escapeString(string: String) = string.replace("\n".toRegex(), "\n<br />")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.github.grishberg.androidstudio.plugins

interface NotificationHelper {
fun info(message: String)
fun info(title: String, message: String)
fun supportInfo(title: String, message: String)

fun error(message: String)
}
3 changes: 3 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

<extensions defaultExtensionNs="com.intellij">
<applicationService serviceImplementation="com.github.grishberg.android.li.StorageService"/>
<notificationGroup id="Support YALI Notification" displayType="STICKY_BALLOON"/>
<notificationGroup id="Notification Group" displayType="STICKY_BALLOON"/>
<notificationGroup id="Error Notification Group" displayType="BALLOON"/>
</extensions>

<actions>
Expand Down

0 comments on commit 97a3ad7

Please sign in to comment.