Skip to content

Commit 7ab11a8

Browse files
committed
Used service icons for import
1 parent 70e0085 commit 7ab11a8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionFragment.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import org.schabi.newpipe.streams.io.NoFileManagerSafeGuard
5858
import org.schabi.newpipe.streams.io.StoredFileHelper
5959
import org.schabi.newpipe.util.NavigationHelper
6060
import org.schabi.newpipe.util.OnClickGesture
61+
import org.schabi.newpipe.util.ServiceHelper
6162
import org.schabi.newpipe.util.ThemeHelper.getGridSpanCountChannels
6263
import org.schabi.newpipe.util.ThemeHelper.shouldUseGridLayout
6364
import org.schabi.newpipe.util.external_communication.ShareUtils
@@ -140,7 +141,6 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
140141

141142
private fun buildImportExportMenu(menu: Menu) {
142143
// -- Import --
143-
144144
val importSubMenu = menu.addSubMenu(R.string.import_from)
145145

146146
addMenuItem(importSubMenu, R.string.previous_export) {
@@ -157,9 +157,10 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
157157
val supportedSources = subscriptionExtractor.supportedSources
158158
if (supportedSources.isEmpty()) continue
159159

160-
addMenuItem(importSubMenu, serviceName) {
160+
val item = addMenuItem(importSubMenu, serviceName) {
161161
onImportFromServiceSelected(service.serviceId)
162162
}
163+
item.setIcon(ServiceHelper.getIcon(service.serviceId))
163164
} catch (e: ExtractionException) {
164165
throw RuntimeException(
165166
"Services array contains an entry that it's not a valid service name ($serviceName)",
@@ -169,7 +170,6 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
169170
}
170171

171172
// -- Export --
172-
173173
val exportSubMenu = menu.addSubMenu(R.string.export_to)
174174

175175
addMenuItem(exportSubMenu, R.string.file) { onExportSelected() }

0 commit comments

Comments
 (0)