Mikołaj Karwowski
01/29/2020, 1:03 PMsourceSets["commonMain"].dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-common")
implementation ("org.java-websocket:Java-WebSocket:1.4.0")
}
Java-WebSocket seems to me just a java library, so shouldn't it be available in common library part?luke
01/30/2020, 12:27 AMService
I'm unable to get a String
from resources, tried in onStartCommand()
onCreate()
and onDestroy()
, does anyone have any ideas?crankup
01/30/2020, 9:14 AMHackdiod
01/31/2020, 11:27 AMiex
01/31/2020, 4:17 PMprivate val testSingle = Single.just("item1")
private val foo = testPublishSubject.startWith(testSingle.toObservable().doOnNext {
Timber.i(">>> single on next: $it")
}).doOnNext {
Timber.i(">>> PS on next: $it")
}
fun onSomeEvent() {
testPublishSubject.onNext("item2")
}
So it's a PublishSubject
that gets initialized with a Single
. On certain event, I push a new value to the subject. So far so good!
The problem: I navigate to next screen and navigate back. Then the subject is reset to the initial Single
value ("item1"). Why? The ViewModel
is not reinitialized.Olenyov Kirill
01/31/2020, 4:46 PMBrian Dilley
01/31/2020, 6:27 PMTravis Griggs
01/31/2020, 9:44 PMJabez Magomere
02/03/2020, 1:32 PMMohammed Suleman
02/03/2020, 3:57 PMOfir Bar
02/04/2020, 9:54 AMbhatnagarm
02/04/2020, 11:02 AMdambakk
02/04/2020, 12:25 PMConstraintLayout
days)? Any recommended guides, documentations, tutorials, talks?gert.claeskens
02/04/2020, 12:50 PMJohn
02/04/2020, 1:51 PMadheus
02/04/2020, 5:00 PME/cloud_screenshotter: Exception taking screenshot: <http://java.io|java.io>.FileNotFoundException: /sdcard/screenshots/UnknownTestClass-unknownTestMethod-test-1.jpg (No such file or directory)
Nikola Milovic
02/05/2020, 9:32 AMOfir Bar
02/05/2020, 9:46 AMJavier
02/05/2020, 11:35 AMprivate var _binding: ResultProfileBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = ResultProfileBinding.inflate(inflater, container, false)
val view = binding.root
return view
}
override fun onDestroyView() {
_binding = null
}
binding
cannot be null never? If for some reason I want to get the context via binding.root.context
and the fragment is not attached, I can not get a NPE? @jwSaket Poddar
02/05/2020, 2:20 PMGabriel Brandao
02/05/2020, 5:41 PMiex
02/06/2020, 6:25 AMSergio C.
02/06/2020, 8:21 AMMaku Mazakpe
02/06/2020, 8:48 AMlawlorslaw
02/06/2020, 9:14 AMinterface RoomModel
and an entity that implements this interface
@Entity(tableName = "ContentAuthorModule")
ContentAuthorModule : RoomModel {}
now if i have a
List<RoomModel>
how do i check if its a
List<ContentAuthorModule>
I tried to do
roomModels is List<ContentAuthorModule>
override fun saveRoomModels(roomModels: List<RoomModel>) {
when(roomModels) {
is List<ContentAuthorModule> ->
contentAuthorModuleDao.insertAll(roomModels)
}
}
but it gives my a syntax error that says
Cannot check for instance of erased type : List<ContentAuthorModule>
is there another way to do this?Basil
02/06/2020, 7:03 PMChipGroup
and perform a click on individual `Chip`s. Any ideas?lawlorslaw
02/06/2020, 11:27 PMclazz
that is a KClassImpl
how would i check if that is of type FooBar
i tried this
clazz.java.isInstance(FooBar::class.java)
but that always returns falseRemy Benza
02/07/2020, 12:08 PMRemy Benza
02/07/2020, 4:11 PMby navGraphs()
which lets you scope 1 viewmodel to all the screens inside a specific navgraph. Normally you would have 1 viewmodel for each screen. Besides the benefits (easy state/data sharing between all your screens) what is a potential drawback of this approach?STAYER
02/07/2020, 7:22 PMfun Log.dd(msg: String? = "null", tag: String = "test1") = Log.d(tag, msg)
STAYER
02/07/2020, 7:22 PMfun Log.dd(msg: String? = "null", tag: String = "test1") = Log.d(tag, msg)
rkeazor
02/07/2020, 7:27 PMSTAYER
02/07/2020, 7:46 PMRajkumar Singh
02/08/2020, 2:03 AMSTAYER
02/10/2020, 9:40 AMfun Any.logE(msg: String, tr: Throwable? = null, tag: String = "test1") = when (tr) {
null -> Log.e(tag, msg)
else -> Log.e(tag, msg, tr)
}
And this:
fun Any.crashlyticsLog(tr: Throwable, msg: String): Unit {
logE(msg, tr)
Crashlytics.log(msg)
Crashlytics.logException(tr)
}
So i can log errors to Logcat and report to crashlytics in one line.
For example:
try {
//Do something
} catch(e: Exception) {
crashlyticsLog(e, "some info")
}
pavi2410
03/16/2020, 3:11 AMSTAYER
03/16/2020, 3:18 AMpavi2410
03/16/2020, 3:18 AM