Skip to content

Commit

Permalink
Reformat code according to tweaked config
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxr1998 authored and nielsvanvelzen committed Feb 16, 2021
1 parent 96f3182 commit c852f4a
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 15 deletions.
1 change: 1 addition & 0 deletions app/src/libre/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application>
<meta-data
android:name="com.google.android.gms.version"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.jellyfin.mobile.bridge

import android.app.Activity
import android.content.Context
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.webkit.JavascriptInterface
Expand All @@ -14,8 +14,8 @@ import org.jellyfin.mobile.player.source.JellyfinMediaSource
import org.jellyfin.mobile.settings.ExternalPlayerPackage
import org.jellyfin.mobile.settings.VideoPlayerType
import org.jellyfin.mobile.utils.Constants
import org.jellyfin.mobile.utils.runOnUiThread
import org.jellyfin.mobile.utils.isPackageInstalled
import org.jellyfin.mobile.utils.runOnUiThread
import org.jellyfin.mobile.utils.toast
import org.jellyfin.mobile.webapp.WebappFunctionChannel
import org.json.JSONException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.jellyfin.apiclient.interaction.AndroidDevice
import org.jellyfin.mobile.R
import org.jellyfin.mobile.fragment.WebViewFragment
import org.jellyfin.mobile.settings.SettingsFragment
import org.jellyfin.mobile.utils.*
import org.jellyfin.mobile.utils.Constants
import org.jellyfin.mobile.utils.Constants.APP_INFO_NAME
import org.jellyfin.mobile.utils.Constants.APP_INFO_VERSION
import org.jellyfin.mobile.utils.Constants.EXTRA_ALBUM
Expand All @@ -27,6 +27,12 @@ import org.jellyfin.mobile.utils.Constants.EXTRA_ITEM_ID
import org.jellyfin.mobile.utils.Constants.EXTRA_PLAYER_ACTION
import org.jellyfin.mobile.utils.Constants.EXTRA_POSITION
import org.jellyfin.mobile.utils.Constants.EXTRA_TITLE
import org.jellyfin.mobile.utils.addFragment
import org.jellyfin.mobile.utils.disableFullscreen
import org.jellyfin.mobile.utils.enableFullscreen
import org.jellyfin.mobile.utils.requestDownload
import org.jellyfin.mobile.utils.requireMainActivity
import org.jellyfin.mobile.utils.runOnUiThread
import org.jellyfin.mobile.webapp.RemotePlayerService
import org.jellyfin.mobile.webapp.RemoteVolumeProvider
import org.jellyfin.mobile.webapp.WebappFunctionChannel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ import coil.request.ImageRequest
import com.google.android.exoplayer2.DefaultControlDispatcher
import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.ui.PlayerNotificationManager
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.jellyfin.mobile.R
import org.jellyfin.mobile.utils.Constants
import org.koin.core.KoinComponent
Expand Down
27 changes: 23 additions & 4 deletions app/src/main/java/org/jellyfin/mobile/media/car/LibraryBrowser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,29 @@ import org.jellyfin.apiclient.model.entities.CollectionType
import org.jellyfin.apiclient.model.entities.ImageType
import org.jellyfin.apiclient.model.entities.SortOrder
import org.jellyfin.apiclient.model.playlists.PlaylistItemQuery
import org.jellyfin.apiclient.model.querying.*
import org.jellyfin.apiclient.model.querying.ArtistsQuery
import org.jellyfin.apiclient.model.querying.ItemFilter
import org.jellyfin.apiclient.model.querying.ItemQuery
import org.jellyfin.apiclient.model.querying.ItemSortBy
import org.jellyfin.apiclient.model.querying.ItemsByNameQuery
import org.jellyfin.apiclient.model.querying.ItemsResult
import org.jellyfin.mobile.R
import org.jellyfin.mobile.media.*
import org.jellyfin.mobile.utils.*
import org.jellyfin.mobile.media.MediaService
import org.jellyfin.mobile.media.mediaId
import org.jellyfin.mobile.media.setAlbum
import org.jellyfin.mobile.media.setAlbumArtUri
import org.jellyfin.mobile.media.setAlbumArtist
import org.jellyfin.mobile.media.setArtist
import org.jellyfin.mobile.media.setDisplayIconUri
import org.jellyfin.mobile.media.setMediaId
import org.jellyfin.mobile.media.setMediaUri
import org.jellyfin.mobile.media.setTitle
import org.jellyfin.mobile.media.setTrackNumber
import org.jellyfin.mobile.utils.getArtists
import org.jellyfin.mobile.utils.getGenres
import org.jellyfin.mobile.utils.getItems
import org.jellyfin.mobile.utils.getPlaylistItems
import org.jellyfin.mobile.utils.getUserViews
import timber.log.Timber
import java.net.URLEncoder
import java.util.*
Expand Down Expand Up @@ -327,7 +346,7 @@ class LibraryBrowser(
return apiClient.getPlaylistItems(query)?.extractItems("${LibraryPage.PLAYLIST}|$playlistId")
}

