Skip to content

Commit

Permalink
Merge branch 'release/1.80'
Browse files Browse the repository at this point in the history
  • Loading branch information
eadm committed Mar 25, 2019
2 parents 7683c06 + 3c551ce commit 73596b7
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 52 deletions.
86 changes: 46 additions & 40 deletions app/src/main/assets/wysiwyg.css
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
color: inherit;
font-weight: inherit;
min-height: 2em;
display: inline-block;
}

&.block pre code {
Expand Down Expand Up @@ -255,57 +256,62 @@
}

.hljs {
display: block;
overflow-x: auto;
padding: .5em;
background: #fdf6e3;
color: #657b83;
-webkit-text-size-adjust: none
background: #f3f4f6;
color: #000;
-webkit-text-size-adjust: none;
-webkit-font-smoothing: antialiased;
}

.diff .hljs-header, .hljs-comment, .hljs-doctype, .hljs-pi, .lisp .hljs-string {
color: #93a1a1
}
.hljs-comment, .hljs-quote {
color: #800
}

.css .hljs-tag, .hljs-addition, .hljs-keyword, .hljs-request, .hljs-status,
.hljs-winutils, .method, .nginx .hljs-title {
color: #859900
}
.hljs-keyword, .hljs-name, .hljs-section, .hljs-selector-tag, .hljs-title {
color: #008
}

.hljs-command, .hljs-doctag, .hljs-hexcolor, .hljs-link_url, .hljs-number,
.hljs-regexp, .hljs-rule .hljs-value, .hljs-string, .hljs-tag .hljs-value,
.tex .hljs-formula {
color: #2aa198
}
.hljs-template-variable, .hljs-variable {
color: #660
}

.css .hljs-function, .hljs-built_in, .hljs-chunk, .hljs-decorator,
.hljs-id, .hljs-identifier, .hljs-localvars, .hljs-name, .hljs-title,
.vhdl .hljs-literal {
color: #268bd2
}
.hljs-regexp, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-string {
color: #080
}

.hljs-attribute, .hljs-class .hljs-title, .hljs-constant, .hljs-link_reference,
.hljs-parent, .hljs-type, .hljs-variable, .lisp .hljs-body, .smalltalk .hljs-number {
color: #b58900
}
.hljs-bullet, .hljs-link, .hljs-literal, .hljs-meta, .hljs-number,
.hljs-symbol {
color: #066
}

.css .hljs-pseudo, .diff .hljs-change, .hljs-attr_selector, .hljs-cdata,
.hljs-header, .hljs-pragma, .hljs-preprocessor, .hljs-preprocessor .hljs-keyword,
.hljs-shebang, .hljs-special, .hljs-subst, .hljs-symbol, .hljs-symbol .hljs-string {
color: #cb4b16
}
.hljs-attr, .hljs-built_in, .hljs-builtin-name, .hljs-doctag, .hljs-params,
.hljs-title, .hljs-type {
color: #606
}

.hljs-deletion, .hljs-important {
color: #dc322f
}
.hljs-attribute, .hljs-subst {
color: #000
}

.hljs-link_label {
color: #6c71c4
}
.hljs-formula {
background-color: #eee
}

.tex .hljs-formula {
background: #eee8d5
}
.hljs-selector-class, .hljs-selector-id {
color: #9B703F
}

.hljs-addition {
background-color: #baeeba
}

.hljs-deletion {
background-color: #ffc8bd
}

.hljs-doctag, .hljs-strong {
font-weight: 700
}

