diff --git a/.travis.yml b/.travis.yml index 8fe7b3dd2..b89ff79ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,8 @@ cache: - "$HOME/.gradle/caches/" - "$HOME/.gradle/wrapper/" - "$HOME/.android/build-cache" +before_script: +- echo -e "apiKey=\"$wykopApiKey\"\napiSecret=\"$wykopApiSecret\"" >> credentials.properties script: - "./gradlew assembleRelease" deploy: @@ -35,8 +37,8 @@ env: global: - secure: teHBCHSeoGRamuHwwfqRVs7xs/oia911ij0oBdVg4Na9KbunnNJRAFwVB3RWCKhbaVAJkOvoKyNuWWIeXedS+Ia9/IBsSlvL0tOXdJZUtzM0tq56VNMncllDyleBUfBvYCsaDtsb54c0G6fgdjpD1C0l8+rGnJn7IbIWChTtblXpcoulCGmmnq/lp2KtHBEr8frZvChQMXmGdroiiJLWVhhVmtsyorc3tsI3CdaHVzztFh9ruzT45Wky0oYWuT16wLYaPiVGBR6S9Ear70TCXSIj6y2Mxu4Yt/Ig4o4zYp/9vVc5Exk+DZ4bZxJ+DaKNji8LSPVzEyVjWkmMuewELUusbV2Vrkg/bBYHeRjB/f5EHS+6lpQL4paRxtRL7UOBzAYsF6ckxKMEyksl4lXT1on8whfDhtWLWl81IboDX6Bsp53p2Nb7BJPENfEsUM5WhhYdFsqIiYrSfM61uxdpYkp/jy70uwMlWbgojvvs0hifC2L7Ve+iacJnDcnMPsvy//2V3PWtcAobiBNH7d5934YIEq3O0ylyyaxqWd1wtKej42woQrXLTTM/F0mXio6CrrEiJ0EYs83fxgyI055hPOecW1Zh0mRMuT/Mo8N/EsDGkpYRzBXPw1nylN0jGyg1y4zTTScKo/Ezk0TvmIpaM5Le0FEYRW9J8Rp6xaUyZds= - secure: DnMnA8OB7PufQnJE8+PNN5BZ9pWCCjmggMSm9nlJAJQX9VGYK7+vFRosYA27u++f/neZYR6IHr8iaIaUFCBUzIZ2/WT+bwuz1TiREKTbJCtbvOS/N36Zpm992psU11zCtVPlkg44/yJe1ItH/ctAwQE3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oDyhacrUNL1eMjXhjzASi0v7KLC4wTE4WOBows3axuGhY0Y5OXsFoyk+yYfkEbcbr2P8NBEm8tDXVY8vSaHxPcAgaMomvjhF0Cm1rF+cwvEG0QrtkSw2X5XcU8xnCuxyRo= + - secure: 1rvT9iqxBXdv3KgJTdmH2lSl32wtzMLj6t2q4Wb/arJfjo+xMrK08G24o84EMbPQhi00zm+pbUgoeMjFPRF4OWex4ZXlHNaNQTlRUYTddh/DXPUKackxM9F66rse5Yk/xT0e8PgjtSAVZYKsP4sVlB4TW+BikPmUjJJvynobqrW/+OqjeEYJtT/Oc4Hd/CszMcYOyfN3nv+5+Dr1ZMr4ZKcxs0iv6+EzLAA/Ix6eEabTlba+/HQYPwJj4F7cShM4kLok+Cjlc67FMSQfKMnZgVThZLYk/gfbj9+ep5/oJq/9c+zoKWupNvSiwRQ6JjFVRWnbSxMwodVq2bERQDfMxlvavAW/iryYrc/bmUaFCnGm4AglJmi5k5AqeL4MeTyALvpS6j4JmWfKFfFtl9s8El0Qibr6GDiSbaDuS42zjXu1UqyHYPMzZYCr9aek+ImuURT/gTo8QKjGvWu9acIa2k4sHXwN+4Smbj2T4SII5BnZdOSbPqrzA+eWqbW14Mi2FMKWF//0QNUdvwthermEXopcQjA3IEP+vu8QKTib00oSfaEkvVYmi2Rr9KEa6EOYsDxaF3kqqggSRIVsIOXBZavxQfzNVIDTwzHd7QhnIkwSdJddjD5R7pSqPlDS/SuCbonPCUR6h9IFNkx24WvbEXMcfkanSfhPMI1HdKtt5wk= before_install: - openssl aes-256-cbc -K $encrypted_110fd07a76f6_key -iv $encrypted_110fd07a76f6_iv -in ci-release-keystore.jks.enc -out ci-release-keystore.jks -d -- openssl aes-256-cbc -K $encrypted_110fd07a76f6_key -iv $encrypted_110fd07a76f6_iv - -in credentials.properties.enc -out credentials.properties -d diff --git a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/api/notifications/NotificationsRepository.kt b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/api/notifications/NotificationsRepository.kt index df4e40b00..f114db12c 100644 --- a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/api/notifications/NotificationsRepository.kt +++ b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/api/notifications/NotificationsRepository.kt @@ -5,6 +5,8 @@ import io.github.feelfreelinux.wykopmobilny.models.dataclass.Notification import io.github.feelfreelinux.wykopmobilny.models.mapper.apiv2.NotificationMapper import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.NotificationResponse import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.NotificationsCountResponse +import io.reactivex.Observable +import io.reactivex.subjects.PublishSubject import retrofit2.Retrofit class NotificationsRepository(val retrofit: Retrofit) : NotificationsApi { @@ -21,8 +23,8 @@ class NotificationsRepository(val retrofit: Retrofit) : NotificationsApi { .compose(ErrorHandlerTransformer()) override fun readHashTagNotifications() = mywykopApi.readHashTagsNotifications() - .map { emptyList() } - + .compose>(ErrorHandlerTransformer()) + .map { it.map { NotificationMapper.map(it) } } override fun getHashTagNotifications(page : Int) = mywykopApi.getHashTagsNotifications(page) .compose>(ErrorHandlerTransformer()) diff --git a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/modules/mainnavigation/MainNavigationActivity.kt b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/modules/mainnavigation/MainNavigationActivity.kt index 69d3a86bf..687a6c880 100644 --- a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/modules/mainnavigation/MainNavigationActivity.kt +++ b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/modules/mainnavigation/MainNavigationActivity.kt @@ -30,6 +30,7 @@ import io.github.feelfreelinux.wykopmobilny.ui.modules.pm.conversationslist.Conv import io.github.feelfreelinux.wykopmobilny.ui.modules.settings.SettingsActivity import io.github.feelfreelinux.wykopmobilny.utils.SettingsPreferencesApi import io.github.feelfreelinux.wykopmobilny.utils.isVisible +import io.github.feelfreelinux.wykopmobilny.utils.printout import kotlinx.android.synthetic.main.activity_navigation.* import kotlinx.android.synthetic.main.activity_navigation.view.* import kotlinx.android.synthetic.main.drawer_header_view_layout.view.* @@ -137,6 +138,7 @@ class NavigationActivity : BaseActivity(), MainNavigationView, NavigationView.On override fun onResume() { super.onResume() + printout("RESUME") presenter.subscribe(this) navHeader.view_container.startListeningForUpdates() } diff --git a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderPresenter.kt b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderPresenter.kt index 2ff9a0618..d1b6f0d3a 100644 --- a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderPresenter.kt +++ b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderPresenter.kt @@ -3,6 +3,7 @@ package io.github.feelfreelinux.wykopmobilny.ui.widgets.drawerheaderview import io.github.feelfreelinux.wykopmobilny.api.notifications.NotificationsApi import io.github.feelfreelinux.wykopmobilny.base.BasePresenter import io.github.feelfreelinux.wykopmobilny.models.pojo.apiv2.models.NotificationsCountResponse +import io.github.feelfreelinux.wykopmobilny.utils.printout import io.github.feelfreelinux.wykopmobilny.utils.rx.SubscriptionHelperApi import io.reactivex.Observable import io.reactivex.Single @@ -11,10 +12,12 @@ import java.util.concurrent.TimeUnit class DrawerHeaderPresenter(val subscriptionHelper: SubscriptionHelperApi, private val notificationsApi: NotificationsApi) : BasePresenter() { - private val intervalDisposable = CompositeDisposable() + private var intervalDisposable = CompositeDisposable() fun fetchNotifications() { intervalDisposable.clear() + intervalDisposable.dispose() + intervalDisposable = CompositeDisposable() intervalDisposable.add( Observable.interval(0, 5, TimeUnit.MINUTES) .map { notificationsApi.getHashTagNotificationCount() } diff --git a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderWidget.kt b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderWidget.kt index f59902627..5223aa494 100644 --- a/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderWidget.kt +++ b/app/src/main/kotlin/io/github/feelfreelinux/wykopmobilny/ui/widgets/drawerheaderview/DrawerHeaderWidget.kt @@ -57,7 +57,6 @@ class DrawerHeaderWidget : ConstraintLayout, DrawerHeaderView { } override fun onDetachedFromWindow() { - printout("Deattached") presenter.unsubscribe() super.onDetachedFromWindow() } diff --git a/credentials.properties.enc b/credentials.properties.enc deleted file mode 100644 index 9814b7cbf..000000000 --- a/credentials.properties.enc +++ /dev/null @@ -1,2 +0,0 @@ -…« -æVÖ¯„í‰,j02›†YX…vCŒ¾Àq Ùé+\ÕT©V¾ª¦ç¬…ˆ#Õ \ No newline at end of file