private fun ItemsResult.extractItems(libraryId: String? = null): List<MediaMetadataCompat>? =
private fun ItemsResult.extractItems(libraryId: String? = null): List<MediaMetadataCompat> =
items.map { item -> buildMediaMetadata(item, libraryId) }.toList()

private fun buildMediaMetadata(item: BaseItemDto, libraryId: String?): MediaMetadataCompat {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.jellyfin.mobile.model.sql.dao

import androidx.room.*
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import org.jellyfin.mobile.model.sql.entity.ServerUser
import org.jellyfin.mobile.model.sql.entity.UserEntity
import org.jellyfin.mobile.model.sql.entity.UserEntity.Key.ACCESS_TOKEN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package org.jellyfin.mobile.model.sql.entity

import androidx.room.*
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey
import org.jellyfin.mobile.model.sql.entity.UserEntity.Key.SERVER_ID
import org.jellyfin.mobile.model.sql.entity.UserEntity.Key.TABLE_NAME
import org.jellyfin.mobile.model.sql.entity.UserEntity.Key.USER_ID
Expand Down
13 changes: 11 additions & 2 deletions app/src/main/java/org/jellyfin/mobile/settings/SettingsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment
import de.Maxr1998.modernpreferences.Preference
import de.Maxr1998.modernpreferences.PreferencesAdapter
import de.Maxr1998.modernpreferences.helpers.*
import de.Maxr1998.modernpreferences.helpers.categoryHeader
import de.Maxr1998.modernpreferences.helpers.checkBox
import de.Maxr1998.modernpreferences.helpers.defaultOnSelectionChange
import de.Maxr1998.modernpreferences.helpers.screen
import de.Maxr1998.modernpreferences.helpers.singleChoice
import de.Maxr1998.modernpreferences.preferences.choice.SelectionItem
import org.jellyfin.mobile.AppPreferences
import org.jellyfin.mobile.R
import org.jellyfin.mobile.databinding.FragmentSettingsBinding
import org.jellyfin.mobile.utils.*
import org.jellyfin.mobile.utils.Constants
import org.jellyfin.mobile.utils.applyWindowInsetsAsMargins
import org.jellyfin.mobile.utils.getDownloadsPaths
import org.jellyfin.mobile.utils.isPackageInstalled
import org.jellyfin.mobile.utils.requireMainActivity
import org.jellyfin.mobile.utils.withThemedContext
import org.koin.android.ext.android.inject

class SettingsFragment : Fragment() {
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/org/jellyfin/mobile/utils/SystemUtils.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package org.jellyfin.mobile.utils

import android.Manifest.permission.WRITE_EXTERNAL_STORAGE
import android.app.*
import android.app.Activity
import android.app.AlertDialog
import android.app.DownloadManager
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:tools="http://schemas.android.com/tools">
<!-- Allow cleartext network traffic -->
<base-config cleartextTrafficPermitted="true" tools:ignore="InsecureBaseConfiguration">
<base-config
cleartextTrafficPermitted="true"
tools:ignore="InsecureBaseConfiguration">
<trust-anchors>
<!-- Trust pre-installed CAs -->
<certificates src="system" />
<!-- Additionally trust user added CAs -->
<certificates src="user" tools:ignore="AcceptsUserCertificates" />
<certificates
src="user"
tools:ignore="AcceptsUserCertificates" />
</trust-anchors>
</base-config>
</network-security-config>

0 comments on commit c852f4a

Please sign in to comment.