Skip to content

Commit 7264420

Browse files
Remove shared preferences banners
1 parent aa3ba4f commit 7264420

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

app/src/main/java/org/stepic/droid/preferences/SharedPreferenceHelper.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ public class SharedPreferenceHelper {
112112
private final static String IS_PERSONALIZED_ONBOARDING_WAS_SHOWN = "is_personalized_onboarding_was_shown";
113113
private final static String ENDPOINT_CONFIG = "endpoint_config";
114114

115-
private final static String BANNERS_JSON = "banners_json";
116-
117115
private OAuthResponse cachedAuthStepikResponse = null;
118116

119117

@@ -874,14 +872,6 @@ public int getEndpointConfig() {
874872
return getInt(PreferenceType.DEVICE_SPECIFIC, ENDPOINT_CONFIG, 2);
875873
}
876874

877-
public void putBannersJson(String json) {
878-
put(PreferenceType.DEVICE_SPECIFIC, BANNERS_JSON, json);
879-
}
880-
881-
public String getBannersJson() {
882-
return getString(PreferenceType.DEVICE_SPECIFIC, BANNERS_JSON);
883-
}
884-
885875
@Nullable
886876
public String getCookiesHeader() {
887877
return getString(PreferenceType.LOGIN, COOKIES_HEADER);

app/src/main/java/org/stepik/android/domain/banner/interactor/BannerInteractor.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.google.firebase.remoteconfig.FirebaseRemoteConfig
44
import com.google.gson.Gson
55
import com.google.gson.reflect.TypeToken
66
import io.reactivex.Single
7+
import org.stepic.droid.configuration.RemoteConfig
78
import org.stepic.droid.preferences.SharedPreferenceHelper
89
import org.stepik.android.domain.banner.model.Banner
910
import java.lang.Exception
@@ -18,10 +19,8 @@ constructor(
1819
) {
1920
fun getBanners(screen: Banner.Screen): Single<List<Banner>> =
2021
Single.fromCallable {
21-
val bannersJson: String? = sharedPreferenceHelper.bannersJson
22-
// val bannersJson = firebaseRemoteConfig.getString(RemoteConfig.BANNERS_ANDROID)
23-
if (bannersJson == null || bannersJson.isEmpty()) {
24-
sharedPreferenceHelper.putBannersJson("")
22+
val bannersJson = firebaseRemoteConfig.getString(RemoteConfig.BANNERS_ANDROID)
23+
if (bannersJson.isEmpty()) {
2524
emptyList()
2625
} else {
2726
try {

0 commit comments

Comments
 (0)