Skip to content

Commit

Permalink
Merge remote-tracking branch 'lawnicons/develop' into shinka
Browse files Browse the repository at this point in the history
  • Loading branch information
project404bot committed Dec 22, 2024
2 parents 56442d7 + fcc7be4 commit c7eea6e
Show file tree
Hide file tree
Showing 34 changed files with 668 additions and 444 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/icon_rebrand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ body:
You can find the current icon and application name in [the appfilter.xml](https://github.com/LawnchairLauncher/lawnicons/blob/develop/app/assets/appfilter.xml). For example, you found "...**drawable="ladb" name="ADB Shell" />**". The icon is [ladb](https://github.com/LawnchairLauncher/lawnicons/tree/develop/svgs/ladb.svg) and the application name is **ADB Shell**.
**Sample response**
Now: Twitter, [twitter.svg](https://github.com/LawnchairLauncher/lawnicons/tree/develop/svgs/)
New: X, [fresh icon](https://cdn.cms-twdigitalassets.com/content/dam/about-twitter/x/brand-toolkit/logo-black.png.twimg.2560.png)
Now: Twitter, https://github.com/LawnchairLauncher/lawnicons/tree/develop/svgs/twitter.svg
New: X, https://cdn.cms-twdigitalassets.com/content/dam/about-twitter/x/brand-toolkit/logo-black.png.twimg.2560.png
placeholder: Tell us what should be changed and how
validations:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Please see our guidelines for information on contributing icons or code, it will
[Lawnicons guidelines](CONTRIBUTING.md)[Icon samples in Figma](https://www.figma.com/community/file/1227718471680779613)[Popular icon requests](https://docs.google.com/spreadsheets/d/1AXc9EDXA6udZeGROtB5nuABjM33VluGY_V24tIzHaKc/edit?resourcekey=&gid=609680142#gid=609680142)[Development issues](https://github.com/LawnchairLauncher/lawnicons/issues)

## Requesting icons
> [!NOTE]
> Request acceptance is currently closed.
`Open Lawnicons 2.10+ → Tap "Request icons" → Submit the response`

[Icon request form](https://forms.gle/xt7sJhgWEasuo9TR9)[Report outdated icons](https://github.com/LawnchairLauncher/lawnicons/issues/new?assignees=&labels=icon+update&projects=&template=icon_rebrand.yml)
[Report outdated icons](https://github.com/LawnchairLauncher/lawnicons/issues/new?assignees=&labels=icon+update&projects=&template=icon_rebrand.yml)
60 changes: 39 additions & 21 deletions app/assets/appfilter.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<!-- Support Material3 theming as found in M3 Icon Pack standard-->
<category android:name="org.icontheme.CHANGES_WITH_MATERIAL_YOU_COLORS" />
<category android:name="org.icontheme.CHANGES_WITH_DARK_MODE" />
<category android:name="org.icontheme.FALLBACK_TO_THEMED_ICON" />
</intent-filter>
<!-- ADW Launcher Custom Icon Picker -->
<intent-filter>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/kotlin/app/lawnchair/lawnicons/model/IconInfo.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package app.lawnchair.lawnicons.model

import kotlinx.serialization.Serializable

/**
* Data class to hold information about an icon.
*
Expand Down Expand Up @@ -73,6 +75,7 @@ fun IconInfo.getFirstLabelAndComponent(): LabelAndComponent {
* @property label The user-facing label associated with the component.
* @property componentName The name of the component, typically a fully qualified class name.
*/
@Serializable
data class LabelAndComponent(
val label: String,
val componentName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fun ExternalLinkRow(
background: Boolean = false,
first: Boolean = false,
last: Boolean = false,
startIcon: @Composable (() -> Unit)? = null,
) {
val context = LocalContext.current
val onClick =
Expand All @@ -35,6 +36,7 @@ fun ExternalLinkRow(
divider = divider,
label = name,
onClick = onClick,
startIcon = startIcon,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.unit.dp
import app.lawnchair.lawnicons.ui.components.home.ClickableIcon
import app.lawnchair.lawnicons.ui.components.home.NavigationIconButton
import app.lawnchair.lawnicons.ui.theme.LawniconsTheme
import app.lawnchair.lawnicons.ui.util.PreviewLawnicons
import app.lawnchair.lawnicons.ui.util.toPaddingValues
Expand All @@ -39,7 +39,7 @@ fun LawniconsScaffold(
scrollBehavior = scrollBehavior,
title = title,
navigationIcon = {
ClickableIcon(
NavigationIconButton(
onClick = onBack,
imageVector = Icons.AutoMirrored.Rounded.ArrowBack,
size = 40.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import app.lawnchair.lawnicons.ui.util.thenIf
import app.lawnchair.lawnicons.ui.util.thenIfNotNull

private val basePadding = 16.dp

Expand All @@ -47,55 +50,47 @@ fun ListRow(
val bottomCornerRadius = if (last) 16.dp else 0.dp
val basePaddingPx = with(LocalDensity.current) { basePadding.toPx() }

val backgroundColor = MaterialTheme.colorScheme.surfaceContainer

Box(
modifier = modifier
.fillMaxWidth()
.then(
if (enforceHeight) {
Modifier.height(if (tall) 72.dp else 56.dp)
} else {
Modifier
},
)
.then(
if (background) {
Modifier
.padding(horizontal = basePadding)
.clip(
RoundedCornerShape(
topStart = topCornerRadius,
topEnd = topCornerRadius,
bottomStart = bottomCornerRadius,
bottomEnd = bottomCornerRadius,
),
)
.background(
MaterialTheme.colorScheme.surfaceContainer,
)
} else {
Modifier
},
)
.then(
if (divider) {
Modifier.drawBehind {
drawLine(
strokeWidth = dividerHeightPx,
color = dividerColor,
start = Offset(
x = basePaddingPx,
y = size.height - dividerHeightPx / 2,
),
end = Offset(
x = size.width - basePaddingPx,
y = size.height - dividerHeightPx / 2,
),
)
}
} else {
Modifier
},
),
.semantics(
mergeDescendants = true,
) {}
.thenIf(enforceHeight) {
Modifier.height(if (tall) 72.dp else 56.dp)
}
.thenIf(background) {
padding(horizontal = basePadding)
.clip(
RoundedCornerShape(
topStart = topCornerRadius,
topEnd = topCornerRadius,
bottomStart = bottomCornerRadius,
bottomEnd = bottomCornerRadius,
),
)
.background(
backgroundColor,
)
}
.thenIf(divider) {
drawBehind {
drawLine(
strokeWidth = dividerHeightPx,
color = dividerColor,
start = Offset(
x = basePaddingPx,
y = size.height - dividerHeightPx / 2,
),
end = Offset(
x = size.width - basePaddingPx,
y = size.height - dividerHeightPx / 2,
),
)
}
},
) {
Content(
label = label,
Expand All @@ -121,13 +116,7 @@ private fun Content(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.fillMaxSize()
.then(
if (onClick != null) {
Modifier.clickable(onClick = onClick)
} else {
Modifier
},
)
.thenIfNotNull(onClick) { clickable(onClick = it) }
.padding(horizontal = basePadding),
) {
if (icon != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import app.lawnchair.lawnicons.ui.components.home.ClickableIcon
import app.lawnchair.lawnicons.ui.components.home.NavigationIconButton
import app.lawnchair.lawnicons.ui.theme.LawniconsTheme
import app.lawnchair.lawnicons.ui.util.PreviewLawnicons

Expand Down Expand Up @@ -53,7 +53,7 @@ private fun SmallTopAppBarPreview() {
LawniconsTheme {
TopAppBar(
navigationIcon = {
ClickableIcon(
NavigationIconButton(
onClick = {},
imageVector = Icons.AutoMirrored.Rounded.ArrowBack,
size = 40.dp,
Expand All @@ -74,7 +74,7 @@ private fun LargeTopAppBarPreview() {
LawniconsTheme {
TopAppBar(
navigationIcon = {
ClickableIcon(
NavigationIconButton(
onClick = {},
imageVector = Icons.AutoMirrored.Rounded.ArrowBack,
size = 40.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import app.lawnchair.lawnicons.ui.theme.LawniconsTheme
import app.lawnchair.lawnicons.ui.util.PreviewLawnicons

@Composable
fun ClickableIcon(
fun NavigationIconButton(
onClick: () -> Unit,
imageVector: ImageVector,
modifier: Modifier = Modifier,
Expand All @@ -44,9 +44,9 @@ fun ClickableIcon(

@PreviewLawnicons
@Composable
private fun ClickableIconPreview() {
private fun NavigationIconButtonPreview() {
LawniconsTheme {
ClickableIcon(
NavigationIconButton(
imageVector = Icons.Rounded.Clear,
size = 52.dp,
onClick = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import app.lawnchair.lawnicons.ui.components.core.placeholder.PlaceholderHighlig
import app.lawnchair.lawnicons.ui.components.core.placeholder.fade
import app.lawnchair.lawnicons.ui.components.core.placeholder.placeholder
import app.lawnchair.lawnicons.ui.components.core.placeholder.shimmer
import app.lawnchair.lawnicons.ui.components.home.iconpreview.IconPreviewGridPadding
import app.lawnchair.lawnicons.ui.components.home.iconpreview.iconColor
import app.lawnchair.lawnicons.ui.util.toPaddingValues

@SuppressLint("UnusedMaterial3ScaffoldPaddingParameter")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
package app.lawnchair.lawnicons.ui.components.home
/*
* Copyright 2024 Lawnchair Launcher
*
* 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.
*/

package app.lawnchair.lawnicons.ui.components.home.iconpreview

import android.content.Intent
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -214,19 +230,17 @@ private fun IconInfoListRow(
label: String,
componentNames: List<String>,
) {
ListRow(
label = {
SelectionContainer {
SelectionContainer {
ListRow(
label = {
Text(
text = label,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
)
}
},
description = {
Spacer(Modifier.height(4.dp))
SelectionContainer {
},
description = {
Spacer(Modifier.height(4.dp))
Column {
componentNames.forEach {
Text(
Expand All @@ -238,12 +252,12 @@ private fun IconInfoListRow(
Spacer(Modifier.height(6.dp))
}
}
}
},
divider = false,
enforceHeight = false,
)
Spacer(Modifier.height(16.dp))
},
divider = false,
enforceHeight = false,
)
Spacer(Modifier.height(16.dp))
}
}

@PreviewLawnicons
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
package app.lawnchair.lawnicons.ui.components.home
/*
* Copyright 2024 Lawnchair Launcher
*
* 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.
*/

package app.lawnchair.lawnicons.ui.components.home.iconpreview

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.background
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
package app.lawnchair.lawnicons.ui.components.home
/*
* Copyright 2024 Lawnchair Launcher
*
* 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.
*/

package app.lawnchair.lawnicons.ui.components.home.iconpreview

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.animateFloatAsState
Expand Down
Loading

0 comments on commit c7eea6e

Please sign in to comment.