matt tighe
07/10/2019, 5:35 PMinterface PreferenceAccessor {
val fileName: String
val context: Context
val prefs: SharedPreferences
get() = context.getSharedPreferences(fileName, Context.MODE_PRIVATE)
}
class PrefAccessorImpl(ctx: Context): PreferenceAccessor {
override val fileName: String
get() = "somePrefFileName"
override val context: Context
get() = ctx
}
What I’m looking for is a way to define a bunch of shared preference implementations with different file names, but save on the boilerplate of using context to initialize them. i’d also like to avoid having Context
objects actually injectedflaccus
07/10/2019, 10:00 PMDarrinps
07/11/2019, 1:19 AMZaraki596
07/11/2019, 12:25 PMZaraki596
07/11/2019, 1:33 PMdarkmoon_uk
07/12/2019, 12:06 AMExecution failed for task ':android-client-common:lint'.
> Configuration with name 'compileClasspath' not found.
Ben Skiff
07/12/2019, 12:11 AMdawidhyzy
07/12/2019, 10:49 AMandroidExtensions {
features = ["parcelize"]
}
Jinal Barot
07/15/2019, 6:42 AMSuraj Shah
07/15/2019, 10:54 AMmaven_push.gradle
by Chris Banes still a good way to push aars to maven central?
Also, https://github.com/quiph/RecyclerView-FastScrollerKulwinder Singh
07/16/2019, 7:06 AMobject
in almost every activity, so therfore i have to create variables in each activity, i'm creating this variables to just use shorter names nothing else.
private val api
get() = UserRestApi.instance
private val authorization
get() = AccountUtils.userAuthToken
So now my question is that i'm thinking to create interface
like below.
interface Networking {
val api
get() = UserRestApi.instance
val authorization
get() = AccountUtils.userAuthToken
}
and then in each activity i will implement this interface and then i will directly access this api
and authorization
variables. so i don't have to create this variables in each activity, so like below i just have to implement
Networking
interface and i have access to this variables
class MyActivity : AppCompatActivity(), Networking {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.my_activity)
api.loadSomething(authorization)// so by implementing Networking i can access this fields
}
}
**1. So is something bad in this approach ?
2. is there any other solution to this problem in kotlin ?**Joao Birk
07/16/2019, 2:01 PMassetlinks.json
with the correct pkg name and SHA
I have set the android:autoVerify="true"
for the intent-filter
I have added: <meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>
I have tested: <https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://domain.name:optional_port&relation=delegate_permission/common.handle_all_urls>
But I still get the chooser. Anything else I'm missing?Darrinps
07/16/2019, 3:26 PMSrSouza
07/16/2019, 7:03 PMAlexJuca
07/17/2019, 6:38 AMNikola Milovic
07/17/2019, 10:12 AMjava.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $
adams2
07/17/2019, 10:44 PM@Parcelize
and had this member val someMap: Map<String, Any>
, do I need to add an @TypeParceler
fada21
07/18/2019, 1:23 PMdnp
07/19/2019, 1:31 PMgirafferson
07/19/2019, 4:49 PMg_robl
07/19/2019, 9:43 PMPlace.Builder().setLatLong(LatLong(x,y)).build()
) but I get `Cannot create an instance of an abstract class`; Place.Builder is an abstract class in Java.Виталий Перятин
07/20/2019, 7:28 AMpavi2410
07/20/2019, 11:04 AMfun ImageView.loadImage(
url: String?,
@DrawableRes placeholder: Int? = null,
circular: Boolean = false,
roundedCorners: Int = 0
) {
Glide.with(context)
.load(url)
.apply {
placeholder?.let { apply(RequestOptions().placeholder(it)) }
if (circular) {
apply(RequestOptions.circleCropTransform())
} else if (roundedCorners != 0) {
apply(RequestOptions.bitmapTransform(RoundedCorners(context.dip(roundedCorners))))
}
}
.into(this)
}
I would love to get any suggestions/improvements to this function.vapoyan
07/22/2019, 6:01 AMWhere do you keep your Extension methods?
dave08
07/22/2019, 8:06 AMkevin.cianfarini
07/22/2019, 10:56 PMwilliam
07/23/2019, 3:44 AMonCreateView
(for a Fragment
)ignus
07/23/2019, 7:27 AMSlackbot
07/23/2019, 11:11 AMscienticious
07/23/2019, 12:04 PMscienticious
07/23/2019, 12:04 PMgildor
07/23/2019, 12:49 PMczuckie
07/23/2019, 1:03 PMWill Shelor
07/24/2019, 2:04 AM