Skip to content

Commit b8e5660

Browse files
committed
some refactors/reformats
1 parent a4194dc commit b8e5660

File tree

12 files changed

+8
-80
lines changed

12 files changed

+8
-80
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ local.properties
3838
/.idea/copilot.data.migration.ask2agent.xml
3939
/.idea/betterCommentsSettings.xml
4040
/.idea/runConfigurations/app.xml
41+
/.idea/markdown.xml

app/src/main/java/io/github/yamin8000/owl/ui/OverlayActivity.kt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,12 @@ internal class OverlayActivity : BaseActivity() {
5858
private fun handleOutsideInputIntent(): String? {
5959
return if (intent.type == "text/plain") {
6060
when (intent.action) {
61-
Intent.ACTION_TRANSLATE, Intent.ACTION_DEFINE, Intent.ACTION_SEND -> {
62-
intent.getStringExtra(Intent.EXTRA_TEXT)
63-
}
64-
65-
Intent.ACTION_PROCESS_TEXT -> {
66-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
67-
intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT)
68-
else null
69-
}
61+
Intent.ACTION_TRANSLATE, Intent.ACTION_DEFINE, Intent.ACTION_SEND -> intent.getStringExtra(
62+
Intent.EXTRA_TEXT
63+
)
7064

71-
else -> {
72-
null
73-
}
65+
Intent.ACTION_PROCESS_TEXT -> intent.getStringExtra(Intent.EXTRA_PROCESS_TEXT)
66+
else -> null
7467
}
7568
} else {
7669
null

app/src/main/res/values/ic_launcher_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
~ along with freeDictionaryApp. If not, see <https://www.gnu.org/licenses/>.
2020
-->
2121

22-
<resources></resources>
22+
<resources />

build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.android.build.api.variant.impl.DeferredActionManager
2-
31
/*
42
* freeDictionaryApp/freeDictionaryApp
53
* build.gradle.kts Copyrighted by Yamin Siahmargooei at 2024/5/9

common/src/main/java/io/github/yamin8000/owl/common/ui/theme/Shape.kt

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,7 @@ import androidx.compose.foundation.shape.CutCornerShape
3131
import androidx.compose.material3.MaterialTheme
3232
import androidx.compose.runtime.Composable
3333
import androidx.compose.runtime.getValue
34-
import androidx.compose.ui.Modifier
35-
import androidx.compose.ui.draw.drawBehind
3634
import androidx.compose.ui.graphics.Brush
37-
import androidx.compose.ui.graphics.Outline
38-
import androidx.compose.ui.graphics.Path
39-
import androidx.compose.ui.graphics.drawOutline
40-
import androidx.compose.ui.graphics.drawscope.Stroke
41-
import androidx.compose.ui.platform.LocalDensity
4235

4336
val DefaultCutShape = CutCornerShape(Sizes.Medium)
4437

@@ -71,55 +64,4 @@ fun defaultGradientBorder(
7164
width = Sizes.xxSmall,
7265
brush = Brush.verticalGradient(listOf(start, end))
7366
)
74-
}
75-
76-
@Composable
77-
fun Modifier.defaultBorder(
78-
duration: Int = 5000
79-
): Modifier {
80-
val animation = rememberInfiniteTransition(label = "")
81-
val start by animation.animateColor(
82-
initialValue = MaterialTheme.colorScheme.primary,
83-
targetValue = MaterialTheme.colorScheme.tertiary,
84-
label = "",
85-
animationSpec = infiniteRepeatable(
86-
tween(duration),
87-
repeatMode = RepeatMode.Reverse
88-
)
89-
)
90-
91-
val end by animation.animateColor(
92-
initialValue = MaterialTheme.colorScheme.tertiary,
93-
targetValue = MaterialTheme.colorScheme.primary,
94-
label = "",
95-
animationSpec = infiniteRepeatable(
96-
tween(duration),
97-
repeatMode = RepeatMode.Reverse
98-
)
99-
)
100-
101-
val borderSize = Sizes.Medium
102-
val borderSizePx = with(LocalDensity.current) { borderSize.toPx() }
103-
val brush = Brush.verticalGradient(listOf(start, end))
104-
105-
return this.drawBehind {
106-
drawOutline(
107-
outline = Outline.Generic(
108-
Path().apply {
109-
val cornerSize = borderSizePx
110-
moveTo(0f, cornerSize)
111-
lineTo(cornerSize, 0f)
112-
lineTo(size.width - cornerSize, 0f)
113-
lineTo(size.width, cornerSize)
114-
lineTo(size.width, size.height - cornerSize)
115-
lineTo(size.width - cornerSize, size.height)
116-
lineTo(cornerSize, size.height)
117-
lineTo(0f, size.height - cornerSize)
118-
close()
119-
}
120-
),
121-
brush = brush,
122-
style = Stroke(borderSizePx / 4)
123-
)
124-
}
12567
}

common/src/main/java/io/github/yamin8000/owl/common/ui/theme/Sizes.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package io.github.yamin8000.owl.common.ui.theme
2323

2424
import androidx.compose.ui.unit.dp
2525

26+
@Suppress("unused")
2627
object Sizes {
2728

2829
/** 1.dp */

common/src/main/java/io/github/yamin8000/owl/common/ui/theme/Theme.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import androidx.compose.foundation.layout.Column
3232
import androidx.compose.foundation.layout.fillMaxWidth
3333
import androidx.compose.foundation.layout.height
3434
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
35-
import androidx.compose.material3.MaterialShapes
3635
import androidx.compose.material3.MaterialTheme
3736
import androidx.compose.material3.MotionScheme
3837
import androidx.compose.material3.Text

common/src/main/java/io/github/yamin8000/owl/common/util/Utility.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ fun log(
3535
}
3636
}
3737

38-
private const val GOLDEN_RATIO = 0.618033988749895
39-
4038
fun randomColor(): Color {
4139
val hue = Random.nextDouble(0.0, 360.0)
4240
val saturation = Random.nextDouble(50.0, 100.0) / 100f

feature_about/src/main/kotlin/io/github/yamin8000/owl/feature_about/ui/tabs/AboutLicense.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ package io.github.yamin8000.owl.feature_about.ui.tabs
2323

2424
import android.content.res.Configuration
2525
import androidx.compose.foundation.Image
26-
import androidx.compose.foundation.gestures.scrollable
2726
import androidx.compose.foundation.layout.Arrangement
2827
import androidx.compose.foundation.layout.Column
2928
import androidx.compose.foundation.layout.fillMaxWidth

feature_home/src/main/java/io/github/yamin8000/owl/feature_home/ui/components/bottom_app_bar/NormalBottomAppBar.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import androidx.compose.material3.BottomAppBar
3333
import androidx.compose.material3.MaterialTheme
3434
import androidx.compose.material3.TextField
3535
import androidx.compose.runtime.Composable
36-
import androidx.compose.runtime.remember
3736
import androidx.compose.ui.Modifier
3837
import androidx.compose.ui.res.stringResource
3938
import androidx.compose.ui.text.input.ImeAction

0 commit comments

Comments
 (0)