Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
Any launcher with custom feed provider support. For example:

- Neo Launcher
- LibreChair
- LawnChair
- Shade Launcher

## Community :speech_balloon:
Expand All @@ -58,7 +58,8 @@ You can join either our [Telegram](https://t.me/neo_launcher) or [Matrix](https:
<a href="https://matrix.to/#/#neo-launcher:matrix.org"><img src="https://docs.cloudron.io/img/element-logo.png" alt="Join Matrix Channel" width="11%" align="center" /></a>
</p>

## Translation :left_speech_bubble: [<img align="right" src="https://hosted.weblate.org/widgets/neo-feed/-/287x66-white.png" alt="Translation stats" />](https://hosted.weblate.org/engage/neo-feed/?utm_source=widget)
## Translation :left_speech_bubble:
[<img align="right" src="https://hosted.weblate.org/widgets/neo-feed/-/287x66-white.png" alt="Translation stats" width="40%" />](https://hosted.weblate.org/engage/neo-feed/?utm_source=widget)

Contribute your translations to Neo Feed on [Hosted Weblate](https://hosted.weblate.org/engage/neo-feed/). <br> Adding new languages is always accepted and supported.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.saulhdev.feeder.ui.components.dialog

import android.content.Intent
import android.provider.Settings
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.saulhdev.feeder.R

@Composable
fun DrawPermissionRequestDialog() {
val context = LocalContext.current

val askForDrawPermission = remember { mutableStateOf(false) }

if (askForDrawPermission.value) BaseDialog(askForDrawPermission) {
Card (Modifier.padding(30.dp)) { Column (horizontalAlignment = Alignment.CenterHorizontally) {
Text(stringResource(R.string.draw_permission_required), textAlign = TextAlign.Center, modifier = Modifier.padding(20.dp))
Button({
askForDrawPermission.value = false
context.startActivity(Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION))
}, Modifier.padding(20.dp))
{
Text(stringResource(R.string.go_to_settings))
}
} }
}
}
5 changes: 5 additions & 0 deletions app/src/main/java/com/saulhdev/feeder/ui/pages/MainPage.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package com.saulhdev.feeder.ui.pages


import android.provider.Settings
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import com.saulhdev.feeder.ui.navigation.NavItem
import com.saulhdev.feeder.ui.navigation.NavigationSuiteScaffold
import com.saulhdev.feeder.ui.components.SlidePager
import com.saulhdev.feeder.ui.components.dialog.DrawPermissionRequestDialog
import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.launch

Expand Down Expand Up @@ -41,4 +44,6 @@ fun MainPage(pageIndex: Int = 0) {
pageItems = pages,
)
}

if (!Settings.canDrawOverlays(LocalContext.current)) DrawPermissionRequestDialog()
}
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,6 @@
<string name="expand_section_description">Expand section</string>
<string name="collapse_section_description">Collapse section</string>
<string name="date_at_time_FORMAT">%1$s at %2$s</string>
<string name="draw_permission_required">This application requires the permission to draw over other apps, without it feed items would not open on click</string>
<string name="go_to_settings">Go to settings</string>
</resources>