Skip to content

Commit

Permalink
Merge pull request #257 from josephroqueca/v3.1.1
Browse files Browse the repository at this point in the history
V3.1.1
  • Loading branch information
autoreleasefool authored Jan 19, 2019
2 parents 783cb57 + 0382c85 commit 833a86f
Show file tree
Hide file tree
Showing 51 changed files with 202 additions and 364 deletions.
12 changes: 10 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Most recent version

## v3.1.1
```
This version contains a bunch of bug fixes! Here's just a few:
- Creating or opening an event should no longer crash the app
- Fixed sharing games through the game overview
- Prevented scores from dropping below zero when there are too many fouls
```

# Legacy versions

## v3.1.0
```
Thank you for using the app while some of the kinks in the new version are worked out!
Expand All @@ -12,8 +22,6 @@ Bug fixes
- Fix some more rotation crashes and returning to the app from the background
```

# Legacy versions

## v3.0.2

```
Expand Down
16 changes: 6 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'kotlin-android-extensions'

def versionMajor = 3
def versionMinor = 1
def versionPatch = 0
def versionPatch = 1

android {
compileSdkVersion 28
Expand All @@ -32,8 +32,7 @@ android {
["BANNER_AD_UNIT_ID", "ca-app-pub-3940256099942544/6300978111"],
["ADMOB_APP_ID", "ca-app-pub-3940256099942544~3347511713"],
["TRANSFER_API_KEY", "API_KEY_GOES_HERE"],
["MIXPANEL_TOKEN", "API_KEY_GOES_HERE"],
["BUGSNAG_TOKEN", "API_KEY_GOES_HERE"]
["MIXPANEL_TOKEN", "API_KEY_GOES_HERE"]
]

apiKeys.each { key, value ->
Expand All @@ -48,9 +47,9 @@ android {
def apiKeys = [
["TRANSFER_SERVER_URL", "API_KEY_GOES_HERE"],
["BANNER_AD_UNIT_ID", "API_KEY_GOES_HERE"],
["ADMOB_APP_ID", "ca-app-pub-3940256099942544~3347511713"],
["TRANSFER_API_KEY", "API_KEY_GOES_HERE"],
["MIXPANEL_TOKEN", "API_KEY_GOES_HERE"],
["BUGSNAG_TOKEN", "API_KEY_GOES_HERE"]
["MIXPANEL_TOKEN", "API_KEY_GOES_HERE"]
]

apiKeys.each { key, value ->
Expand All @@ -76,16 +75,13 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.22.2'
implementation 'android.arch.lifecycle:extensions:1.1.1'

implementation 'com.nex3z:flow-layout:1.2.2' // https://github.com/nex3z/FlowLayout
implementation 'com.robertlevonyan.view:MaterialChipView:1.2.4' // https://github.com/robertlevonyan/materialChipView
implementation 'com.ncapdevi:frag-nav:2.4.0' // https://github.com/ncapdevi/FragNav
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' // https://github.com/PhilJay/MPAndroidChart

implementation 'com.mixpanel.android:mixpanel-android:5.4.2' // https://github.com/mixpanel/mixpanel-android
implementation 'com.bugsnag:bugsnag-android:4.8.2' // https://github.com/bugsnag/bugsnag-android
implementation 'com.mixpanel.android:mixpanel-android:5.4.4' // https://github.com/mixpanel/mixpanel-android

implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.google.android.gms:play-services-ads:17.1.2'

testImplementation 'junit:junit:4.12'

Expand Down
16 changes: 12 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="GoogleAppIndexingWarning,UnusedAttribute">

<uses-library android:name="org.apache.http.legacy" android:required="false" />

<meta-data android:name="com.mixpanel.android.MPConfig.DisableViewCrawler" android:value="true" />

<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/ADMOB_APP_ID"/>

<meta-data
android:name="com.bugsnag.android.API_KEY"
android:value="@string/BUGSNAG_TOKEN"/>

<activity
android:name=".NavigationActivity"
android:label="@string/app_name"
Expand All @@ -44,6 +42,16 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<provider
android:name=".utils.sharing.GameOverviewBitmapFileProvider"
android:authorities="${applicationId}.utils.sharing.GameOverviewBitmapFileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_path_game_overview" />
</provider>

</application>

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/assets/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<b>v3.1.1</b>
This version contains a bunch of bug fixes! Here's just a few:
- Creating or opening an event should no longer crash the app
- Fixed sharing games through the game overview
- Prevented scores from dropping below zero when there are too many fouls

<b>v3.1.0</b>
Thank you for using the app while some of the kinks in the new version are worked out!
- See an overview of your games by tapping the list icon in the top right, or the overview menu item
Expand Down
35 changes: 0 additions & 35 deletions app/src/main/assets/licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

<b>FlowLayout</b>

FlowLayout
Copyright 2016 nex3z

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<b>FragNav</b>

FragNav Android Fragment Navigation Library
Expand All @@ -55,24 +38,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<b>Material Chip View</b>

Material Chip View
Copyright 2017 Robert Levonyan
Url: https://github.com/robertlevonyan/materialChipView

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

<b>Material design icons</b>
Material design icons
Copyright 2018 Google
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/ca/josephroque/bowlingcompanion/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.arch.lifecycle.OnLifecycleEvent
import android.content.Context
import android.support.v7.preference.PreferenceManager
import android.view.inputmethod.InputMethodManager
import com.bugsnag.android.Bugsnag
import com.google.android.gms.ads.MobileAds
import java.util.concurrent.atomic.AtomicBoolean

Expand Down Expand Up @@ -47,10 +46,6 @@ class App : Application(), LifecycleObserver {
super.onCreate()
PreferenceManager.setDefaultValues(this, R.xml.pref_app, false)
MobileAds.initialize(this, BuildConfig.ADMOB_APP_ID)

if (!BuildConfig.DEBUG) {
Bugsnag.init(this)
}
}

@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import android.support.v4.widget.DrawerLayout
import android.view.MenuItem
import android.view.View
import ca.josephroque.bowlingcompanion.bowlers.BowlerListFragment
import ca.josephroque.bowlingcompanion.common.Android
import ca.josephroque.bowlingcompanion.common.FabController
import ca.josephroque.bowlingcompanion.common.NavigationDrawerController
import ca.josephroque.bowlingcompanion.common.interfaces.IFloatingActionButtonHandler
Expand All @@ -31,7 +30,6 @@ import ca.josephroque.bowlingcompanion.utils.StartupManager
import ca.josephroque.bowlingcompanion.utils.isVisible
import com.ncapdevi.fragnav.FragNavController
import com.ncapdevi.fragnav.FragNavTransactionOptions
import kotlinx.coroutines.experimental.launch
import kotlinx.android.synthetic.main.activity_navigation.ad_view as adView
import kotlinx.android.synthetic.main.activity_navigation.bottom_navigation as bottomNavigation
import kotlinx.android.synthetic.main.activity_navigation.drawer_layout as drawerLayout
Expand Down Expand Up @@ -169,6 +167,11 @@ class NavigationActivity : BaseActivity(),
}

override fun onBackPressed() {
if (fragNavController?.isStateSaved == true) {
super.onBackPressed()
return
}

val fragNavController = fragNavController
if (fragNavController != null) {
if (currentFragment?.popChildFragment() == true) {
Expand Down Expand Up @@ -279,7 +282,7 @@ class NavigationActivity : BaseActivity(),
// MARK: TransactionListener

override fun onFragmentTransaction(fragment: Fragment?, transactionType: FragNavController.TransactionType?) {
handleFragmentChange(fragment)
handleFragmentChange(fragment, transactionType)
}

override fun onTabTransaction(fragment: Fragment?, index: Int) {
Expand Down Expand Up @@ -311,7 +314,7 @@ class NavigationActivity : BaseActivity(),

// MARK: Private functions

private fun handleFragmentChange(fragment: Fragment?) {
private fun handleFragmentChange(fragment: Fragment?, transactionType: FragNavController.TransactionType? = null) {
fragNavController?.let {
val showBackButton = it.isRootFragment.not() || BottomTab.fromInt(it.currentStackIndex) == BottomTab.Statistics
supportActionBar?.setDisplayHomeAsUpEnabled(showBackButton)
Expand Down Expand Up @@ -340,7 +343,7 @@ class NavigationActivity : BaseActivity(),
refreshCurrentFragment()
}

if (fragment is StatisticsProviderListFragment) {
if (fragment is StatisticsProviderListFragment && transactionType != FragNavController.TransactionType.POP) {
val statisticsContext = fragNavController?.getStack(BottomTab.toInt(BottomTab.Record))?.peek() as? IStatisticsContext
fragment.arguments = StatisticsProviderListFragment.buildArguments(statisticsContext?.statisticsProviders ?: emptyList())
}
Expand Down Expand Up @@ -378,17 +381,9 @@ class NavigationActivity : BaseActivity(),
}

bottomNavigation.setOnNavigationItemSelectedListener {
launch(Android) {
fragNavController?.switchTab(BottomTab.fromId(it.itemId).ordinal)
}

fragNavController?.switchTab(BottomTab.fromId(it.itemId).ordinal)
return@setOnNavigationItemSelectedListener true
}

bottomNavigation.setOnNavigationItemReselectedListener {
// FIXME: probably refresh the current fragment, not reset the stack
// fragNavController?.clearStack()
}
}

private fun setupNavigationDrawer() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.view.Menu
import android.view.MenuItem
import ca.josephroque.bowlingcompanion.BuildConfig
import ca.josephroque.bowlingcompanion.R
import ca.josephroque.bowlingcompanion.common.FragmentBreadcrumbLogger
import ca.josephroque.bowlingcompanion.settings.SettingsActivity
import ca.josephroque.bowlingcompanion.utils.Analytics
import ca.josephroque.bowlingcompanion.utils.Email
Expand All @@ -23,20 +22,8 @@ abstract class BaseActivity : AppCompatActivity() {
private const val TAG = "BaseActivity"
}

private val fragmentBreadcrumbLogger = FragmentBreadcrumbLogger()

// MARK: Lifecycle functions

override fun onStart() {
super.onStart()
supportFragmentManager.registerFragmentLifecycleCallbacks(fragmentBreadcrumbLogger, true)
}

override fun onStop() {
super.onStop()
supportFragmentManager.unregisterFragmentLifecycleCallbacks(fragmentBreadcrumbLogger)
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.base_activity, menu)
return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ abstract class BaseRecyclerViewAdapter<Item : IIdentifiable>(
// MARK:: ViewHolder

abstract inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
abstract fun bind(item: Item, position: Int)
abstract fun bind(item: Item)
}

// MARK: SwipeCallback
Expand All @@ -174,8 +174,7 @@ abstract class BaseRecyclerViewAdapter<Item : IIdentifiable>(

override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
if (swipeable) {
val position = viewHolder.adapterPosition
delegate?.onItemSwipe(getItemAt(position))
delegate?.onItemSwipe(getItemAt(viewHolder.adapterPosition))
}
}

Expand Down
Loading

0 comments on commit 833a86f

Please sign in to comment.