Skip to content

Commit

Permalink
Merge branch 'release/v0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
edipo2s committed Jan 17, 2017
2 parents 7f8a2b5 + f28d029 commit 2fd645f
Show file tree
Hide file tree
Showing 180 changed files with 8,166 additions and 1,318 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ fabric.properties

# *.iml
# modules.xml
.idea/misc.xml
.idea/misc.xml
misc.xml
# *.ipr


Expand Down
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ android {
buildConfigField("boolean", "PREPARE_TO_RELEASE", "$prepareToRelease")
buildConfigField("String", "MIXPANEL_TOKEN", '"eb99af1dad563cbaaf02f008b28e321f"')
buildConfigField("String", "GCM_SENDER", '"597127048287"')
multiDexEnabled true
vectorDrawables.useSupportLibrary true
}
signingConfigs {
Expand Down Expand Up @@ -76,6 +77,7 @@ configurations.all {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'clansFAB', ext: 'aar')
compile(name: 'googleinapputil', ext: 'aar')
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.anko:anko-common:$anko_version"

Expand Down Expand Up @@ -117,7 +119,11 @@ dependencies {

compile "com.github.emanzanoaxa:RippleEffect:52ea2a0ab6"
// compile "com.github.traex.rippleeffect:library:1.3"
compile "com.github.miguelbcr:TableFixHeaders-Wrapper:0.2.0"
compile "com.timehop.stickyheadersrecyclerview:library:0.4.3"
compile "jp.wasabeef:recyclerview-animators:2.2.4"
compile "com.kyleduo.switchbutton:library:1.4.4"
compile "org.jsoup:jsoup:1.10.1"

testCompile "junit:junit:4.12"
testCompile "com.jakewharton.threetenabp:threetenabp:$threetenabpVersion"
Expand Down
Binary file added app/libs/googleinapputil.aar
Binary file not shown.
5 changes: 5 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,9 @@
-dontwarn com.mixpanel.**
-keep class **.R$* {
<fields>;
}

## JSoup
-keep public class org.jsoup.** {
public *;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import timber.log.Timber
/**
* Created by ediposouza on 08/12/16.
*/
@SuppressWarnings("unused")
@Suppress("UNUSED_PARAMETER")
object MetricsManager : MetricsConstants() {

fun initialize(context: Context) {
Expand Down
15 changes: 12 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.ediposouza.teslesgendstracker.permission.C2D_MESSAGE" />

Expand All @@ -32,16 +33,24 @@
</intent-filter>
</activity>
<activity
android:name=".ui.CardActivity"
android:name=".ui.cards.CardActivity"
android:screenOrientation="portrait"
android:theme="@style/AppThemeTransparent" />
<activity
android:name=".ui.DeckActivity"
android:name=".ui.decks.DeckActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.decks.new.NewDeckActivity"
android:name=".ui.decks.NewDeckActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.matches.MatchesStatisticsClassActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.matches.NewMatchesActivity"
android:screenOrientation="portrait"
android:theme="@style/AppThemeAccentEqualsPrimaryDark"
android:windowSoftInputMode="adjustPan" />

<receiver
android:name="com.mixpanel.android.mpmetrics.GCMReceiver"
Expand Down
Binary file modified app/src/main/assets/Cards/Core/Agility/dunesmuggler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/Cards/Core/Agility/dunestalker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/Cards/Core/Agility/snaketoothnecklace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/Cards/Core/Agility/soulrestmarshal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/Cards/Core/Endurance/histgrove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/Cards/Core/Neutral/slaughterfish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/assets/Cards/Core/Willpower/pillagingtribune.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions app/src/main/kotlin/com/ediposouza/teslesgendstracker/App.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.ediposouza.teslesgendstracker

import android.app.Application
import android.content.Context
import android.preference.PreferenceManager
import android.support.multidex.MultiDexApplication
import android.support.v7.app.AppCompatDelegate
import com.ediposouza.teslesgendstracker.interactor.BaseInteractor
import com.ediposouza.teslesgendstracker.util.ConfigManager
Expand All @@ -15,15 +16,17 @@ import timber.log.Timber
/**
* Created by EdipoSouza on 10/30/16.
*/
class App : Application() {
class App : MultiDexApplication() {

companion object {

private var ctx: Context? = null

var hasUserAlreadyLogged: Boolean = false

fun hasUserLogged(): Boolean = FirebaseAuth.getInstance().currentUser != null
fun hasUserLogged() = FirebaseAuth.getInstance().currentUser != null

fun hasUserDonate() = PreferenceManager.getDefaultSharedPreferences(ctx).getBoolean(PREF_USER_DONATE, false)

fun getVersion() = ctx?.packageManager?.getPackageInfo(ctx?.packageName, 0)?.versionName ?: ""

Expand All @@ -46,6 +49,7 @@ class App : Application() {
val sync = !ConfigManager.isDBUpdating() && !ConfigManager.isVersionUnsupported()
reference.child(BaseInteractor.NODE_CARDS).keepSynced(sync)
reference.child(BaseInteractor.NODE_PATCHES).keepSynced(sync)
reference.child(BaseInteractor.NODE_SEASONS).keepSynced(sync)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ package com.ediposouza.teslesgendstracker
*/
val TIME_PATTERN = "HH:mm"

val DEFAULT_DELIMITER = ";"
val SEASON_UUID_PATTERN = "yyyy_MM"

val DEFAULT_DELIMITER = ";"

val PREF_USER_DONATE = "ud"

val PPKA = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlL9jJqmVwaD9jJ68bVbu4B61CY1FLSZLMuNU/"
val PPKB = "ncIi3PwpZjFlhKemDBq5szv2ZQVc6hiJwImQHSopf5RdlbgAkV0wLWg1ExIN5UkM9I1vxN5wz1RRvYY/PLzJYsbNR/"
val PPKC = "r96FZiJvSICi3jErbQsg1C/Y68TsZ67TSHuZ6XN2m2HOR0iKoF93kcl7TGKJgoYn8FGmND1j+bgdvkWwu/RQ/EY89XGEP7R3qib78QG5p3gj9rcKYSm8CG76QKDUL/"
val PPKD = "NqD1B1imUJOdBdQ50gRlReqw4c5DTJKWLCzMpzNHb0vDlAwTdgGNsm3i+b5WbnrMHJBpBptQsX8vsKdOghr7DK9zwIDAQAB"
20 changes: 14 additions & 6 deletions app/src/main/kotlin/com/ediposouza/teslesgendstracker/data/Deck.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ data class DeckUpdate(

data class DeckComment(

val id: String,
val uuid: String,
val owner: String,
val comment: String,
val date: LocalDateTime
Expand All @@ -61,16 +61,19 @@ data class DeckComment(
override fun describeContents() = 0

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(id)
dest?.writeString(uuid)
dest?.writeString(owner)
dest?.writeString(comment)
dest?.writeSerializable(date)
}

override fun toString(): String = "DeckComment(id='$uuid', owner='$owner', comment='$comment', date=$date)"

}

data class Deck(

val id: String,
val uuid: String,
val name: String,
val owner: String,
val private: Boolean,
Expand All @@ -88,8 +91,8 @@ data class Deck(

) : Parcelable {

constructor() : this("", "", "", false, DeckType.OTHER, Class.NEUTRAL, 0, LocalDateTime.now(),
LocalDateTime.now(), "", listOf(), 0, mapOf(), listOf(), listOf())
constructor() : this("", "", "", false, DeckType.OTHER, Class.NEUTRAL, 0, LocalDateTime.now().withNano(0),
LocalDateTime.now().withNano(0), "", listOf(), 0, mapOf(), listOf(), listOf())

companion object {
@JvmField val CREATOR: Parcelable.Creator<Deck> = object : Parcelable.Creator<Deck> {
Expand All @@ -109,7 +112,7 @@ data class Deck(
override fun describeContents() = 0

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(id)
dest?.writeString(uuid)
dest?.writeString(name)
dest?.writeString(owner)
dest?.writeInt((if (private) 1 else 0))
Expand All @@ -125,4 +128,9 @@ data class Deck(
dest?.writeList(updates)
dest?.writeList(comments)
}

override fun toString(): String {
return "Deck(id='$uuid', name='$name', owner='$owner', private=$private, type=$type, cls=$cls, cost=$cost, createdAt=$createdAt, updatedAt=$updatedAt, patch='$patch', likes=$likes, views=$views, cards=$cards, updates=$updates, comments=$comments)"
}

}
110 changes: 108 additions & 2 deletions app/src/main/kotlin/com/ediposouza/teslesgendstracker/data/General.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ import android.os.Parcelable
/**
* Created by EdipoSouza on 10/31/16.
*/
data class UserInfo(

val name: String,
val photoUrl: String

)

data class CardCollection(

val cardShortName: String,
val cardAttr: Attribute,
val cardSet: CardSet,
val qtd: Int

)

data class CardSlot(

val card: Card,
Expand Down Expand Up @@ -35,7 +51,97 @@ data class CardSlot(

data class Patch(

val uidDate: String,
val uuidDate: String,
val desc: String

)
)

data class Season(

val id: Int,
val uuid: String,
val desc: String,
val reward: String

)

enum class MatchMode {

RANKED,
CASUAL,
ARENA

}

data class MatchDeck(

val name: String,
val cls: Class,
val type: DeckType,
val deck: String? = null,
val version: String? = null

) : Parcelable {

companion object {
@JvmField val CREATOR: Parcelable.Creator<MatchDeck> = object : Parcelable.Creator<MatchDeck> {
override fun createFromParcel(source: Parcel): MatchDeck = MatchDeck(source)
override fun newArray(size: Int): Array<MatchDeck?> = arrayOfNulls(size)
}
}

constructor(source: Parcel) : this(source.readString(), Class.values()[source.readInt()],
DeckType.values()[source.readInt()], source.readString(), source.readString())

override fun describeContents() = 0

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(name)
dest?.writeInt(cls.ordinal)
dest?.writeInt(type.ordinal)
dest?.writeString(deck)
dest?.writeString(version)
}
}

data class Match(

val uuid: String,
val first: Boolean,
val player: MatchDeck,
val opponent: MatchDeck,
val mode: MatchMode,
val season: String,
val rank: Int,
val legend: Boolean,
val win: Boolean

) : Parcelable {

companion object {
@JvmField val CREATOR: Parcelable.Creator<Match> = object : Parcelable.Creator<Match> {
override fun createFromParcel(source: Parcel): Match = Match(source)
override fun newArray(size: Int): Array<Match?> = arrayOfNulls(size)
}
}

constructor(source: Parcel) : this(source.readString(), 1 == source.readInt(),
source.readParcelable<MatchDeck>(MatchDeck::class.java.classLoader),
source.readParcelable<MatchDeck>(MatchDeck::class.java.classLoader),
MatchMode.values()[source.readInt()], source.readString(), source.readInt(),
1 == source.readInt(), 1 == source.readInt())

override fun describeContents() = 0

override fun writeToParcel(dest: Parcel?, flags: Int) {
dest?.writeString(uuid)
dest?.writeInt((if (first) 1 else 0))
dest?.writeParcelable(player, 0)
dest?.writeParcelable(opponent, 0)
dest?.writeInt(mode.ordinal)
dest?.writeString(season)
dest?.writeInt(rank)
dest?.writeInt((if (legend) 1 else 0))
dest?.writeInt((if (win) 1 else 0))
}
}
40 changes: 0 additions & 40 deletions app/src/main/kotlin/com/ediposouza/teslesgendstracker/data/User.kt

This file was deleted.

Loading

0 comments on commit 2fd645f

Please sign in to comment.