minor design updates

This commit is contained in:
Phillip Thelen 2017-09-22 12:49:55 +02:00
parent f3afda0720
commit 528b9124ed
47 changed files with 198 additions and 117 deletions

View file

@ -37,13 +37,15 @@ repositories {
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//Networking
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.9.0'
//REST API handling
compile('com.squareup.retrofit2:retrofit:2.3.0') {
exclude module: 'okhttp'
@ -55,8 +57,8 @@ dependencies {
transitive = true;
}
// View Elements Binding :)
compile 'com.jakewharton:butterknife:8.6.0'
apt 'com.jakewharton:butterknife-compiler:8.6.0'
compile 'com.jakewharton:butterknife:8.8.1'
apt 'com.jakewharton:butterknife-compiler:8.8.1'
//Dependency Injection
compile 'com.google.dagger:dagger:2.11'
apt 'com.google.dagger:dagger-compiler:2.11'
@ -65,17 +67,16 @@ dependencies {
compile('com.mikepenz:materialdrawer:5.8.3@aar') {
transitive = true
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:preference-v14:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:preference-v14:26.1.0'
//QR Code
compile 'com.github.kenglxn.QRGen:android:2.2.0'
// Emojis
compile 'com.github.viirus:emoji-lib:0.0.5'
// Markdown
compile 'com.commonsware.cwac:anddown:0.3.0'
compile 'com.commonsware.cwac:anddown:0.4.0'
// About View for all dependent Libraries, we are using
compile('com.mikepenz:aboutlibraries:5.9.4@aar') {
transitive = true
@ -95,14 +96,14 @@ dependencies {
compile 'com.github.javadev:underscore:1.23'
//RxJava
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.3.0'
compile 'io.reactivex:rxjava:1.3.2'
//Analytics
compile 'com.amplitude:android-sdk:2.13.3'
compile 'com.amplitude:android-sdk:2.14.1'
// Fresco Image Management Library
compile('com.facebook.fresco:fresco:1.3.0') {
compile('com.facebook.fresco:fresco:1.5.0') {
exclude module: 'bolts-android'
}
compile('com.facebook.fresco:animated-gif:1.3.0') {
compile('com.facebook.fresco:animated-gif:1.5.0') {
exclude module: 'bolts-android'
}
//Tests
@ -121,9 +122,9 @@ dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
//Push Notifications
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.google.firebase:firebase-core:11.4.0'
compile 'com.google.firebase:firebase-messaging:11.4.0'
compile 'com.google.android.gms:play-services-auth:11.4.0'
compile 'org.apmem.tools:layouts:1.10@aar'
compile 'com.roughike:bottom-bar:2.3.1'
compile 'io.realm:android-adapters:2.1.0'
@ -134,8 +135,8 @@ dependencies {
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.habitrpg.android.habitica"

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 679 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1,007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -19,7 +19,7 @@
android:layout_gravity="center_vertical"
android:layout_margin="12dp"
android:scaleType="center"
android:src="@drawable/custom_reward" />
android:src="@drawable/icon_custom_reward" />
<LinearLayout
android:id="@+id/textReward"

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/layout_rounded_bg_gray_700"
android:gravity="center_vertical"
android:layout_marginBottom="4dp">
@ -9,7 +11,8 @@
android:id="@+id/imageView"
android:layout_width="@dimen/shopitem_image_size"
android:layout_height="@dimen/shopitem_image_size"
android:layout_marginRight="8dp"/>
android:layout_marginRight="8dp"
app:actualImageScaleType="center"/>
<TextView
android:id="@+id/titleTextView"

View file

@ -20,7 +20,7 @@
android:layout_width="@dimen/shopitem_image_size"
android:layout_height="@dimen/shopitem_image_size"
android:layout_margin="4dp"
android:scaleType="center"
fresco:actualImageScaleType="fitCenter"
android:layout_marginRight="@dimen/row_padding"
android:layout_gravity="center_horizontal"/>
<LinearLayout
@ -49,6 +49,7 @@
android:layout_alignRight="@id/container"
android:gravity="center"
android:textColor="@color/white"
android:layout_marginRight="-4dp"/>
android:layout_marginRight="-4dp"
android:textSize="12sp" />
</RelativeLayout>

View file

@ -1,6 +1,6 @@
package com.habitrpg.android.habitica;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@ -14,7 +14,6 @@ import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.multidex.MultiDexApplication;
import android.support.v7.app.AppCompatDelegate;
import android.util.Log;
@ -39,16 +38,13 @@ import org.solovyev.android.checkout.Cache;
import org.solovyev.android.checkout.Checkout;
import org.solovyev.android.checkout.PurchaseVerifier;
import java.lang.reflect.Field;
import javax.inject.Inject;
import dagger.Lazy;
import io.realm.Realm;
import io.realm.RealmConfiguration;
//contains all HabiticaApplicationLogic except dagger componentInitialisation
public abstract class HabiticaBaseApplication extends MultiDexApplication {
public abstract class HabiticaBaseApplication extends Application {
private static AppComponent component;
public RefWatcher refWatcher;

View file

@ -85,7 +85,13 @@ public class InventoryRepositoryImpl extends ContentRepositoryImpl<InventoryLoca
shopItem.notes = item.notes;
shopItem.value = (int)item.value;
shopItem.currency = "gold";
shopItem.purchaseType = item.type;
if ("potion".equals(item.key)) {
shopItem.purchaseType = "potion";
} else if ("armoire".equals(item.key)) {
shopItem.purchaseType = "armoire";
} else {
shopItem.purchaseType = "gear";
}
buyableItems.add(shopItem);
}

View file

@ -46,7 +46,7 @@ public class CurrencyView extends android.support.v7.widget.AppCompatTextView {
if ("gold".equals(currency)) {
setIcon(HabiticaIconsHelper.imageOfGold());
if (lightbackground) {
setTextColor(ContextCompat.getColor(getContext(), R.color.yellow_50));
setTextColor(ContextCompat.getColor(getContext(), R.color.yellow_10));
} else {
setTextColor(ContextCompat.getColor(getContext(), R.color.yellow_100));
}

View file

@ -10,12 +10,13 @@ import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.DashPathEffect;
import java.util.Stack;
/**
* Created by Phillip Thelen on 05.09.17.
* Created by Phillip Thelen on 20.09.17.
* Copyright © 2017 HabitRPG Inc.. All rights reserved.
*
* Generated by PaintCode
@ -76,13 +77,13 @@ public class HabiticaIcons {
Paint paint = CacheForHeart.paint;
// Local Colors
int heartDarkBackground = Color.argb(178, 255, 255, 255);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor6 = Color.argb(128, 181, 36, 40);
int fillColor3 = Color.argb(128, 255, 255, 255);
int heartLightBackground = Color.argb(255, 247, 78, 82);
int fillColor5 = Color.argb(64, 255, 255, 255);
int heartDarkBackground = Color.argb(178, 255, 255, 255);
int fillColor2 = Color.argb(255, 255, 97, 101);
int fillColor4 = Color.argb(89, 181, 36, 40);
int heartLightBackground = Color.argb(255, 247, 78, 82);
int fillColor6 = Color.argb(128, 181, 36, 40);
// Local Variables
int expression = darkBackground ? heartDarkBackground : heartLightBackground;
@ -356,11 +357,11 @@ public class HabiticaIcons {
Paint paint = CacheForExperience.paint;
// Local Colors
int fillColor11 = Color.argb(64, 191, 125, 26);
int fillColor12 = Color.argb(128, 191, 125, 26);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor11 = Color.argb(64, 191, 125, 26);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor10 = Color.argb(255, 255, 166, 35);
int fillColor12 = Color.argb(128, 191, 125, 26);
// Resize to Target Frame
canvas.save();
@ -587,11 +588,11 @@ public class HabiticaIcons {
Paint paint = CacheForMagic.paint;
// Local Colors
int fillColor9 = Color.argb(64, 31, 112, 154);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor9 = Color.argb(64, 31, 112, 154);
int fillColor8 = Color.argb(255, 80, 181, 233);
int fillColor7 = Color.argb(255, 41, 149, 205);
int fillColor5 = Color.argb(64, 255, 255, 255);
// Resize to Target Frame
canvas.save();
@ -739,10 +740,10 @@ public class HabiticaIcons {
// Local Colors
int fillColor13 = Color.argb(191, 191, 125, 26);
int fillColor12 = Color.argb(128, 191, 125, 26);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor10 = Color.argb(255, 255, 166, 35);
int fillColor12 = Color.argb(128, 191, 125, 26);
// Resize to Target Frame
canvas.save();
@ -892,10 +893,10 @@ public class HabiticaIcons {
Paint paint = CacheForGem.paint;
// Local Colors
int fillColor15 = Color.argb(89, 27, 153, 107);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor14 = Color.argb(255, 36, 204, 143);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor15 = Color.argb(89, 27, 153, 107);
int fillColor14 = Color.argb(255, 36, 204, 143);
// Resize to Target Frame
canvas.save();
@ -1102,9 +1103,9 @@ public class HabiticaIcons {
// Local Colors
int fillColor19 = Color.argb(255, 79, 42, 147);
int fillColor18 = Color.argb(255, 154, 98, 255);
int fillColor17 = Color.argb(230, 255, 255, 255);
int fillColor16 = Color.argb(204, 169, 220, 246);
int fillColor18 = Color.argb(255, 154, 98, 255);
// Resize to Target Frame
canvas.save();
@ -1519,14 +1520,14 @@ public class HabiticaIcons {
Paint paint = CacheForWarrior.paint;
// Local Colors
int fillColor21 = Color.argb(255, 255, 182, 184);
int fillColor23 = Color.argb(255, 229, 65, 77);
int fillColor22 = Color.argb(255, 242, 123, 134);
int fillColor41 = Color.argb(255, 255, 149, 152);
int fillColor43 = Color.argb(255, 200, 43, 43);
int fillColor42 = Color.argb(255, 255, 149, 152);
int fillColor = Color.argb(255, 240, 97, 102);
int fillColor43 = Color.argb(255, 200, 43, 43);
int fillColor41 = Color.argb(255, 255, 149, 152);
int fillColor21 = Color.argb(255, 255, 182, 184);
int fillColor20 = Color.argb(255, 255, 181, 183);
int fillColor42 = Color.argb(255, 255, 149, 152);
int fillColor22 = Color.argb(255, 242, 123, 134);
// Local Variables
boolean lightBackground = !darkBackground;
@ -2693,9 +2694,9 @@ public class HabiticaIcons {
public static void drawDifficultyStars(Canvas canvas, RectF targetFrame, ResizingBehavior resizing, float difficulty) {
// Local Variables
float _4StarDifficulty = difficulty >= 4f ? 1f : (difficulty >= 3.5f ? 0.5f : 0f);
float _2StarDifficulty = difficulty >= 2f ? 1f : (difficulty >= 1.5f ? 0.5f : 0f);
float _1StarDifficulty = difficulty >= 1f ? 1f : (difficulty >= 0.5f ? 0.5f : 0f);
float _4StarDifficulty = difficulty >= 4f ? 1f : (difficulty >= 3.5f ? 0.5f : 0f);
float _3StarDifficulty = difficulty >= 3f ? 1f : (difficulty >= 2.5f ? 0.5f : 0f);
// Resize to Target Frame
@ -3027,10 +3028,10 @@ public class HabiticaIcons {
// Local Colors
int fillColor28 = Color.argb(64, 229, 220, 255);
int fillColor31 = Color.argb(191, 229, 220, 255);
int fillColor30 = Color.argb(166, 229, 220, 255);
int fillColor29 = Color.argb(128, 229, 220, 255);
int fillColor27 = Color.argb(255, 229, 220, 255);
int fillColor31 = Color.argb(191, 229, 220, 255);
// Resize to Target Frame
canvas.save();
@ -3430,10 +3431,10 @@ public class HabiticaIcons {
Paint paint = CacheForStarMedium.paint;
// Local Colors
int fillColor34 = Color.argb(38, 229, 220, 255);
int fillColor27 = Color.argb(255, 229, 220, 255);
int fillColor33 = Color.argb(77, 229, 220, 255);
int fillColor32 = Color.argb(153, 229, 220, 255);
int fillColor34 = Color.argb(38, 229, 220, 255);
// Resize to Target Frame
canvas.save();
@ -3760,8 +3761,8 @@ public class HabiticaIcons {
Paint paint = CacheForAddRemovePin.paint;
// Local Colors
int fillColor36 = Color.argb(255, 97, 51, 180);
int fillColor2 = Color.argb(255, 255, 97, 101);
int fillColor36 = Color.argb(255, 97, 51, 180);
// Local Variables
int pinColor = addPin ? fillColor36 : fillColor2;
@ -3941,8 +3942,6 @@ public class HabiticaIcons {
private static PaintCodeShadow shadow = new PaintCodeShadow();
private static RectF originalFrame = new RectF(0f, 0f, 28f, 28f);
private static RectF resizedFrame = new RectF();
private static RectF ovalRect = new RectF();
private static Path ovalPath = new Path();
private static RectF oval2Rect = new RectF();
private static Path oval2Path = new Path();
private static RectF bezierRect = new RectF();
@ -3962,17 +3961,16 @@ public class HabiticaIcons {
Paint paint = CacheForItemIndicator.paint;
// Local Colors
int strokeColor = Color.argb(255, 97, 51, 180);
int indicatorLocked = Color.argb(255, 237, 236, 238);
int fillColor39 = Color.argb(255, 189, 168, 255);
int fillColor38 = Color.argb(255, 255, 148, 76);
int fillColor37 = Color.argb(255, 255, 255, 255);
int strokeColor2 = Color.argb(255, 189, 168, 255);
int fillColor40 = Color.argb(255, 165, 161, 172);
int strokeColor = Color.argb(255, 97, 51, 180);
int fillColor38 = Color.argb(255, 165, 161, 172);
int strokeColor2 = Color.argb(255, 189, 168, 255);
int shadowTint = Color.argb(255, 26, 24, 29);
// Local Shadows
PaintCodeShadow shadow = CacheForItemIndicator.shadow.get(PaintCodeColor.colorByChangingAlpha(shadowTint, (int) (Color.alpha(shadowTint) * 0.12f * 255f)), 84f, 1f, 1f);
PaintCodeShadow shadow = CacheForItemIndicator.shadow.get(PaintCodeColor.colorByChangingAlpha(shadowTint, (int) (Color.alpha(shadowTint) * 0.12f * 255f)), 0f, 1f, 1f);
// Local Variables
int itemIndicatorColor = isLocked ? indicatorLocked : (isLimited ? strokeColor : fillColor38);
@ -3984,12 +3982,12 @@ public class HabiticaIcons {
canvas.translate(resizedFrame.left, resizedFrame.top);
canvas.scale(resizedFrame.width() / 28f, resizedFrame.height() / 28f);
// Oval
RectF ovalRect = CacheForItemIndicator.ovalRect;
ovalRect.set(-82f, 2f, -58f, 26f);
Path ovalPath = CacheForItemIndicator.ovalPath;
ovalPath.reset();
ovalPath.addOval(ovalRect, Path.Direction.CW);
// Oval 2
RectF oval2Rect = CacheForItemIndicator.oval2Rect;
oval2Rect.set(2f, 2f, 26f, 26f);
Path oval2Path = CacheForItemIndicator.oval2Path;
oval2Path.reset();
oval2Path.addOval(oval2Rect, Path.Direction.CW);
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
@ -4000,7 +3998,7 @@ public class HabiticaIcons {
Paint shadowPaint = CacheForItemIndicator.shadowPaint;
shadowPaint.set(paint);
shadow.setBlurOfPaint(shadowPaint);
canvas.drawPath(ovalPath, shadowPaint);
canvas.drawPath(oval2Path, shadowPaint);
shadowPaint.setXfermode(GlobalCache.blendModeSourceIn);
canvas.saveLayer(null, shadowPaint, Canvas.ALL_SAVE_FLAG);
{
@ -4010,19 +4008,6 @@ public class HabiticaIcons {
}
canvas.restore();
paint.setStyle(Paint.Style.FILL);
paint.setColor(fillColor37);
canvas.drawPath(ovalPath, paint);
// Oval 2
RectF oval2Rect = CacheForItemIndicator.oval2Rect;
oval2Rect.set(2f, 2f, 26f, 26f);
Path oval2Path = CacheForItemIndicator.oval2Path;
oval2Path.reset();
oval2Path.addOval(oval2Rect, Path.Direction.CW);
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
paint.setStyle(Paint.Style.FILL);
paint.setColor(itemIndicatorColor);
canvas.drawPath(oval2Path, paint);
@ -4401,13 +4386,13 @@ public class HabiticaIcons {
Paint paint = CacheForRogue.paint;
// Local Colors
int fillColor19 = Color.argb(255, 79, 42, 147);
int fillColor45 = Color.argb(255, 155, 129, 226);
int fillColor48 = Color.argb(255, 137, 102, 199);
int fillColor47 = Color.argb(255, 198, 182, 228);
int fillColor46 = Color.argb(255, 122, 84, 192);
int fillColor48 = Color.argb(255, 137, 102, 199);
int fillColor36 = Color.argb(255, 97, 51, 180);
int fillColor45 = Color.argb(255, 155, 129, 226);
int fillColor47 = Color.argb(255, 198, 182, 228);
int fillColor44 = Color.argb(255, 204, 190, 237);
int fillColor19 = Color.argb(255, 79, 42, 147);
// Local Variables
boolean lightBackground = !darkBackground;
@ -5198,18 +5183,18 @@ public class HabiticaIcons {
Paint paint = CacheForHealer.paint;
// Local Colors
int fillColor55 = Color.argb(255, 253, 198, 126);
int fillColor57 = Color.argb(255, 255, 221, 181);
int fillColor52 = Color.argb(255, 253, 198, 126);
int fillColor51 = Color.argb(255, 229, 144, 37);
int fillColor59 = Color.argb(255, 255, 228, 201);
int fillColor49 = Color.argb(255, 255, 215, 168);
int fillColor10 = Color.argb(255, 255, 166, 35);
int fillColor52 = Color.argb(255, 253, 198, 126);
int fillColor59 = Color.argb(255, 255, 228, 201);
int fillColor51 = Color.argb(255, 229, 144, 37);
int fillColor58 = Color.argb(255, 229, 144, 37);
int fillColor56 = Color.argb(255, 255, 166, 35);
int fillColor53 = Color.argb(255, 206, 129, 41);
int fillColor54 = Color.argb(255, 207, 130, 41);
int fillColor50 = Color.argb(255, 226, 158, 69);
int fillColor57 = Color.argb(255, 255, 221, 181);
int fillColor49 = Color.argb(255, 255, 215, 168);
int fillColor56 = Color.argb(255, 255, 166, 35);
int fillColor55 = Color.argb(255, 253, 198, 126);
int fillColor54 = Color.argb(255, 207, 130, 41);
int fillColor53 = Color.argb(255, 206, 129, 41);
// Local Variables
boolean lightBackground = !darkBackground;
@ -6035,17 +6020,17 @@ public class HabiticaIcons {
Paint paint = CacheForMage.paint;
// Local Colors
int fillColor65 = Color.argb(255, 107, 196, 233);
int fillColor68 = Color.argb(255, 31, 110, 162);
int fillColor60 = Color.argb(255, 182, 225, 247);
int fillColor67 = Color.argb(255, 83, 180, 229);
int fillColor66 = Color.argb(255, 107, 196, 233);
int fillColor70 = Color.argb(255, 132, 207, 242);
int fillColor61 = Color.argb(255, 39, 138, 191);
int fillColor69 = Color.argb(255, 169, 219, 245);
int fillColor62 = Color.argb(255, 83, 180, 229);
int fillColor60 = Color.argb(255, 182, 225, 247);
int fillColor65 = Color.argb(255, 107, 196, 233);
int fillColor64 = Color.argb(255, 77, 178, 214);
int fillColor63 = Color.argb(255, 42, 160, 207);
int fillColor68 = Color.argb(255, 31, 110, 162);
int fillColor70 = Color.argb(255, 132, 207, 242);
int fillColor62 = Color.argb(255, 83, 180, 229);
int fillColor69 = Color.argb(255, 169, 219, 245);
int fillColor61 = Color.argb(255, 39, 138, 191);
// Local Variables
boolean lightBackground = !darkBackground;
@ -6522,6 +6507,56 @@ public class HabiticaIcons {
canvas.restore();
}
private static class CacheForCheckmark {
private static Paint paint = new Paint();
private static RectF originalFrame = new RectF(0f, 0f, 16f, 12f);
private static RectF resizedFrame = new RectF();
private static RectF bezierRect = new RectF();
private static Path bezierPath = new Path();
private static PaintCodeDashPathEffect bezierPathDashEffect = new PaintCodeDashPathEffect();
}
public static void drawCheckmark(Canvas canvas, int checkmarkColor, float percentage) {
HabiticaIcons.drawCheckmark(canvas, new RectF(0f, 0f, 16f, 12f), ResizingBehavior.AspectFit, checkmarkColor, percentage);
}
public static void drawCheckmark(Canvas canvas, RectF targetFrame, ResizingBehavior resizing, int checkmarkColor, float percentage) {
// General Declarations
Paint paint = CacheForCheckmark.paint;
// Local Variables
float checkmarkVisibility = percentage * 20f;
// Resize to Target Frame
canvas.save();
RectF resizedFrame = CacheForCheckmark.resizedFrame;
HabiticaIcons.resizingBehaviorApply(resizing, CacheForCheckmark.originalFrame, targetFrame, resizedFrame);
canvas.translate(resizedFrame.left, resizedFrame.top);
canvas.scale(resizedFrame.width() / 16f, resizedFrame.height() / 12f);
// Bezier
RectF bezierRect = CacheForCheckmark.bezierRect;
bezierRect.set(1f, 1f, 15f, 10f);
Path bezierPath = CacheForCheckmark.bezierPath;
bezierPath.reset();
bezierPath.moveTo(1f, 5f);
bezierPath.lineTo(6f, 10f);
bezierPath.lineTo(15f, 1f);
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
paint.setStrokeWidth(2f);
paint.setStrokeMiter(10f);
paint.setPathEffect(CacheForCheckmark.bezierPathDashEffect.get(checkmarkVisibility, 20f, 0f));
canvas.save();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(checkmarkColor);
canvas.drawPath(bezierPath, paint);
canvas.restore();
canvas.restore();
}
// Canvas Images
// Tab
@ -6634,14 +6669,6 @@ public class HabiticaIcons {
return imageOfHeartLightBg;
}
public static Bitmap imageOfWarrior(boolean darkBackground) {
Bitmap imageOfWarrior = Bitmap.createBitmap(32, 32, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(imageOfWarrior);
HabiticaIcons.drawWarrior(canvas, darkBackground);
return imageOfWarrior;
}
private static Bitmap imageOfHeartLarge = null;
public static Bitmap imageOfHeartLarge() {
if (imageOfHeartLarge != null)
@ -6878,6 +6905,14 @@ public class HabiticaIcons {
return imageOfMageLightBg;
}
public static Bitmap imageOfCheckmark(int checkmarkColor, float percentage) {
Bitmap imageOfCheckmark = Bitmap.createBitmap(16, 12, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(imageOfCheckmark);
HabiticaIcons.drawCheckmark(canvas, checkmarkColor, percentage);
return imageOfCheckmark;
}
// Resizing Behavior
public static void resizingBehaviorApply(ResizingBehavior behavior, RectF rect, RectF target, RectF result) {
@ -7014,3 +7049,19 @@ class PaintCodeShadow {
paint.setMaskFilter(this.blurMaskFilter);
}
}
class PaintCodeDashPathEffect {
private DashPathEffect effect;
private float dash, gap, phase;
DashPathEffect get(float dash, float gap, float phase) {
if (this.dash != dash || this.gap != gap || this.phase != phase) {
this.dash = dash;
this.gap = gap;
this.phase = phase;
this.effect = new DashPathEffect(new float[]{dash, gap}, phase);
}
return this.effect;
}
}

View file

@ -11,13 +11,18 @@ import android.view.ViewGroup;
import android.widget.RatingBar;
import android.widget.TextView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.drawee.view.SimpleDraweeView;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;
import com.habitrpg.android.habitica.R;
import com.habitrpg.android.habitica.models.inventory.QuestCollect;
import com.habitrpg.android.habitica.models.inventory.QuestContent;
import com.habitrpg.android.habitica.models.inventory.QuestDropItem;
import com.habitrpg.android.habitica.models.shops.ShopItem;
import com.habitrpg.android.habitica.ui.helpers.DataBindingUtils;
import com.habitrpg.android.habitica.ui.views.HabiticaIconsHelper;
import java.util.ArrayList;
import java.util.List;
@ -119,16 +124,18 @@ public class PurchaseDialogQuestContent extends PurchaseDialogContent {
if (questContent.getDrop().exp > 0) {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.row_quest_reward, rewardsList, false);
SimpleDraweeView imageView = (SimpleDraweeView) view.findViewById(R.id.imageView);
TextView titleTextView = (TextView) view.findViewById(R.id.titleTextView);
SimpleDraweeView imageView = view.findViewById(R.id.imageView);
imageView.setImageBitmap(HabiticaIconsHelper.imageOfGoldReward());
TextView titleTextView = view.findViewById(R.id.titleTextView);
titleTextView.setText(getContext().getString(R.string.experience_reward, questContent.getDrop().exp));
rewardsList.addView(view);
}
if (questContent.getDrop().gp > 0) {
ViewGroup view = (ViewGroup) inflater.inflate(R.layout.row_quest_reward, rewardsList, false);
SimpleDraweeView imageView = (SimpleDraweeView) view.findViewById(R.id.imageView);
TextView titleTextView = (TextView) view.findViewById(R.id.titleTextView);
SimpleDraweeView imageView = view.findViewById(R.id.imageView);
imageView.setImageBitmap(HabiticaIconsHelper.imageOfExperienceReward());
TextView titleTextView = view.findViewById(R.id.titleTextView);
titleTextView.setText(getContext().getString(R.string.gold_reward, questContent.getDrop().gp));
rewardsList.addView(view);
}

View file

@ -11,7 +11,7 @@ buildscript {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'me.tatarka:gradle-retrolambda:3.3.1'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
classpath "io.realm:realm-gradle-plugin:3.7.0"
classpath "io.realm:realm-gradle-plugin:3.7.2"
}
// Exclude the version that the android plugin depends on.

View file

@ -10,6 +10,23 @@ buildscript {
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url 'https://maven.fabric.io/public' }
// Material View Pager
maven { url "http://dl.bintray.com/florent37/maven" }
// Markdown
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
}
android {
compileSdkVersion 25
@ -47,9 +64,8 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.glassfish:javax.json:1.0.4'
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.google.android.gms:play-services:11.4.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:multidex:1.0.1'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'org.solovyev.android:checkout:0.9.1@aar'
androidTestCompile 'org.mockito:mockito-core:1.9.5'