Skip to content

Instantly share code, notes, and snippets.

View sh3lan93's full-sized avatar

Mohamed Shalan sh3lan93

View GitHub Profile
@sh3lan93
sh3lan93 / build.gradle.kts
Created January 2, 2022 22:46
Accessing projects/modules using projects property when enable type-safe project accessor
dependencies{
implementation(projects.featCart)
implementation(projects.featProducts)
implementation(projects.featAuthentication)
implementation(projects.featAddresses)
implementation(projects.featCheckout)
implementation(projects.featAnalytics)
implementation(projects.featFilterUi)
implementation(projects.featCustomerService)
}
@sh3lan93
sh3lan93 / setting.gradle.kts
Created January 2, 2022 22:38
Enable type-safe project accessor feature in gradle 7.0
...
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
...
@sh3lan93
sh3lan93 / build.gradle.kts
Last active January 2, 2022 22:24
Referencing a module inside another module build script
dependencies {
...
implementation(project(path = ":feat-cart"))
implementation(project(path = ":feat-products"))
implementation(project(path = ":feat-authentication"))
implementation(project(path = ":feat-addresses"))
implementation(project(path = ":feat-checkout"))
implementation(project(path = ":feat-analytics"))
implementation(project(path = ":feat-filter-ui"))
implementation(project(path = ":feat-customer-service"))
query search($query: String!, $location: Distance!, $countryCode: String) {
search(searchQuery: $query, location: $location, countryCode: $countryCode) {
...
}
}
search(searchQuery: String
location: Distance
countryCode: String): ResultsType
@sh3lan93
sh3lan93 / Setting custom back button on toolbar
Created January 8, 2018 08:21
this is a simple code for setting a custom drawable for back button placed on toolbar
if (SharedPreferenceHelper.getDefaultLanguage(getActivity()).equals(SharedPreferenceHelper.ARABIC_LOCAL_LANGUAGE)) {
((AppCompatActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.ar_back);
}
else {
((AppCompatActivity) getActivity()).getSupportActionBar().setHomeAsUpIndicator(R.drawable.back);
}