Skip to content

Commit

Permalink
Merge branch 'release/v0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
edipo2s committed Feb 16, 2017
2 parents 4be8722 + db6a0f1 commit 3301539
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

15 changes: 11 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ android {
println(e.message)
}
}
release {
storeFile file('debug.keystore')
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
}
}
buildTypes {
debug {
Expand All @@ -46,27 +52,28 @@ android {
}
release {
debuggable false
signingConfig signingConfigs.release
signingConfig signingConfigs.debug
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

}

ext {
anko_version = "0.9"
anko_version = "0.9.1a"
icePickVersion = "3.2.+"
okIOVersion = "1.11.+"
okHttpVersion = "3.6.+"
playServicesVersion = prepareToRelease ? "10.0.1" : "9.8.0"
supportLibraryVersion = "25.1.1"
threetenabpVersion = "1.0.+"

testMockitoVersion = "2.1.+"
testRoboletricVersion = "3.1.+"
testMockitoVersion = "2.7.+"
testRoboletricVersion = "3.2.+"
}

configurations.all {
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
<application
android:name=".App"
android:allowBackup="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:fullBackupContent="@xml/backup_descriptor">
android:theme="@style/AppTheme">

<activity
android:name=".ui.DashActivity"
Expand Down Expand Up @@ -76,8 +77,8 @@

<receiver
android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
android:permission="android.permission.INSTALL_PACKAGES"
android:enabled="true">
android:enabled="true"
android:permission="android.permission.INSTALL_PACKAGES">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ediposouza.teslesgendstracker.ui.matches.tabs

import android.os.Bundle
import android.support.v4.app.ActivityCompat
import android.support.v4.app.ActivityOptionsCompat
import android.view.*
import com.ediposouza.teslesgendstracker.R
Expand Down Expand Up @@ -35,7 +36,7 @@ class ArenaFragment : MatchesHistoryFragment() {
super.onViewCreated(view, savedInstanceState)
arena_fab_add.setOnClickListener {
val anim = ActivityOptionsCompat.makeCustomAnimation(context, R.anim.slide_up, R.anim.slide_down)
startActivity(context.intentFor<NewArenaActivity>(), anim.toBundle())
ActivityCompat.startActivity(activity, context.intentFor<NewArenaActivity>(), anim.toBundle())
}
MetricsManager.trackScreen(MetricScreen.SCREEN_ARENA())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ArenaDraftCards(ctx: Context?, attrs: AttributeSet?, defStyleAttr: Int) :

private fun updateCardList(cards: List<Card>, cardsAdapter: CardsAllFragment.CardsAllAdapter) {
cardsAdapter.showCards(cards.filter { it.attr == currentAttr }
.filter { currentMagika == -1 || it.cost == currentMagika }
.filter { currentMagika == -1 || (if (currentMagika < 7) it.cost == currentMagika else it.cost >= currentMagika) }
.filter { currentRarity == null || it.rarity == currentRarity }
.filter { !it.evolves }
.sortedBy { it.cost })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class CardsCollectionFragment : CardsAllFragment() {

var isEditStarted: Boolean = false

val view_statistics by lazy { activity.find<CollectionStatistics>(R.id.cards_collection_statistics) }
val view_statistics: CollectionStatistics
get() = activity.find<CollectionStatistics>(R.id.cards_collection_statistics)

val statisticsSheetBehavior: BottomSheetBehavior<CollectionStatistics>
get() = BottomSheetBehavior.from(view_statistics)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.ediposouza.teslesgendstracker.ui.decks.tabs

import android.os.Build
import android.os.Bundle
import android.support.v4.app.ActivityCompat
import android.support.v4.app.ActivityOptionsCompat
import android.support.v4.util.Pair
import android.support.v7.widget.LinearLayoutManager
Expand All @@ -20,6 +22,7 @@ import com.ediposouza.teslesgendstracker.ui.base.*
import com.ediposouza.teslesgendstracker.ui.cards.CmdFilterSearch
import com.ediposouza.teslesgendstracker.ui.decks.DeckActivity
import com.ediposouza.teslesgendstracker.ui.util.firebase.OnLinearLayoutItemScrolled
import com.ediposouza.teslesgendstracker.util.ConfigManager
import com.ediposouza.teslesgendstracker.util.inflate
import com.google.firebase.auth.FirebaseAuth
import jp.wasabeef.recyclerview.animators.SlideInLeftAnimator
Expand All @@ -35,6 +38,7 @@ import java.text.NumberFormat
*/
open class DecksPublicFragment : BaseFragment() {

val ASUS_CREATE_LAYER_ERROR = "Z00AD"
val ADS_EACH_ITEMS = 10 //after 10 lines
val DECK_PAGE_SIZE = 8

Expand Down Expand Up @@ -62,12 +66,18 @@ open class DecksPublicFragment : BaseFragment() {
val favorite = it?.filter { it.uuid == deck.uuid }?.isNotEmpty() ?: false
val userId = FirebaseAuth.getInstance().currentUser?.uid
val like = deck.likes.contains(userId)
startActivity(DeckActivity.newIntent(context, deck, favorite, like, deck.owner == userId),
ActivityOptionsCompat.makeSceneTransitionAnimation(activity,
Pair(view.deck_name as View, nameTransitionName),
Pair(view.deck_cover as View, coverTransitionName),
Pair(view.deck_attr1 as View, attr1TransitionName),
Pair(view.deck_attr2 as View, attr2TransitionName)).toBundle())
val deckIntent = DeckActivity.newIntent(context, deck, favorite, like, deck.owner == userId)
if (ConfigManager.isAsusZenPhoneSingleAnim() && Build.MODEL.contains(ASUS_CREATE_LAYER_ERROR)) {
ActivityCompat.startActivity(activity, deckIntent, ActivityOptionsCompat
.makeSceneTransitionAnimation(activity, view.deck_cover, coverTransitionName).toBundle())
} else {
ActivityCompat.startActivity(activity, deckIntent, ActivityOptionsCompat
.makeSceneTransitionAnimation(activity,
Pair(view.deck_name as View, nameTransitionName),
Pair(view.deck_cover as View, coverTransitionName),
Pair(view.deck_attr1 as View, attr1TransitionName),
Pair(view.deck_attr2 as View, attr2TransitionName)).toBundle())
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ class DeckList(ctx: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
}
var editMode = false

private fun showExpandedCard(card: Card, view: View) {
val transitionName = context.getString(R.string.card_transition_name)
ActivityCompat.startActivity(context, CardActivity.newIntent(context, card),
ActivityOptionsCompat.makeSceneTransitionAnimation(context as Activity, view, transitionName).toBundle())
}
val cardTransitionName by lazy { context.getString(R.string.card_transition_name) }

val deckListAdapter by lazy {
DeckListAdapter({ index -> decklist_recycle_view.scrollToPosition(index) },
itemClick = { view, card ->
if (editMode) {
remCard(card)
} else {
showExpandedCard(card, view)
ActivityCompat.startActivity(context, CardActivity.newIntent(context, card),
ActivityOptionsCompat.makeSceneTransitionAnimation(context as Activity,
view, cardTransitionName).toBundle())
}
},
itemLongClick = { view, card ->
Expand All @@ -63,7 +61,9 @@ class DeckList(ctx: Context?, attrs: AttributeSet?, defStyleAttr: Int) :
negativeButton(android.R.string.no, {})
}.show()
} else {
showExpandedCard(card, view)
ActivityCompat.startActivity(context, CardActivity.newIntent(context, card),
ActivityOptionsCompat.makeSceneTransitionAnimation(context as Activity,
view, cardTransitionName).toBundle())
}
true
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.ediposouza.teslesgendstracker.ui.matches.tabs

import android.content.Context
import android.os.Bundle
import android.support.v4.app.ActivityCompat
import android.support.v4.app.ActivityOptionsCompat
import android.support.v4.content.ContextCompat
import android.support.v4.util.Pair
Expand Down Expand Up @@ -93,7 +94,7 @@ class MatchesStatisticsFragment : BaseFragment() {
it.getTag(com.inqbarna.tablefixheaders.R.id.tag_row) == row &&
it.getTag(com.inqbarna.tablefixheaders.R.id.tag_type_view) == 2
}.first()
startActivity(MatchesStatisticsClassActivity.newIntent(context, currentMatchMode, currentSeason,
ActivityCompat.startActivity(activity, MatchesStatisticsClassActivity.newIntent(context, currentMatchMode, currentSeason,
selectedClass!!), ActivityOptionsCompat.makeSceneTransitionAnimation(activity,
Pair(classView.cell_class_attr1 as View, attr1TransitionName),
Pair(classView.cell_class_attr2 as View, attr2TransitionName)).toBundle())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ object ConfigManager {
val DB_UPDATE_CONFIG = "db_update"
val SHOW_DECK_ADS_CONFIG = "showDeckAds"
val VERSION_UNSUPPORTED_CONFIG = "version_unsupported"
val ASUS_ZENPHONE_SINGLE_ANIM_CONFIG = "asusZenPhoneSingleAnim"

val remoteConfig: FirebaseRemoteConfig by lazy { FirebaseRemoteConfig.getInstance() }

Expand All @@ -24,7 +25,8 @@ object ConfigManager {
.build())
setDefaults(mapOf(DB_UPDATE_CONFIG to false,
SHOW_DECK_ADS_CONFIG to false,
VERSION_UNSUPPORTED_CONFIG to ""))
VERSION_UNSUPPORTED_CONFIG to "",
ASUS_ZENPHONE_SINGLE_ANIM_CONFIG to false))
}
updateCaches {}
}
Expand All @@ -44,6 +46,8 @@ object ConfigManager {

fun isShowDeckAds() = remoteConfig.getBoolean(SHOW_DECK_ADS_CONFIG)

fun isAsusZenPhoneSingleAnim() = remoteConfig.getBoolean(ASUS_ZENPHONE_SINGLE_ANIM_CONFIG)

fun isVersionUnsupported(): Boolean {
val unsupportedVersions = remoteConfig.getString(VERSION_UNSUPPORTED_CONFIG)
if (unsupportedVersions.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ sealed class MetricAction(val name: String) {
val PARAM_CLASS = "Class"
}

class ACTION_NEW_MATCH_START_WITH(val deck: Deck?, val fromArena: Boolean = false) : MetricAction("NewMatch") {
class ACTION_NEW_MATCH_START_WITH(val deck: Deck?, val fromArena: Boolean = false) : MetricAction("MatchStart") {
val PARAM_DECK = "Deck"
val PARAM_DECK_VALUE_OTHER = "Other"
val PARAM_FROM_ARENA = "FromArena"
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

buildscript {
ext {
appVersionName = "0.4.0"
appVersionCode = 11
appVersionName = "0.4.1"
appVersionCode = 12

kotlin_version = "1.1.0-beta-38"
prepareToRelease = true
prepareToRelease = false
}

repositories {
Expand Down

0 comments on commit 3301539

Please sign in to comment.