|
|
|
|
@ -8,7 +8,6 @@ import android.widget.Toast |
|
|
|
|
import androidx.appcompat.app.AlertDialog |
|
|
|
|
import androidx.interpolator.view.animation.FastOutSlowInInterpolator |
|
|
|
|
import androidx.recyclerview.widget.DiffUtil |
|
|
|
|
import io.realm.kotlin.where |
|
|
|
|
import kotlinx.android.synthetic.main.fragment_session.* |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.model.LiveData |
|
|
|
|
@ -28,6 +27,7 @@ import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentableDiffCallback |
|
|
|
|
import net.pokeranalytics.android.ui.view.SmoothScrollLinearLayoutManager |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.SessionRow |
|
|
|
|
import net.pokeranalytics.android.util.extensions.findById |
|
|
|
|
import net.pokeranalytics.android.util.extensions.getNextMinuteInMilliseconds |
|
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
@ -314,7 +314,7 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate { |
|
|
|
|
fun setData(isTournament: Boolean, sessionId: String) { |
|
|
|
|
|
|
|
|
|
val realm = getRealm() |
|
|
|
|
val sessionRealm = realm.where<Session>().equalTo("id", sessionId).findFirst() |
|
|
|
|
val sessionRealm = realm.findById<Session>(sessionId) |
|
|
|
|
if (sessionRealm != null) { |
|
|
|
|
currentSession = sessionRealm |
|
|
|
|
sessionHasBeenCustomized = true |
|
|
|
|
@ -328,7 +328,7 @@ class SessionFragment : RealmFragment(), RowRepresentableDelegate { |
|
|
|
|
parentActivity?.findNearestLocation { |
|
|
|
|
it?.let { location -> |
|
|
|
|
realm.beginTransaction() |
|
|
|
|
val realmLocation = realm.where<Location>().equalTo("id", location.id).findFirst() |
|
|
|
|
val realmLocation = realm.findById<Location>(location.id) |
|
|
|
|
FavoriteSessionFinder.copyParametersFromFavoriteSession(currentSession, realmLocation, requireContext()) |
|
|
|
|
|
|
|
|
|
currentSession.location = realmLocation |
|
|
|
|
|