Skip to content

Commit

Permalink
Merge pull request feelfreelinux#188 from otwarty-wykop-mobilny/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski authored Feb 5, 2022
2 parents fb20d74 + 4fdb714 commit f856a64
Show file tree
Hide file tree
Showing 36 changed files with 47 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_diffuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
uses: usefulness/diffuse-action@master
with:
old-file-path: diffuse-source-file-release
old-mapping-path: diffuse-mapping-file-release
# old-mapping-path: diffuse-mapping-file-release
new-file-path: app/build/outputs/apk/release/app-release.apk
new-mapping-path: app/build/outputs/mapping/release/mapping.txt
# new-mapping-path: app/build/outputs/mapping/release/mapping.txt

- uses: peter-evans/find-comment@v1
id: find_comment
Expand Down
41 changes: 23 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.android.build.gradle.internal.LoggerWrapper
import com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask
import com.slack.keeper.KeeperVariantMarker
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask

plugins {
Expand All @@ -14,13 +15,6 @@ plugins {
id("pl.droidsonroids.animation-disabler")
}

keeper {
variantFilter {
setIgnore(name != "releaseTest")
}
traceReferences {}
}

projectConfig {
javaFilesAllowed true
}
Expand Down Expand Up @@ -94,16 +88,35 @@ android {
exclude '*.properties'
exclude 'DebugProbesKt.bin'
}
lintOptions {
disable("UnknownNullness")
disable("Range")
lint {
disable += "UnknownNullness"
disable += "Range"
}
}


androidComponents {
beforeVariants(selector().withBuildType("releaseTest")) { builder ->
builder.registerExtension(KeeperVariantMarker.class, KeeperVariantMarker.INSTANCE)
}
}

keeper {
traceReferences {}
}

kotlinter {
experimentalRules = false
}

easylauncher {
buildTypes {
debug {
filters = customRibbon(ribbonColor: "#2F4F4F", position: "bottom")
}
}
}

repositories {
google()
maven { url 'https://jitpack.io' }
Expand Down Expand Up @@ -205,11 +218,3 @@ tasks.withType(DeviceProviderInstrumentTestTask).configureEach {
LoggerWrapper.Switch.shouldShowInfoLogsAsLifecycle = false
}
}

easylauncher {
buildTypes {
debug {
filters = customRibbon(ribbonColor: "#2F4F4F", position: "bottom")
}
}
}
4 changes: 1 addition & 3 deletions app/src/main/kotlin/io/github/wykopmobilny/WykopApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ open class WykopApp : DaggerApplication(), ApplicationInjector, AppScopes {
val coroutineScope: CoroutineScope,
)

// TODO @mk : 25/07/2021 I don't know where I'm going here yet. Will figure something out 👀
// TODO @mk : 25/07/2021 I don't know where I'm going here yet. Will figure something out 👀
@Suppress("UNCHECKED_CAST")
override fun <T : Any> getDependency(clazz: KClass<T>, scopeId: Any?): T =
when (clazz) {
Expand Down Expand Up @@ -412,6 +412,4 @@ open class WykopApp : DaggerApplication(), ApplicationInjector, AppScopes {
}
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class EntriesRepository @Inject constructor(
.retryWhen(userTokenRefresher)
.compose(ErrorHandlerTransformer())


override fun deleteEntryComment(commentId: Long) = rxSingle { entriesApi.deleteEntryComment(commentId) }
.retryWhen(userTokenRefresher)
.compose(ErrorHandlerTransformer())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,5 @@ class LinksRepository @Inject constructor(
rxSingle { linksApi.toggleFavorite(linkId) }
.retryWhen(userTokenRefresher)
.compose(ErrorHandlerTransformer())
.map { }
.map { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ class LoginRepository @Inject constructor(
val session = apiPreferences.session.first().let(::checkNotNull)
loginApi.getUserSessionToken(login = session.login, accountKey = session.token)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import kotlinx.coroutines.runBlocking

internal abstract class ThemableActivity : AppCompatActivity() {


override fun onCreate(savedInstanceState: Bundle?) {
val getAppStyle = requireDependency<StylesDependencies>().getAppStyle()
val initialStyle = runBlocking { getAppStyle().first() }.style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.app.NotificationManager
import android.content.Context
import dagger.Module
import dagger.Provides
import io.github.wykopmobilny.api.UserTokenRefresher
import io.github.wykopmobilny.api.user.LoginApi
import io.github.wykopmobilny.base.WykopSchedulers
import io.github.wykopmobilny.ui.modules.Navigator
import io.github.wykopmobilny.ui.modules.NavigatorApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ internal class CrashlyticsInitializer : Initializer<FirebaseCrashlytics> {

override fun dependencies() = emptyList<Class<out Initializer<*>>>()
}


Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ package io.github.wykopmobilny.models.mapper.apiv2
import io.github.wykopmobilny.api.filters.OWMContentFilter
import io.github.wykopmobilny.api.responses.LinkCommentResponse
import io.github.wykopmobilny.models.dataclass.LinkComment
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime
import org.threeten.bp.LocalDateTime
import org.threeten.bp.Month

object LinkCommentMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class NoProgressLinkAdapter @Inject constructor(
val items = mutableListOf<Link>()
lateinit var linksActionListener: LinkActionListener


private val linkShowImage by lazy { settingsPreferencesApi.linkShowImage }
private val showMinifiedImages by lazy { settingsPreferencesApi.showMinifiedImages }
private val linkSimpleList by lazy { settingsPreferencesApi.linkSimpleList }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import io.github.wykopmobilny.databinding.LinkBuryMenuBottomsheetBinding
import io.github.wykopmobilny.databinding.LinkDetailsHeaderLayoutBinding
import io.github.wykopmobilny.databinding.LinkMenuBottomsheetBinding
import io.github.wykopmobilny.models.dataclass.Link
import io.github.wykopmobilny.storage.api.SettingsPreferencesApi
import io.github.wykopmobilny.ui.fragments.link.LinkHeaderActionListener
import io.github.wykopmobilny.ui.fragments.link.LinkInteractor
import io.github.wykopmobilny.ui.modules.NewNavigator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class LinkViewHolder(
}
}


private var type: Int = TYPE_IMAGE
private lateinit var previewImageView: ImageView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ class TopLinkCommentViewHolder(
showAdultContent: Boolean,
hideNsfw: Boolean
) {
super.bindView(linkComment,
super.bindView(
linkComment,
isAuthorComment,
commentId,
openSpoilersDialog,
enableYoutubePlayer,
enableEmbedPlayer,
showAdultContent,
hideNsfw)
hideNsfw
)

binding.authorHeaderView.setAuthorData(linkComment.author, linkComment.date, linkComment.app)
if (linkComment.isCollapsed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal class LinkDetailsActivityV2 : ThemableActivity() {
fun createIntent(context: Context, linkId: Long, commentId: Long? = null) =
Intent(context, LinkDetailsActivityV2::class.java).apply {
putExtra(EXTRA_LINK_ID, linkId)
commentId?.let{ putExtra(EXTRA_COMMENT_ID, it) }
commentId?.let { putExtra(EXTRA_COMMENT_ID, it) }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import io.github.wykopmobilny.utils.intoComposite
import io.github.wykopmobilny.utils.usermanager.UserManagerApi
import io.github.wykopmobilny.utils.usermanager.isUserAuthorized
import io.reactivex.Observable
import io.reactivex.disposables.CompositeDisposable
import java.util.concurrent.TimeUnit
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.wykopmobilny.ui.modules.mikroblog.entry

import android.app.Activity
import android.app.Application
import android.content.Context
import android.content.Intent
import android.net.Uri
Expand Down Expand Up @@ -206,7 +205,7 @@ class EntryActivity :
}

override fun openGalleryImageChooser() {
contract.launch( "image/*")
contract.launch("image/*")
}

override fun onBackPressed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import io.github.wykopmobilny.utils.viewBinding

internal class TwoFactorAuthorizationActivity : ThemableActivity() {


private val binding by viewBinding(ActivityContainerBinding::inflate)

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ repositories {

dependencies {
implementation(gradleApi())
implementation("com.project.starter:android:0.41.0")
implementation("com.project.starter:android:0.42.0")
implementation("com.gradleup:auto-manifest-plugin:1.0.4")
implementation("com.google.gms:google-services:4.3.10")
implementation("com.google.firebase:firebase-crashlytics-gradle:2.8.1")
implementation("com.slack.keeper:keeper:0.11.1")
implementation("com.slack.keeper:keeper:0.12.0")
implementation("com.google.firebase:perf-plugin:1.4.1")
implementation("com.squareup.sqldelight:gradle-plugin:1.5.3")
implementation("com.android.tools:common:30.0.4")
implementation("com.android.tools:common:30.1.1")
implementation("com.karumi:shot:5.13.0")
implementation("pl.droidsonroids.gradle:plugin:1.0.9")
}
Expand Down
1 change: 1 addition & 0 deletions data/framework/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<queries>
<package android:name="com.google.android.youtube" />
<package android:name="com.vanced.android.youtube" />
<package android:name="org.schabi.newpipe" />

<package android:name="com.google.android.apps.authenticator2" />
<package android:name="com.authy.authy" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private fun knownAppId(app: ExternalApp) =
when (app) {
YoutubeApp.Official -> "com.google.android.youtube"
YoutubeApp.Vanced -> "com.vanced.android.youtube"
YoutubeApp.NewPipe -> "org.schabi.newpipe"
AuthenticatorApp.Google -> "com.google.android.apps.authenticator2"
AuthenticatorApp.Microsoft -> "com.azure.authenticator"
AuthenticatorApp.Authy -> "com.authy.authy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ import io.github.wykopmobilny.domain.navigation.NavigationMode
import io.github.wykopmobilny.domain.navigation.NightModeState
import io.github.wykopmobilny.domain.navigation.SystemSettingsDetector
import io.github.wykopmobilny.ui.base.AppDispatchers
import io.github.wykopmobilny.ui.base.AppScopes
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.withContext
import javax.inject.Inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.app.Application
import dagger.BindsInstance
import dagger.Component
import io.github.wykopmobilny.domain.navigation.Framework
import io.github.wykopmobilny.ui.base.AppScopes
import kotlinx.coroutines.CoroutineScope

@Component(modules = [FrameworkModule::class])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sealed interface ExternalApp
enum class YoutubeApp : ExternalApp {
Official,
Vanced,
NewPipe,
}

enum class AuthenticatorApp : ExternalApp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.content.Context
import androidx.work.CoroutineWorker
import androidx.work.WorkerParameters
import io.github.aakira.napier.Napier
import kotlinx.coroutines.flow.first

internal class RefreshBlacklistRequest(
context: Context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ internal class GetMediaPreferences @Inject constructor(
appStorage.get(UserSettings.useYoutubePlayer)
.flatMapLatest { savedValue ->
if (savedValue == null) {
appGateway.getInstalledYoutubeApps().map { it.contains(YoutubeApp.Official) }
appGateway.getInstalledYoutubeApps()
.map { apps -> apps.singleOrNull() == YoutubeApp.Official }
} else {
flowOf(savedValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package io.github.wykopmobilny.utils
import android.view.View
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import androidx.viewbinding.ViewBinding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ suspend fun Flow<InfoDialogUi?>.collectInfoDialog(context: Context) {
.show().also {
it?.findViewById<TextView>(android.R.id.message)?.movementMethod = LinkMovementMethod.getInstance()
}


} else {
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,5 @@ private class PickerListAdapter : ListAdapter<OptionPickerUi.Option, PickerListA

override fun areContentsTheSame(oldItem: OptionPickerUi.Option, newItem: OptionPickerUi.Option) =
oldItem.label == newItem.label && oldItem.icon == newItem.icon

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ fun AvatarView.bind(model: AvatarUi?) {

binding.imgAvatar.setOnClick(model?.onClicked)


if (getTag(R.id.cache) == model.toString()) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import androidx.core.view.isVisible
import io.github.wykopmobilny.ui.components.widgets.MessageBodyUi
import java.util.regex.Pattern


class BodyContentView(context: Context, attrs: AttributeSet?) : AppCompatTextView(context, attrs) {

private val ellipsis = SpannableString("\u0020[rozwiń]")
Expand Down Expand Up @@ -152,7 +151,6 @@ private object SelectableLinkMovement : LinkMovementMethod() {
}
}


fun BodyContentView.bind(body: MessageBodyUi) {
isVisible = body.content != null
onViewMoreClicked = body.viewMoreAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ fun DomainColor?.toColorInt(context: Context): ColorStateList =
}.let(context::readColorAttr)
null -> ColorStateList.valueOf(Color.TRANSPARENT)
}

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,5 @@ fun Context.readAttr(@AttrRes attrColor: Int): Int {
return typedValue.resourceId
}


val View.layoutInflater: LayoutInflater
get() = LayoutInflater.from(context)
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ private val LinkCommentUi.id
is LinkCommentUi.Normal -> id
}


@OptIn(ExperimentalStdlibApi::class)
internal fun LinkDetailsUi.toAdapterList(): List<ListItem> = buildList {
add(ListItem.Header(header))
Expand Down
Loading

0 comments on commit f856a64

Please sign in to comment.