Skip to content

Commit b5fbd8e

Browse files
authored
chore(plugin): utilities code refactored (#285)
* init * removed utilities dependency from plugin module * selector util created * fixes * fixes
1 parent ff1d69e commit b5fbd8e

File tree

101 files changed

+296
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+296
-188
lines changed

pluto-plugins/base/lib/build.gradle

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ android {
1919
compileSdkVersion rootProject.compileSdkVersion
2020
buildToolsVersion rootProject.buildToolsVersion
2121

22-
buildFeatures {
23-
viewBinding true
24-
}
25-
26-
2722
defaultConfig {
2823
minSdkVersion rootProject.minSdkVersion
2924
targetSdkVersion rootProject.targetSdkVersion
@@ -52,18 +47,6 @@ android {
5247
}
5348

5449
dependencies {
55-
// api project(path: ':utilities')
56-
api "androidx.core:core-ktx:$androidXCoreVersion"
57-
api 'androidx.appcompat:appcompat:1.4.0'
58-
59-
api 'androidx.cardview:cardview:1.0.0'
60-
api 'androidx.constraintlayout:constraintlayout:2.1.2'
61-
api 'androidx.navigation:navigation-fragment-ktx:2.3.5'
62-
api 'androidx.recyclerview:recyclerview:1.2.1'
63-
64-
api 'com.google.android.material:material:1.6.1'
65-
66-
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.0'
67-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
68-
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
50+
implementation "androidx.core:core-ktx:$androidXCoreVersion"
51+
implementation 'androidx.appcompat:appcompat:1.4.0'
6952
}

pluto-plugins/base/lib/src/main/java/com/pluto/plugin/DataModel.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.pluto.plugin
22

33
import androidx.annotation.DrawableRes
4-
import com.pluto.utilities.list.ListItem
54

65
data class DeveloperDetails(
76
val vcsLink: String? = null,
@@ -13,9 +12,9 @@ data class PluginConfiguration(
1312
val name: String,
1413
@DrawableRes val icon: Int = R.drawable.pluto___ic_plugin_placeholder_icon,
1514
val version: String
16-
) : ListItem()
15+
)
1716

1817
data class PluginGroupConfiguration(
1918
val name: String,
2019
@DrawableRes val icon: Int = R.drawable.pluto___ic_plugin_group_placeholder_icon,
21-
) : ListItem()
20+
)

pluto-plugins/base/lib/src/main/java/com/pluto/plugin/Plugin.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package com.pluto.plugin
33
import android.app.Application
44
import android.content.Context
55
import android.os.Bundle
6+
import android.widget.Toast
7+
import android.widget.Toast.LENGTH_SHORT
68
import androidx.annotation.Keep
79
import androidx.fragment.app.Fragment
8-
import com.pluto.utilities.DebugLog
9-
import com.pluto.utilities.extensions.toast
1010

1111
@Keep
1212
abstract class Plugin(val identifier: String) : PluginEntity(identifier) {
@@ -49,8 +49,8 @@ abstract class Plugin(val identifier: String) : PluginEntity(identifier) {
4949
abstract fun onPluginInstalled()
5050
abstract fun onPluginDataCleared()
5151

52+
@SuppressWarnings("UnusedPrivateMember")
5253
fun onPluginViewCreated(savedInstanceState: Bundle?) {
53-
DebugLog.d("pluto_plugin", "view switched :: ${getConfig().name} : $savedInstanceState")
54-
context.toast("View switched to ${getConfig().name}")
54+
Toast.makeText(context, "View switched to ${getConfig().name}", LENGTH_SHORT).show()
5555
}
5656
}

pluto-plugins/base/lib/src/main/java/com/pluto/plugin/PluginEntity.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package com.pluto.plugin
22

33
import android.app.Application
4-
import com.pluto.utilities.list.ListItem
54

6-
abstract class PluginEntity(private val identifier: String) : ListItem() {
5+
abstract class PluginEntity(private val identifier: String) {
76

87
abstract fun install(application: Application)
98
override fun equals(other: Any?): Boolean = other is PluginEntity && identifier == other.identifier

pluto-plugins/base/lib/src/main/res/drawable/pluto___ic_plugin_group_placeholder_icon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
android:viewportWidth="24"
55
android:viewportHeight="24">
66
<path
7-
android:fillColor="@color/pluto___dark"
7+
android:fillColor="@color/pluto___plugin_group_color"
88
android:pathData="M6,13c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM6,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM6,9c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM3,9.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM6,5c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM21,10.5c0.28,0 0.5,-0.22 0.5,-0.5s-0.22,-0.5 -0.5,-0.5 -0.5,0.22 -0.5,0.5 0.22,0.5 0.5,0.5zM14,7c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1 -1,0.45 -1,1 0.45,1 1,1zM14,3.5c0.28,0 0.5,-0.22 0.5,-0.5s-0.22,-0.5 -0.5,-0.5 -0.5,0.22 -0.5,0.5 0.22,0.5 0.5,0.5zM3,13.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM10,20.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM10,3.5c0.28,0 0.5,-0.22 0.5,-0.5s-0.22,-0.5 -0.5,-0.5 -0.5,0.22 -0.5,0.5 0.22,0.5 0.5,0.5zM10,7c0.55,0 1,-0.45 1,-1s-0.45,-1 -1,-1 -1,0.45 -1,1 0.45,1 1,1zM10,12.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM18,13c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM18,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM18,9c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM18,5c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM21,13.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM14,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM14,20.5c-0.28,0 -0.5,0.22 -0.5,0.5s0.22,0.5 0.5,0.5 0.5,-0.22 0.5,-0.5 -0.22,-0.5 -0.5,-0.5zM10,8.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM10,17c-0.55,0 -1,0.45 -1,1s0.45,1 1,1 1,-0.45 1,-1 -0.45,-1 -1,-1zM14,12.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM14,8.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5z" />
99
</vector>

pluto-plugins/base/lib/src/main/res/drawable/pluto___ic_plugin_placeholder_icon.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
android:viewportWidth="24"
55
android:viewportHeight="24">
66
<path
7-
android:fillColor="@color/pluto___dark_40"
7+
android:fillColor="@color/pluto___plugin_color"
88
android:pathData="M11,3.23c0,-0.64 -0.59,-1.13 -1.21,-0.99 -1.12,0.26 -2.18,0.7 -3.12,1.3 -0.53,0.34 -0.61,1.1 -0.16,1.55 0.32,0.32 0.83,0.4 1.21,0.16 0.77,-0.49 1.62,-0.85 2.54,-1.05 0.44,-0.1 0.74,-0.51 0.74,-0.97zM17.33,3.55c-0.94,-0.6 -2,-1.04 -3.12,-1.3 -0.62,-0.14 -1.21,0.34 -1.21,0.98 0,0.45 0.3,0.87 0.74,0.96 0.91,0.2 1.77,0.57 2.53,1.05 0.39,0.24 0.89,0.17 1.21,-0.16 0.46,-0.44 0.39,-1.19 -0.15,-1.53zM20.77,11c0.64,0 1.13,-0.59 0.99,-1.21 -0.26,-1.12 -0.7,-2.18 -1.3,-3.12 -0.34,-0.53 -1.1,-0.61 -1.55,-0.16 -0.32,0.32 -0.4,0.83 -0.16,1.21 0.49,0.77 0.85,1.62 1.05,2.53 0.1,0.45 0.51,0.75 0.97,0.75zM5.1,6.51c-0.46,-0.45 -1.21,-0.38 -1.55,0.16 -0.6,0.94 -1.04,2 -1.3,3.12 -0.14,0.62 0.34,1.21 0.98,1.21 0.45,0 0.87,-0.3 0.96,-0.74 0.2,-0.91 0.57,-1.77 1.05,-2.53 0.26,-0.39 0.18,-0.9 -0.14,-1.22zM3.23,13c-0.64,0 -1.13,0.59 -0.99,1.21 0.26,1.12 0.7,2.17 1.3,3.12 0.34,0.54 1.1,0.61 1.55,0.16 0.32,-0.32 0.4,-0.83 0.15,-1.21 -0.49,-0.76 -0.85,-1.61 -1.05,-2.53 -0.09,-0.45 -0.5,-0.75 -0.96,-0.75zM15,12c0,-1.66 -1.34,-3 -3,-3s-3,1.34 -3,3 1.34,3 3,3 3,-1.34 3,-3zM18.9,17.49c0.45,0.45 1.21,0.38 1.55,-0.15 0.6,-0.94 1.04,-2 1.3,-3.11 0.14,-0.62 -0.35,-1.21 -0.98,-1.21 -0.45,0 -0.87,0.3 -0.96,0.74 -0.2,0.91 -0.57,1.76 -1.05,2.53 -0.26,0.37 -0.18,0.88 0.14,1.2zM13,20.77c0,0.64 0.59,1.13 1.21,0.99 1.12,-0.26 2.17,-0.7 3.12,-1.3 0.54,-0.34 0.61,-1.1 0.16,-1.55 -0.32,-0.32 -0.83,-0.4 -1.21,-0.15 -0.76,0.49 -1.61,0.85 -2.53,1.05 -0.45,0.09 -0.75,0.5 -0.75,0.96zM6.67,20.45c0.95,0.6 2,1.04 3.12,1.3 0.62,0.14 1.21,-0.35 1.21,-0.98 0,-0.45 -0.3,-0.87 -0.74,-0.96 -0.91,-0.2 -1.77,-0.57 -2.53,-1.05 -0.39,-0.24 -0.89,-0.17 -1.21,0.16 -0.46,0.44 -0.39,1.19 0.15,1.53z"/>
99
</vector>
Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<color name="pluto___colorPrimary">#008577</color>
4-
<color name="pluto___colorPrimaryDark">#00574B</color>
5-
<color name="pluto___colorAccent">@color/pluto___text_dark_60</color>
6-
7-
<color name="pluto___app_bg">#f8f8f8</color>
8-
<color name="pluto___divider_bg">#eeecec</color>
9-
<color name="pluto___key_value_divider_bg">#f0f0f0</color>
10-
<color name="pluto___key_value_bg">#f6f6f6</color>
11-
<color name="pluto___white">#ffffff</color>
12-
<color name="pluto___dark">#11141c</color>
13-
<color name="pluto___dark_05">#0D11141c</color>
14-
<color name="pluto___dark_10">#1A11141c</color>
15-
<color name="pluto___dark_20">#3311141c</color>
16-
<color name="pluto___dark_40">#6611141c</color>
17-
<color name="pluto___dark_60">#9911141c</color>
18-
<color name="pluto___dark_80">#cc11141c</color>
19-
20-
<color name="pluto___text_dark">#231f40</color>
21-
<color name="pluto___text_dark_20">#33231f40</color>
22-
<color name="pluto___text_dark_40">#66231f40</color>
23-
<color name="pluto___text_dark_60">#99231f40</color>
24-
<color name="pluto___text_dark_80">#cc231f40</color>
25-
<color name="pluto___popup_background">@color/pluto___dark</color>
26-
<color name="pluto___white_05">#0Dffffff</color>
27-
<color name="pluto___white_10">#1Affffff</color>
28-
<color name="pluto___white_20">#33ffffff</color>
29-
<color name="pluto___white_40">#66ffffff</color>
30-
<color name="pluto___white_60">#99ffffff</color>
31-
<color name="pluto___white_80">#ccffffff</color>
32-
<color name="pluto___red_dark">#e50914</color>
33-
<color name="pluto___red">#ff5733</color>
34-
<color name="pluto___red_05">#0Dff5733</color>
35-
<color name="pluto___red_20">#33ff5733</color>
36-
<color name="pluto___red_40">#66ff5733</color>
37-
<color name="pluto___red_60">#99ff5733</color>
38-
<color name="pluto___red_80">#ccff5733</color>
39-
<color name="pluto___orange">#ffa000</color>
40-
<color name="pluto___orange_05">#0Dffa000</color>
41-
<color name="pluto___orange_40">#66ffa000</color>
42-
<color name="pluto___orange_60">#99ffa000</color>
43-
<color name="pluto___orange_80">#ccffa000</color>
44-
<color name="pluto___emerald">#009463</color>
45-
<color name="pluto___teal">#20c997</color>
46-
<color name="pluto___transparent">#00000000</color>
47-
<color name="pluto___section_color">#eeecec</color>
48-
<color name="pluto___dull_green">#73a964</color>
49-
<color name="pluto___dull_green_08">#1873a964</color>
50-
<color name="pluto___dull_green_05">#0D73a964</color>
51-
52-
<color name="pluto___bottomsheet_bg_color">#f5f5f5</color>
53-
<color name="pluto___blue">#366BD1</color>
54-
<color name="pluto___blue_80">#cc366BD1</color>
55-
<color name="pluto___blue_40">#66366BD1</color>
56-
57-
<color name="pluto___text_highlight">#aaff9100</color>
58-
59-
<color name="pluto___notch_bg_light">#eeecec</color>
60-
<color name="pluto___notch_accent_light">#ff5733</color>
61-
62-
<color name="pluto___notch_bg_dark">#11141c</color>
63-
<color name="pluto___notch_accent_dark">#ff9100</color>
64-
65-
<color name="pluto___disabled_cta">#a9a9a9</color>
3+
<color name="pluto___plugin_group_color">#11141c</color>
4+
<color name="pluto___plugin_color">#6611141c</color>
665
</resources>

pluto-plugins/plugins/datastore/lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ android {
6363

6464
dependencies {
6565
implementation project(path: ':pluto-plugins:base:lib')
66+
implementation project(path: ':utilities')
6667
implementation "androidx.core:core-ktx:$androidXCoreVersion"
6768
implementation "androidx.compose.material3:material3:$composeMaterial3Version"
6869
implementation "androidx.compose.foundation:foundation:$composeVersion"

pluto-plugins/plugins/demo/lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ android {
5050

5151
dependencies {
5252
implementation project(path: ':pluto-plugins:base:lib')
53+
implementation project(path: ':utilities')
5354
}

pluto-plugins/plugins/exceptions/lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ android {
6262
dependencies {
6363
// implementation 'com.plutolib:plugin:2.0.0'
6464
implementation project(path: ':pluto-plugins:base:lib')
65+
implementation project(path: ':utilities')
6566
implementation "androidx.core:core-ktx:$androidXCoreVersion"
6667

6768
implementation "com.squareup.moshi:moshi:$moshiVersion"

0 commit comments

Comments
 (0)