Skip to content

Commit

Permalink
Merge branch 'release/v1.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
edipo2s committed Jul 30, 2017
2 parents bb39938 + 36354c7 commit d9710b7
Show file tree
Hide file tree
Showing 17 changed files with 180 additions and 135 deletions.
5 changes: 1 addition & 4 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
buildToolsVersion "26.0.1"
packagingOptions.excludes = ['META-INF/services/javax.annotation.processing.Processor',
'META-INF/LICENSE.txt', 'META-INF/NOTICE.txt', 'META-INF/README.txt',
'LICENSE.txt', 'NOTICE.txt', 'README.txt', '.readme']
'META-INF/MANIFEST.MF','LICENSE.txt', 'NOTICE.txt', 'README.txt', '.readme']

def props = new Properties()
props.load(file("secrets.properties").newInputStream())
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ data class Card(
val tokens: List<String>,
val lore: String,
val loreLink: String,
val hasAlternativeArt: Boolean
val hasAlternativeArt: Boolean,
val alternativeArtSource: String

) : Comparable<Card>, Parcelable {

Expand All @@ -427,7 +428,7 @@ data class Card(
val DUMMY = Card("", "", CardSet.CORE, CardAttribute.DUAL, CardAttribute.STRENGTH,
CardAttribute.WILLPOWER, CardRarity.EPIC, false, 0, 0, 0, CardType.ACTION,
CardRace.ARGONIAN, emptyList<CardKeyword>(), "", CardArenaTier.AVERAGE,
listOf(), false, "", 0, listOf(), listOf(), listOf(), "", "", false)
listOf(), false, "", 0, listOf(), listOf(), listOf(), "", "", false, "")

const val ALT_SUFFIX = "_alt"
const val ARTS_PATH = "Arts"
Expand All @@ -452,7 +453,7 @@ data class Card(
mutableListOf<String>().apply { source.readStringList(this) },
mutableListOf<String>().apply { source.readStringList(this) },
mutableListOf<String>().apply { source.readStringList(this) }, source.readString(),
source.readString(), 1 == source.readInt())
source.readString(), 1 == source.readInt(), source.readString())

override fun describeContents() = 0

Expand Down Expand Up @@ -576,6 +577,7 @@ data class Card(
dest?.writeString(lore)
dest?.writeString(loreLink)
dest?.writeInt((if (hasAlternativeArt) 1 else 0))
dest?.writeString(alternativeArtSource)
}

override fun compareTo(other: Card): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ abstract class FirebaseParsers {
val lore: String = ""
val loreLink: String = ""
val alternativeArt: Boolean = false
val alternativeArtSource: String = ""

fun toCard(shortName: String, set: CardSet, attr: CardAttribute): Card {
var clsAttr1 = attr
Expand All @@ -57,7 +58,7 @@ abstract class FirebaseParsers {
},
text, CardArenaTier.of(arenaTier), getCardArenaTierPlus(), evolves, season, shout,
creators.split(", ").filter { it.isNotEmpty() }, generates.split(", ").filter { it.isNotEmpty() },
tokens.split(", ").filter { it.isNotEmpty() }, lore, loreLink, alternativeArt)
tokens.split(", ").filter { it.isNotEmpty() }, lore, loreLink, alternativeArt, alternativeArtSource)
}

private fun getCardArenaTierPlus(): List<CardArenaTierPlus?> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ class CardActivity : BaseActivity() {
card_reward.text = "$month/${yearMonth.year}"
card_reward_label.visibility = View.VISIBLE
}
if (card.isAlternativeArt()) {
card_reward.text = card.alternativeArtSource
card_reward_label.text = getString(R.string.card_alternative_label)
card_reward_label.visibility = View.VISIBLE
}
card_race.text = card.race.name.toLowerCase().capitalize().replace("_", " ")
card_race_label.visibility = View.VISIBLE.takeIf { card.type == CardType.CREATURE } ?: View.GONE
card_race.visibility = View.VISIBLE.takeIf { card.type == CardType.CREATURE } ?: View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import android.support.annotation.LayoutRes
import android.support.design.widget.BottomSheetBehavior
import android.support.v4.app.Fragment
import android.support.v4.content.ContextCompat
import android.view.*
import android.util.DisplayMetrics
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.ImageView
import android.widget.ListPopupWindow
import android.widget.Spinner
Expand Down Expand Up @@ -311,9 +315,21 @@ fun Context.getCurrentVersion(): String {
}

fun Context.hasNavigationBar(): Boolean {
val hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
val hasHomeKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_HOME);
return (!(hasBackKey && hasHomeKey))
val windowManager = getSystemService(Context.WINDOW_SERVICE) as WindowManager
val display = windowManager.getDefaultDisplay();

val realDisplayMetrics = DisplayMetrics();
display.getRealMetrics(realDisplayMetrics);
val realHeight = realDisplayMetrics.heightPixels;
val realWidth = realDisplayMetrics.widthPixels;

val displayMetrics = DisplayMetrics();
display.getMetrics(displayMetrics);
val displayHeight = displayMetrics.heightPixels;
val displayWidth = displayMetrics.widthPixels;

val hasSoftwareKeys = (realWidth > displayWidth) || (realHeight > displayHeight);
return hasSoftwareKeys;
}

fun Activity.hasPermission(permission: String): Boolean {
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/raw/changelog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<changelog bulletedList="true">
<changelogversion
versionName="1.6.3"
changeDate="July 30, 2017">
<changelogtext>[b]Feature:[/b] Added Source of Alternative Art cards in card details
</changelogtext>
<changelogtext>Update Russian translation</changelogtext>
<changelogtext>Add Ash Servant alternative art card</changelogtext>
<changelogtext>Fix expansible card info showing behind navigation bar in some devices
</changelogtext>
</changelogversion>
<changelogversion
versionName="1.6.2"
changeDate="July 29, 2017">
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<string name="cards_sets_all">Alle</string>

<string name="card_title_star_rating">Deine Bewertung</string>
<string name="card_alternative_label">Ursprung</string>
<string name="card_more_info_label">Mehr Informationen</string>
<string name="card_arena_tier_label">Arena Rang:</string>
<string name="card_collection_qtd_label">Sammlung Qtd:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<string name="cards_sets_all">Todas</string>

<string name="card_title_star_rating">Tu Clasificación</string>
<string name="card_alternative_label">Fuente</string>
<string name="card_more_info_label">Más información</string>
<string name="card_arena_tier_label">Nivel de arena:</string>
<string name="card_collection_qtd_label">Colección Qtd:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="cards_sets_all">Tutto</string>

<string name="card_title_star_rating">Il tuo punteggio</string>
<string name="card_alternative_label">Fonte</string>
<string name="card_more_info_label">Maggiori Informazioni</string>
<string name="card_arena_tier_label">Livello in Arena:</string>
<string name="card_collection_qtd_label">In collezione:</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="cards_sets_all">Todos</string>

<string name="card_title_star_rating">Sua Avaliação</string>
<string name="card_alternative_label">Fonte</string>
<string name="card_more_info_label">Mais Informações</string>
<string name="card_arena_tier_label">Arena Nível:</string>
<string name="card_collection_qtd_label">Coleção Qtd:</string>
Expand Down
Loading

0 comments on commit d9710b7

Please sign in to comment.