|
|
|
|
@ -23,7 +23,10 @@ import net.pokeranalytics.android.model.LiveData |
|
|
|
|
import net.pokeranalytics.android.model.realm.Currency |
|
|
|
|
import net.pokeranalytics.android.model.realm.Session |
|
|
|
|
import net.pokeranalytics.android.model.realm.Transaction |
|
|
|
|
import net.pokeranalytics.android.ui.activity.* |
|
|
|
|
import net.pokeranalytics.android.ui.activity.BillingActivity |
|
|
|
|
import net.pokeranalytics.android.ui.activity.CurrenciesActivity |
|
|
|
|
import net.pokeranalytics.android.ui.activity.GDPRActivity |
|
|
|
|
import net.pokeranalytics.android.ui.activity.Top10Activity |
|
|
|
|
import net.pokeranalytics.android.ui.activity.components.RequestCode |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableAdapter |
|
|
|
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate |
|
|
|
|
@ -105,6 +108,32 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep |
|
|
|
|
initUI() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Init UI |
|
|
|
|
*/ |
|
|
|
|
private fun initUI() { |
|
|
|
|
|
|
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
|
settingsAdapterRow = RowRepresentableAdapter(this, this) |
|
|
|
|
|
|
|
|
|
binding.recyclerView.apply { |
|
|
|
|
setHasFixedSize(true) |
|
|
|
|
layoutManager = viewManager |
|
|
|
|
adapter = settingsAdapterRow |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Init data |
|
|
|
|
*/ |
|
|
|
|
private fun initData() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun activityResumed() { |
|
|
|
|
this.settingsAdapterRow.notifyDataSetChanged() // refreshes session durations |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
|
|
|
|
|
|
when (requestCode) { |
|
|
|
|
@ -235,32 +264,6 @@ class SettingsFragment : RealmFragment(), RowRepresentableDelegate, StaticRowRep |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Init UI |
|
|
|
|
*/ |
|
|
|
|
private fun initUI() { |
|
|
|
|
|
|
|
|
|
// setToolbarTitle(getString(R.string.more)) |
|
|
|
|
|
|
|
|
|
// setDisplayHomeAsUpEnabled(true) |
|
|
|
|
|
|
|
|
|
val viewManager = LinearLayoutManager(requireContext()) |
|
|
|
|
settingsAdapterRow = RowRepresentableAdapter(this, this) |
|
|
|
|
|
|
|
|
|
binding.recyclerView.apply { |
|
|
|
|
setHasFixedSize(true) |
|
|
|
|
layoutManager = viewManager |
|
|
|
|
adapter = settingsAdapterRow |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Init data |
|
|
|
|
*/ |
|
|
|
|
private fun initData() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Open GDPR Activity |
|
|
|
|
*/ |
|
|
|
|
|