body table {
border-collapse: collapse;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.stepic.droid.analytic.experiments

import org.stepic.droid.analytic.Analytic
import org.stepic.droid.preferences.SharedPreferenceHelper
import javax.inject.Inject

class VideoSplitTest
@Inject
constructor(
analytics: Analytic,
sharedPreferenceHelper: SharedPreferenceHelper
) : SplitTest<VideoSplitTest.Group>(
analytics,
sharedPreferenceHelper,

name = "video_in_course_description",
groups = Group.values()
) {
enum class Group(
val isVideoEnabled: Boolean,
override val distribution: Int
) : SplitTest.Group {
Control(isVideoEnabled = true, distribution = 3),
NoVideo(isVideoEnabled = false, distribution = 1)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import org.stepic.droid.analytic.AnalyticImpl
import org.stepic.droid.analytic.experiments.AchievementsSplitTest
import org.stepic.droid.analytic.experiments.SplitTest
import org.stepic.droid.analytic.experiments.PersonalDeadlinesSplitTest
import org.stepic.droid.analytic.experiments.VideoSplitTest
import org.stepic.droid.di.AppSingleton

@Module
Expand All @@ -26,4 +27,8 @@ abstract class AnalyticModule {
@IntoSet
internal abstract fun bindAchievementsSplitTest(achievementsSplitTest: AchievementsSplitTest): SplitTest<*>

@AppSingleton
@Binds
@IntoSet
internal abstract fun bindVideoSplitTest(videoSplitTest: VideoSplitTest): SplitTest<*>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package org.stepic.droid.storage.structure

object DatabaseInfo {
const val FILE_NAME = "stepic_database.db"
const val VERSION = 38
const val VERSION = 39
}
10 changes: 7 additions & 3 deletions app/src/main/java/org/stepic/droid/web/ApiImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,9 @@ public Call<EmailAddressResponse> getEmailAddresses(@NotNull long[] ids) {

@Override
public Call<Void> sendFeedback(String email, String rawDescription) {
OkHttpClient okHttpClient = new OkHttpClient();
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.addNetworkInterceptor(stethoInterceptor)
.build();
Retrofit notLogged = new Retrofit.Builder()
.baseUrl(config.getZendeskHost())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
Expand All @@ -764,11 +766,13 @@ public Call<Void> sendFeedback(String email, String rawDescription) {

Profile profile = sharedPreference.getProfile();
String name = "";
String link = "";
if (profile != null) {
name = profile.getFullName();
name = "" + profile.getFullName();
link = config.getBaseUrl() + "/users/" + profile.getId();
}

return tempService.sendFeedback(new DeskRequestWrapper(name, email, subject, rawDescription));
return tempService.sendFeedback(new DeskRequestWrapper(name, email, subject, rawDescription, link, aboutSystem));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ package org.stepic.droid.web.model.desk

import com.google.gson.annotations.SerializedName

class DeskComment(@SerializedName("html_body") val htmlBody: String)
class DeskComment(
@SerializedName("html_body")
val htmlBody: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.stepic.droid.web.model.desk

import com.google.gson.annotations.SerializedName

class DeskCustomFields(
@SerializedName("360015393634")
val technicalDetails: String,
@SerializedName("360015393334")
val link: String
)
13 changes: 12 additions & 1 deletion app/src/main/java/org/stepic/droid/web/model/desk/DeskRequest.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
package org.stepic.droid.web.model.desk

class DeskRequest(val requester: DeskRequester, val subject: String, val comment: DeskComment)
import com.google.gson.annotations.SerializedName

class DeskRequest(
@SerializedName("requester")
val requester: DeskRequester,
@SerializedName("subject")
val subject: String,
@SerializedName("comment")
val comment: DeskComment,
@SerializedName("custom_fields")
val customFields: DeskCustomFields
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
package org.stepic.droid.web.model.desk

class DeskRequestWrapper(val request: DeskRequest) {
constructor(name: String, email: String, subject: String, comment: String) : this(DeskRequest(DeskRequester(name, email), subject, DeskComment(comment)))
import com.google.gson.annotations.SerializedName

class DeskRequestWrapper(
@SerializedName("request")
val request: DeskRequest
) {
constructor(
name: String,
email: String,
subject: String,
comment: String,

link: String,
technicalDetails: String
) : this(
request = DeskRequest(
requester = DeskRequester(name, email),
subject = subject,
comment = DeskComment(comment),
customFields = DeskCustomFields(
link = link,
technicalDetails = technicalDetails
)
)
)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
package org.stepic.droid.web.model.desk

class DeskRequester(val name: String, val email: String)
import com.google.gson.annotations.SerializedName

class DeskRequester(
@SerializedName("name")
val name: String,
@SerializedName("email")
val email: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import io.reactivex.Scheduler
import io.reactivex.rxkotlin.plusAssign
import io.reactivex.rxkotlin.subscribeBy
import org.stepic.droid.analytic.experiments.VideoSplitTest
import org.stepic.droid.di.qualifiers.BackgroundScheduler
import org.stepic.droid.di.qualifiers.MainScheduler
import org.stepik.android.domain.course_info.interactor.CourseInfoInteractor
Expand All @@ -16,6 +17,8 @@ class CourseInfoPresenter
constructor(
private val courseInfoInteractor: CourseInfoInteractor,

private val videoSplitTest: VideoSplitTest,

@BackgroundScheduler
private val backgroundScheduler: Scheduler,
@MainScheduler
Expand Down Expand Up @@ -47,7 +50,13 @@ constructor(
.observeOn(mainScheduler)
.subscribeOn(backgroundScheduler)
.subscribeBy(
onNext = { state = CourseInfoView.State.CourseInfoLoaded(it) }
onNext = {
state = if (videoSplitTest.currentGroup.isVideoEnabled) {
CourseInfoView.State.CourseInfoLoaded(it)
} else {
CourseInfoView.State.CourseInfoLoaded(it.copy(videoMediaData = null))
}
}
)
}

Expand Down
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ext.versions = [
code : 2018,
name : '1.79',
code : 2019,
name : '1.80',

minSdk : 15,
targetSdk : 26,
Expand Down

0 comments on commit 73596b7

Please sign in to comment.