Skip to content
This repository has been archived by the owner on Dec 8, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:afollestad/aesthetic
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan Follestad authored and Aidan Follestad committed May 20, 2017
2 parents d603c69 + 12e2794 commit 192b1a6
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions library/src/main/java/com/afollestad/aesthetic/Aesthetic.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.afollestad.aesthetic;

import static com.afollestad.aesthetic.Rx.onErrorLogAndRethrow;
import static com.afollestad.aesthetic.Util.isColorLight;
import static com.afollestad.aesthetic.Util.resolveColor;
import static com.afollestad.aesthetic.Util.setLightStatusBarCompat;
import static com.afollestad.aesthetic.Util.setNavBarColorCompat;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
Expand All @@ -19,25 +25,16 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.f2prateek.rx.preferences2.RxSharedPreferences;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.functions.BiFunction;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.functions.Predicate;

import static com.afollestad.aesthetic.Rx.onErrorLogAndRethrow;
import static com.afollestad.aesthetic.Util.isColorLight;
import static com.afollestad.aesthetic.Util.resolveColor;
import static com.afollestad.aesthetic.Util.setLightStatusBarCompat;
import static com.afollestad.aesthetic.Util.setNavBarColorCompat;
import java.util.ArrayList;
import java.util.List;

/** @author Aidan Follestad (afollestad) */
@SuppressWarnings({"WeakerAccess", "unused"})
Expand Down Expand Up @@ -242,6 +239,7 @@ public void accept(@io.reactivex.annotations.NonNull Integer color) {
onErrorLogAndRethrow()));
}

/** Returns true if this method has never been called before. */
public static boolean isFirstTime() {
boolean firstTime = instance.prefs.getBoolean(KEY_FIRST_TIME, true);
instance.editor.putBoolean(KEY_FIRST_TIME, false).commit();
Expand Down Expand Up @@ -759,6 +757,7 @@ public Aesthetic snackbarActionTextColorRes(@ColorRes int color) {
return colorCardViewBackground(ContextCompat.getColor(context, color));
}

/** Notifies all listening views that theme properties have been updated. */
public void apply() {
editor.commit();
}
Expand Down

0 comments on commit 192b1a6

Please sign in to comment.