|
|
|
|
@ -13,6 +13,7 @@ import net.pokeranalytics.android.ui.view.RowViewType |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.CustomizableRowRepresentable |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.LocationRow |
|
|
|
|
import net.pokeranalytics.android.ui.view.rowrepresentable.SimpleRow |
|
|
|
|
import net.pokeranalytics.android.util.NULL_TEXT |
|
|
|
|
import timber.log.Timber |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -66,7 +67,7 @@ class LocationDataFragment : EditableDataFragment(), StaticRowRepresentableDataS |
|
|
|
|
|
|
|
|
|
override fun stringForRow(row: RowRepresentable): String { |
|
|
|
|
return when (row) { |
|
|
|
|
SimpleRow.NAME -> location.name |
|
|
|
|
SimpleRow.NAME -> if (location.name.isNotEmpty())location.name else NULL_TEXT |
|
|
|
|
else -> return super.stringForRow(row) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -136,6 +137,8 @@ class LocationDataFragment : EditableDataFragment(), StaticRowRepresentableDataS |
|
|
|
|
rows.clear() |
|
|
|
|
rows.add(SimpleRow.NAME) |
|
|
|
|
rows.add(LocationRow.LOCATION_PERMISSION_SWITCH) |
|
|
|
|
// Add info row to explain why we need the location permission |
|
|
|
|
rows.add(CustomizableRowRepresentable(customViewType = RowViewType.INFO, resId = R.string.location_when_in_use_usage_description)) |
|
|
|
|
|
|
|
|
|
if (isLookingForPlaces) { |
|
|
|
|
rows.add(LocationRow.LOCATION_LOADER) |
|
|
|
|
|