Skip to content

Commit

Permalink
ref: minors
Browse files Browse the repository at this point in the history
  • Loading branch information
VaiTon committed Oct 11, 2021
1 parent 837ce43 commit 7493a65
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class EditIngredientsViewModel @Inject constructor(
daoSession.allergenNameDao.list {
where(AllergenNameDao.Properties.LanguageCode.eq(localeManager.getLanguage()))
orderDesc(AllergenNameDao.Properties.Name)
}?.map { it.name }.let { emit(it) }
}.map { it.name }.let { emit(it) }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class EditOverviewViewModel @Inject constructor(
daoSession.categoryNameDao.list {
where(CategoryNameDao.Properties.LanguageCode.eq(appLang))
orderDesc(CategoryNameDao.Properties.Name)
}?.mapNotNull { it.name }.let { emit(it) }
}.mapNotNull { it.name }.let { emit(it) }
}

internal val suggestCountries = liveData {
daoSession.countryNameDao.list {
where(CountryNameDao.Properties.LanguageCode.eq(appLang))
orderDesc(CountryNameDao.Properties.Name)
}?.mapNotNull { it.name }.let { emit(it) }
}.mapNotNull { it.name }.let { emit(it) }
}

internal val suggestLabels = liveData {
daoSession.labelNameDao.list {
where(LabelNameDao.Properties.LanguageCode.eq(appLang))
orderDesc(LabelNameDao.Properties.Name)
}?.mapNotNull { it.name }.let { emit(it) }
}.mapNotNull { it.name }.let { emit(it) }

}

Expand All @@ -55,7 +55,7 @@ class EditOverviewViewModel @Inject constructor(
daoSession.brandNameDao.list {
where(BrandNameDao.Properties.LanguageCode.eq(appLang))
orderDesc(BrandNameDao.Properties.Name)
}?.mapNotNull { it.name }.let { emit(it) }
}.mapNotNull { it.name }.let { emit(it) }
}

internal val product = MutableLiveData<Product>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class WelcomeActivity : BaseActivity() {
val dots = (0..screens.lastIndex).map {
TextView(this).apply {
text = "\u2022"
this.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 35F);
this.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 35F)
setTextColor(WelcomeScreen[currentPage].color.lighten(0.85f))
binding.layoutDots.addView(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import java.io.Serializable
import java.util.*

/**
* JSON representation of the product nutriments entry
* JSON representation of the product `nutriments` entry.
*
* @see [JSON Structure](http://en.wiki.openfoodfacts.org/API.JSON_interface)
* See [JSON Structure](http://en.wiki.openfoodfacts.org/API.JSON_interface)
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
class ProductNutriments : Serializable {
Expand Down Expand Up @@ -143,9 +143,8 @@ class ProductNutriments : Serializable {
* calling getForAnyValue(1, "kg") will give you the amount of this nutriment
* given 1 kg of the product.
*
* @param portion amount of this product used to calculate nutriment value
* @param portionUnit units in either "g", "kg", or "mg" to define userSetServing
* @return nutriment value for a given amount of this product
* @param portion a measurement of the portion
* @return a nutrient measurement for a the given amount of this product
*/
fun getForPortion(portion: Measurement) = Measurement(
value = per100gInUnit.value / 100 * portion.grams.value,
Expand Down

0 comments on commit 7493a65

Please sign in to comment.