Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit be70b37
Author: 92 <[email protected]>
Date:   Wed Jan 1 17:43:05 2025 +0900

    +1 icon (#2488)

    * +1 icon

    `5ber.eSIM` `com.ifreegroup.moesim`

    |![old](https://github.com/user-attachments/assets/3d6322a4-b579-4670-89d0-6615b912c3d8)|![new](https://raw.githubusercontent.com/Twive/lawnicons/refs/heads/develop/svgs/_5ber_esim.svg)|
    |---|---|

    * Update _5ber_esim.svg

    * Add files via upload

commit b20916c
Author: Gleb <[email protected]>
Date:   Tue Dec 31 11:08:21 2024 +0300

    Minor icon improvements (#2502)

    * Minor icon improvements

    * Update quizduel.svg

commit 8e6fecc
Author: 92 <[email protected]>
Date:   Tue Dec 31 16:49:47 2024 +0900

    Update README.md (#2487)

commit 3accd38
Author: Gleb <[email protected]>
Date:   Mon Dec 30 14:03:37 2024 +0300

    Minor config.yml fix (#2501)

commit 879bad0
Author: Gleb <[email protected]>
Date:   Mon Dec 30 13:56:53 2024 +0300

    Suspension of icon requests (#2500)

    Added a hint to the issue template.

commit 6289116
Author: SuperDragonXD <[email protected]>
Date:   Fri Dec 27 13:35:12 2024 +0800

    Search improvements

    - Improve animations when opening search bar
    - Temporary fix to search bar showing on tall devices; fixes #2495
    - Open first item when pressing search button in IME

commit ddc8641
Author: SuperDragonXD <[email protected]>
Date:   Fri Dec 27 11:57:56 2024 +0800

    Cleanup preferences handling

commit 6b371f9
Author: SuperDragonXD <[email protected]>
Date:   Wed Dec 25 21:47:58 2024 +0800

    feat: Allow enabling/disabling icon requests

    This can be done via the flag at the website repo, or via the local prefs override at the debug menu.

    TODO: Update link once new form is placed.

commit fcc7be4
Author: Gleb <[email protected]>
Date:   Sat Dec 21 19:35:34 2024 +0300

    Removed the deleted form (#2494)

    * Removed the deleted form

    * Update icon_rebrand.yml
  • Loading branch information
RaduBratan committed Jan 1, 2025
1 parent 0181734 commit 436cb1e
Show file tree
Hide file tree
Showing 52 changed files with 371 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ contact_links:
- name: Link apps to identical icons
url: https://github.com/LawnchairLauncher/lawnicons/blob/develop/CONTRIBUTING.md#adding-an-icon-to-lawnicons
about: Learn more about linking an app to an existing icon via a pull request.
- name: Icon Request
- name: Currently suspended — Icon Request
url: https://forms.gle/xt7sJhgWEasuo9TR9
about: Please request your icons in this form.
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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Lawnicons is best used [on the latest version of Lawnchair](https://play.google.
<a href="https://apt.izzysoft.de/fdroid/index/apk/app.lawnchair.lawnicons">
<img src="docs/images/badge-izzyondroid.png" alt="Get it on IzzyOnDroid" height="60" />
</a>
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/LawnchairLauncher/lawnicons/">
<a href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://github.com/LawnchairLauncher/lawnicons">
<img src="docs/images/badge-obtainium.png" alt="Get it on Obtainium" height="60" />
</a>
<a href="https://github.com/LawnchairLauncher/lawnicons/releases/latest">
Expand All @@ -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)
1 change: 1 addition & 0 deletions app/assets/appfilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<item component="ComponentInfo{ru.fourpda.client/ru.fourpda.MainActivity}" drawable="_4pda" name="4PDA" />
<item component="ComponentInfo{com.intelligentchange.fiveminutejournal/com.intelligentchange.fiveminutejournal3.ui.main.MainActivity}" drawable="_5_minute_journal" name="5 Minute Journal" />
<item component="ComponentInfo{com.secure56.app/com.android56.app.splash.SplashActivity}" drawable="_56_secure" name="56 Secure" />
<item component="ComponentInfo{com.ifreegroup.moesim/com.ifreegroup.moesim.MainActivity}" drawable="_5ber_esim" name="5ber.eSIM" />
<item component="ComponentInfo{moe.xzr.fivegtile/moe.xzr.fivegtile.MainActivity}" drawable="_5g_tile" name="5G Tile" />
<item component="ComponentInfo{jp.co.sej.app/jp.co.sej.app.activity.SplashActivity}" drawable="_7_eleven" name="7-Eleven ~~ セブン‐イレブン" />
<item component="ComponentInfo{asuk.com.android.app/net.appsynth.allmember.main.presentation.splash.SplashActivity}" drawable="_7_eleven" name="7-Eleven ~~ セブン‐イレブン" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import retrofit2.create

@Module
@InstallIn(SingletonComponent::class)
class ApiModule {
class GithubApiModule {

@Provides
@Singleton
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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.api

import app.lawnchair.lawnicons.model.IconRequestSettings
import retrofit2.http.GET

interface IconRequestSettingsAPI {
@GET("lawnicons-request/settings.json")
suspend fun getIconRequestSettings(): IconRequestSettings
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.api

import app.lawnchair.lawnicons.util.kotlinxJson
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
import okhttp3.MediaType.Companion.toMediaType
import retrofit2.Retrofit
import retrofit2.converter.kotlinx.serialization.asConverterFactory
import retrofit2.create

@Module
@InstallIn(SingletonComponent::class)
class WebsiteApiModule {

@Provides
@Singleton
fun providesWebsiteIconRequestApi(): IconRequestSettingsAPI {
return Retrofit.Builder()
.baseUrl("https://lawnchair.app/")
.addConverterFactory(kotlinxJson.asConverterFactory("application/json".toMediaType()))
.build()
.create()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.model

import kotlinx.serialization.Serializable

@Serializable
data class IconRequestSettings(
val enabled: Boolean,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.repository

import app.lawnchair.lawnicons.api.IconRequestSettingsAPI
import javax.inject.Inject

class IconRequestSettingsRepository @Inject constructor(
private val api: IconRequestSettingsAPI,
) {
suspend fun getEnabledState() = api.getIconRequestSettings().enabled
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import app.lawnchair.lawnicons.BuildConfig

/**
* A class that abstracts the functionality of SharedPreferences
* We use SharedPreferences to avoid the unnecessary complexity Preference DataStore has
*
* @param prefs The SharedPreferences instance to use
*/
abstract class BasePreferenceManager(
Expand Down Expand Up @@ -83,6 +85,7 @@ class PreferenceManager private constructor(
val showFirstLaunchSnackbar = BoolPref("show_first_launch_snackbar", true)
val showNewIconsCard = BoolPref("show_new_icons_card", true)
val showDebugMenu = BoolPref("debug_menu", false)
val forceEnableIconRequest = BoolPref("force_icon_request", false)
val currentLawniconsVersion = IntPref("current_lawnicons_version", BuildConfig.VERSION_CODE)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ package app.lawnchair.lawnicons.ui.components.home

import android.content.Context
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand All @@ -33,6 +36,7 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand Down Expand Up @@ -67,6 +71,9 @@ fun DebugMenu(
ModalBottomSheet(
onDismissRequest = { prefs.showDebugMenu.set(false) },
sheetState = sheetState,
dragHandle = {
Spacer(Modifier.height(22.dp))
},
) {
SheetContent(
iconInfoCount = iconInfoModel.iconInfo.size,
Expand Down Expand Up @@ -108,6 +115,7 @@ private fun SheetContent(

SwitchPref(prefs.showDebugMenu)
SwitchPref(prefs.showNewIconsCard)
SwitchPref(prefs.forceEnableIconRequest)
SwitchPref(prefs.showFirstLaunchSnackbar)

SimpleListRow(
Expand Down Expand Up @@ -159,14 +167,17 @@ private fun SwitchPref(
pref: BasePreferenceManager.BoolPref,
modifier: Modifier = Modifier,
) {
val interactionSource = remember { MutableInteractionSource() }
SimpleListRow(
pref.key,
endIcon = {
Switch(
checked = pref.asState().value,
onCheckedChange = { pref.set(it) },
onCheckedChange = pref::set,
interactionSource = interactionSource,
)
},
onClick = pref::toggle,
modifier = modifier,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import app.lawnchair.lawnicons.ui.util.Constants
@Composable
fun HomeBottomBar(
context: Context,
iconRequestsEnabled: Boolean,
iconRequestModel: IconRequestModel?,
snackbarHostState: SnackbarHostState,
onNavigate: () -> Unit,
Expand Down Expand Up @@ -61,6 +62,7 @@ fun HomeBottomBar(

IconRequestIconButton(
snackbarHostState = snackbarHostState,
iconRequestsEnabled = iconRequestsEnabled,
iconRequestModel = iconRequestModel,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package app.lawnchair.lawnicons.ui.components.home

import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.offset
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
Expand Down Expand Up @@ -41,26 +44,16 @@ fun HomeTopBar(
) {
val (isSearchExpanded, isExpandedScreen, searchTerm, searchMode, searchedIconInfoModel, isIconPicker) = uiState

val offset = animateDpAsState(
targetValue = if (isSearchExpanded || isExpandedScreen) {
0.dp
} else {
(-100).dp
},
label = "move search bar",
)
searchedIconInfoModel?.let {
SearchBar(
modifier = modifier
.offset {
IntOffset(0, offset.value.roundToPx())
},
searchedIconInfoModel?.let { iconInfoModel ->
AnimatedSearchBar(
modifier = modifier,
searchTerm = searchTerm,
onClearSearch = onClearSearch,
onModeChange = onChangeMode,
onSearch = onSearchIcons,
iconInfoModel = it,
iconInfoModel = iconInfoModel,
onNavigate = onNavigate,
isSearchExpanded = isSearchExpanded,
isExpandedScreen = isExpandedScreen,
isIconPicker = isIconPicker,
searchMode = searchMode,
Expand All @@ -72,13 +65,14 @@ fun HomeTopBar(
}

@Composable
private fun SearchBar(
private fun AnimatedSearchBar(
searchMode: SearchMode,
searchTerm: String,
onSearch: (String) -> Unit,
onClearSearch: () -> Unit,
onModeChange: (SearchMode) -> Unit,
onNavigate: () -> Unit,
isSearchExpanded: Boolean,
isExpandedScreen: Boolean,
isIconPicker: Boolean,
onSendResult: (IconInfo) -> Unit,
Expand All @@ -87,18 +81,34 @@ private fun SearchBar(
modifier: Modifier = Modifier,
inputFieldModifier: Modifier = Modifier,
) {
val offset = animateDpAsState(
targetValue = (if (isSearchExpanded || isExpandedScreen) 0 else -1000).dp,
label = "move search bar",
animationSpec = tween(
durationMillis = 600,
),
)

Column(
modifier = modifier.fillMaxWidth(),
modifier = modifier
.fillMaxWidth()
.offset {
IntOffset(0, offset.value.roundToPx())
},
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
val isIconInfoShown = rememberSaveable { mutableStateOf(false) }
LawniconsSearchBar(
query = searchTerm,
isQueryEmpty = searchTerm == "",
onClear = onClearSearch,
onBack = onFocusChange,
onSearch = {
isIconInfoShown.value = true
},
onQueryChange = onSearch,
iconInfoModel = iconInfoModel,
iconCount = iconInfoModel.iconCount,
onNavigate = onNavigate,
isExpandedScreen = isExpandedScreen,
isIconPicker = isIconPicker,
Expand All @@ -109,6 +119,8 @@ private fun SearchBar(
onModeChange = onModeChange,
iconInfo = iconInfoModel.iconInfo,
onSendResult = onSendResult,
showSheet = isIconInfoShown.value,
onToggleSheet = { isIconInfoShown.value = it },
)
},
inputFieldModifier = inputFieldModifier,
Expand Down
Loading

0 comments on commit 436cb1e

Please sign in to comment.