Fix color glich

This commit is contained in:
Tanguy Herbron 2018-06-17 03:45:26 +02:00
parent 5a512a304a
commit 91a1551fa7
9 changed files with 17 additions and 9 deletions

4
.idea/gradle.xml generated
View File

@ -3,9 +3,9 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="distributionType" value="LOCAL" /> <option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-4.7" /> <option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-4.1" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

View File

@ -42,6 +42,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import static com.herbron.moodl.MoodlBox.getColor;
import static java.lang.Math.abs; import static java.lang.Math.abs;
/** /**
@ -282,7 +283,7 @@ public class MarketCapitalization extends Fragment {
Palette.Builder builder = Palette.from(bitmapIcon); Palette.Builder builder = Palette.from(bitmapIcon);
marketCapManager.getTopCurrencies().get(index).setIcon(bitmapIcon); marketCapManager.getTopCurrencies().get(index).setIcon(bitmapIcon);
marketCapManager.getTopCurrencies().get(index).setChartColor(builder.generate().getDominantColor(0)); marketCapManager.getTopCurrencies().get(index).setChartColor(builder.generate().getDominantColor(getColor(R.color.default_color, getContext())));
countIcons(); countIcons();
} }

View File

@ -42,6 +42,7 @@ import com.herbron.moodl.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.herbron.moodl.MoodlBox.getColor;
import static com.herbron.moodl.MoodlBox.numberConformer; import static com.herbron.moodl.MoodlBox.numberConformer;
import static java.lang.Math.abs; import static java.lang.Math.abs;
@ -520,11 +521,11 @@ public class Summary extends Fragment implements BalanceSwitchManagerInterface {
{ {
Palette.Builder builder = Palette.from(currency.getIcon()); Palette.Builder builder = Palette.from(currency.getIcon());
currency.setChartColor(builder.generate().getDominantColor(0)); currency.setChartColor(builder.generate().getDominantColor(getColor(R.color.default_color, getContext())));
} }
else else
{ {
currency.setChartColor(12369084); currency.setChartColor(getColor(R.color.default_color, getContext()));
} }
} }

View File

@ -39,6 +39,7 @@ import org.json.JSONObject;
import static com.herbron.moodl.MoodlBox.collapseW; import static com.herbron.moodl.MoodlBox.collapseW;
import static com.herbron.moodl.MoodlBox.expandW; import static com.herbron.moodl.MoodlBox.expandW;
import static com.herbron.moodl.MoodlBox.getColor;
import static java.lang.Math.abs; import static java.lang.Math.abs;
/** /**
@ -354,11 +355,11 @@ public class Watchlist extends Fragment {
{ {
Palette.Builder builder = Palette.from(currency.getIcon()); Palette.Builder builder = Palette.from(currency.getIcon());
currency.setChartColor(builder.generate().getDominantColor(0)); currency.setChartColor(builder.generate().getDominantColor(getColor(R.color.default_color, getContext())));
} }
else else
{ {
currency.setChartColor(12369084); currency.setChartColor(getColor(R.color.default_color, getContext()));
} }
} }

View File

@ -4,6 +4,7 @@ import android.graphics.Bitmap;
import android.graphics.Color; import android.graphics.Color;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.util.Log;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;

View File

@ -12,6 +12,7 @@ import android.os.Build;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView; import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -35,6 +36,7 @@ import java.util.List;
import static com.herbron.moodl.MoodlBox.collapseH; import static com.herbron.moodl.MoodlBox.collapseH;
import static com.herbron.moodl.MoodlBox.expandH; import static com.herbron.moodl.MoodlBox.expandH;
import static com.herbron.moodl.MoodlBox.getColor;
import static com.herbron.moodl.MoodlBox.numberConformer; import static com.herbron.moodl.MoodlBox.numberConformer;
/** /**
@ -341,9 +343,9 @@ public class CurrencyCardview extends CardView {
dataSet = new LineDataSet(values, ""); dataSet = new LineDataSet(values, "");
dataSet.setDrawIcons(false); dataSet.setDrawIcons(false);
dataSet.setColor(currency.getChartColor()); dataSet.setColor(currency.getChartColor());
dataSet.setFillColor(getColorWithAplha(currency.getChartColor(), 0.5f));
dataSet.setLineWidth(1); dataSet.setLineWidth(1);
dataSet.setDrawFilled(true); dataSet.setDrawFilled(true);
dataSet.setFillColor(getColorWithAplha(currency.getChartColor(), 0.5f));
dataSet.setFormLineWidth(1); dataSet.setFormLineWidth(1);
dataSet.setFormSize(15); dataSet.setFormSize(15);
dataSet.setDrawCircles(false); dataSet.setDrawCircles(false);

View File

@ -4,6 +4,7 @@ import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.support.v7.widget.CardView; import android.support.v7.widget.CardView;

View File

@ -40,4 +40,5 @@
<color name="transparent_green">#225DBF61</color> <color name="transparent_green">#225DBF61</color>
<color name="blue">#FF689afe</color> <color name="blue">#FF689afe</color>
<color name="transparent_blue">#22689afe</color> <color name="transparent_blue">#22689afe</color>
<color name="default_color">#FFAAAAAA</color>
</resources> </resources>

View File

@ -1,4 +1,4 @@
#Sun May 13 20:31:16 CEST 2018 #Sun Jun 17 03:10:32 CEST 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME