Info

Login

Channels

APIs

Credits

  • cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2019-03-15

2019-03-16

2019-03-17 »

Nick Message Date
kapil____ [kapil____!uid36151@gateway/web/irccloud.com/x-znjkdgfxnbhbfqec] has joined #kotlin [12:27]
djhworld [djhworld!~djhworld@90.240.217.178] has joined #kotlin [12:38]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [12:41]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [12:53]
HatesLongFiles how do i itterate over an array in indexes of 2 [12:54]
HatesLongFiles like the C for (int i = 0; i < sizeof(array); i++) { array[i++] = x; array[i] = y } [12:55]
HatesLongFiles sizeof(array) is probably incorrect but idc [12:56]
HatesLongFiles wish i could do an array as a vararg [01:47]
rruizt [rruizt!~rruizt@5354177C.cm-6-5a.dynamic.ziggo.nl] has joined #kotlin [01:59]
vigilanc1 [vigilanc1!~developer@unaffiliated/vigilancer] has joined #kotlin [02:00]
ziyourenxiang [ziyourenxiang!~ziyourenx@unaffiliated/ziyourenxiang] has joined #kotlin [02:15]
padrepio [padrepio!~padrepio@62-11-54-188.dialup.tiscali.it] has joined #kotlin [02:53]
t2mkn [t2mkn!~t2mkn@43.226.2.203] has joined #kotlin [02:54]
lankanmon [lankanmon!~LKNnet@CPE64777d632383-CM64777d632380.cpe.net.cable.rogers.com] has joined #kotlin [03:01]
esro [esro!~esro@user119-167.otvarta.com.pl] has joined #kotlin [03:27]
t2mkn [t2mkn!~t2mkn@43.226.2.203] has joined #kotlin [03:29]
kostrifon [kostrifon!~kostrifon@31.28.114.241] has joined #kotlin [03:49]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [05:19]
HatesLongFiles how do i do this using json2view? setContentView(R.layout.activity_main) ; val textView = findViewById(R.id.text_view) as TextView [05:31]
vikikas [vikikas!~vikas@2a02:1205:5035:8020:2402:499b:dfd9:bf50] has joined #kotlin [05:38]
yawkat you wouldnt, presumably [05:39]
yawkat have you considered reading the documentation of json2view [05:39]
rohdef [rohdef!~rohdef@90.184.72.135.1.fullrate.ninja] has joined #kotlin [05:41]
HatesLongFiles yes [05:42]
HatesLongFiles so far i has this [05:43]
HatesLongFiles val sampleView : View? = DynamicView.createView(this, VIEW.getAsJSONObject()) if (sampleView == null) throw Exception("sampleView is null") setContentView(sampleView) val sampleTextView : View? = sampleView.findViewById(R.id.text_view) if (sampleTextView == null) throw Exception("sampleTextView is null") [05:43]
yawkat yea, thats not how you do it in json2view [05:44]
yawkat please read the documentation of json2view [05:44]
HatesLongFiles i get java.lang.Exception: sampleTextView is null [05:44]
yawkat yes, that is correct, because json2view does not work this way [05:45]
HatesLongFiles would i need to do what example 02 in https://github.com/Avocarrot/json2view/wiki/Creating-Dynamic-Layouts does [05:45]
yawkat yes, correct [05:45]
HatesLongFiles so to be clear, to be able to obtain a textview i would need to do this? ... [05:46]
HatesLongFiles static public class SampleViewHolder { [05:47]
HatesLongFiles /* we need the View with id testClick */ [05:47]
HatesLongFiles @DynamicViewId(id = "text_view") [05:47]
HatesLongFiles public View TextView; [05:47]
HatesLongFiles /* Constructor must be public */ [05:47]
HatesLongFiles public SampleViewHolder() {} [05:47]
HatesLongFiles } [05:47]
HatesLongFiles fk i forgot to remove the new lines [05:47]
HatesLongFiles static public class SampleViewHolder { /* we need the View with id testClick */ @DynamicViewId(id = "text_view") public View TextView; /* Constructor must be public */ public SampleViewHolder() {} } [05:47]
yawkat yes, something to that effect, just with proper types [05:48]
HatesLongFiles and then obtain it with val sampleView : View? = DynamicView.createView(this, VIEW.getAsJSONObject(), SampleViewHolder::class.java); val sampleTextView : TextView? = ((SampleViewHolder) sampleView.getTag()).text_view [05:50]
HatesLongFiles right? [05:51]
yawkat sure [05:51]
HatesLongFiles also i get Classifier 'SampleViewHolder' does not have a companion object, and thus must be initialized here [05:52]
yawkat yes, because that is java code, not kotlin code [05:52]
HatesLongFiles how do i turn it into kotlin code [05:53]
yawkat by programming [05:53]
HatesLongFiles ._. [05:53]
HatesLongFiles ok, lets see if this works val sampleTextView : TextView? = ((sampleView.tag as SampleViewHolder).TextView) [05:59]
HatesLongFiles and it crashes ._. [05:59]
HatesLongFiles sampleTextView is null [05:59]
HatesLongFiles ughhhh wtf ;-; [06:00]
HatesLongFiles what am i missing ;-; [06:03]
yawkat either you are not configuring it correctly, or there is no such view present in the json. [06:03]
HatesLongFiles ok [06:05]
HatesLongFiles this is my MainActivity.kt https://bpaste.net/show/a0bea3ab8c63 [06:05]
yawkat that is an amazingly convulted way of producing json [06:06]
HatesLongFiles xP [06:07]
HatesLongFiles 'convoluted definition: 1. very twisted: 2. Convoluted sentences, explanations, arguments, etc. are unreasonably long and difficult to understand: 3. (esp. of ...' oh [06:09]
HatesLongFiles https://bpaste.net/show/1f9e5cd80f0a is that better [06:15]
yawkat no [06:16]
HatesLongFiles how can i make it better? [06:17]
yawkat representing the json as text, possibly [06:18]
HatesLongFiles but then you gotta quote escape everything [06:18]
HatesLongFiles though that would be nice [06:19]
HatesLongFiles but the main issue would be correctly escaping the string [06:19]
yawkat no, because kotlin has raw strings [06:19]
HatesLongFiles what does that mean [06:20]
yawkat please see the kotlin documentation on raw strings [06:21]
HatesLongFiles that isnt specified in kotlin-docs.pdf [06:22]
HatesLongFiles closest match is Raw shared memory [06:22]
yawkat incorrect [06:22]
HatesLongFiles A raw string is delimited by a triple quote ( """ ), contains no escaping and can contain newlines and any other characters: [06:25]
HatesLongFiles can i use a throw Exeption() as a printing callback lol [06:26]
yawkat what does "printing callback" mean [06:30]
HatesLongFiles how do i make my function take an argument of (String) ? Unit [06:31]
yawkat just like with any other type [06:32]
HatesLongFiles Type mismatch. [06:32]
HatesLongFiles Required: (String) ? Unit [06:32]
HatesLongFiles Found: Unit [06:32]
HatesLongFiles fun throw_exception(message:String) : Unit { throw Exception(message) } [06:32]
HatesLongFiles printing_function_callback: (String) -> Unit = ::println [06:33]
HatesLongFiles fun print_object_pretty(printing_function_callback: (String) -> Unit = ::println) { printing_function_callback("json: ${toPrettyFormat(Gson().toJson(Object))}\n") } [06:34]
lankanmon [lankanmon!~LKNnet@CPE64777d632383-CM64777d632380.cpe.net.cable.rogers.com] has joined #kotlin [06:52]
HatesLongFiles welp [06:53]
HatesLongFiles does {x -> VIEW.throw_exception(x)} instead [06:53]
HatesLongFiles wonder if i can throw it directly lmfao [06:53]
HatesLongFiles LMFAO i can [06:56]
HatesLongFiles it* [06:56]
HatesLongFiles i* [06:56]
HatesLongFiles anyway, this is my JSON https://bpaste.net/show/771b787eadd1 [06:58]
HatesLongFiles which is meant to represent this layout https://bpaste.net/show/e8335a21b9a2 [06:59]
yawkat looks like you dont actually have an id anywhere. [06:59]
HatesLongFiles oh your right [07:06]
HatesLongFiles i would add it like this right? [07:07]
HatesLongFiles { "name": "id", "type": "string", "value": "text_view" }, [07:07]
HatesLongFiles if so i still get sampleTextView is null ( val sampleTextView : TextView? = ((sampleView.tag as SampleViewHolder).TextView) ) [07:08]
HatesLongFiles do i need to include the @+id/ aswell [07:09]
HatesLongFiles or does that only apply to xml files [07:09]
HatesLongFiles eg, "@+id/text_view" [07:10]
HatesLongFiles if so then that STILL returns null [07:10]
HatesLongFiles https://bpaste.net/show/8f4b7e160f3a [07:12]
HatesLongFiles yawkat: what am i doing wrong? [07:13]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [07:20]
kostrifon [kostrifon!~kostrifon@31.28.114.241] has joined #kotlin [07:31]
kapil____ [kapil____!uid36151@gateway/web/irccloud.com/x-spltqmtiffgdqhit] has joined #kotlin [07:32]
HatesLongFiles https://bpaste.net/show/bb5f1fd8c4dd so this works... not sure why but it works [07:40]
HatesLongFiles welp its not android.widget.* [07:51]
HatesLongFiles https://bpaste.net/show/3bb0f42334a4 why does the demo code work and my code ( K ) fail [07:57]
t2mkn [t2mkn!~t2mkn@43.226.2.203] has joined #kotlin [09:00]
Addax because you don't know what you're doing [09:13]
Addax anyone know of a workable deep comparison for maps written in kotlin? I can write one, I just don't want to [09:28]
HatesLongFiles [HatesLongFiles!~Android@172.193.55.193] has joined #kotlin [09:36]
padrepio [padrepio!~padrepio@62-11-54-188.dialup.tiscali.it] has joined #kotlin [10:06]
t2mkn [t2mkn!~t2mkn@43.226.2.203] has joined #kotlin [10:15]
taelore [taelore!~taylorrr@unaffiliated/taylorrr] has joined #kotlin [10:36]
esro [esro!~esro@user119-167.otvarta.com.pl] has joined #kotlin [10:42]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [11:34]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [11:52]
kostrifon [kostrifon!~kostrifon@31.28.114.241] has joined #kotlin [12:18]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [12:49]
wodencafe [wodencafe!~wodencafe@cpe-66-25-19-169.tx.res.rr.com] has joined #kotlin [01:03]
wodencafe parted the channel: "Konversation terminated!" [01:03]
polyzium [polyzium!~polyzium@unaffiliated/polyzium] has joined #kotlin [01:04]
polyzium Hello guys [01:06]
polyzium Does anyone do android development with kotlin? [01:06]
cheeser lots of folks do! [01:10]
polyzium So I have a problem [01:10]
polyzium I'm a beginner so sorry I may say stupid things [01:11]
polyzium I tried to make a simple clock in an infinite loop which is in a thread/coroutine (I tried either way) [01:11]
polyzium because I'm not allowed to access the view hierarchy from another thread I'm forced to use runOnUiThread [01:12]
polyzium I tried putting the infinite loop in there and the whole function in a thread/coroutine [01:12]
polyzium I get a white screen [01:12]
polyzium I tried searching for a solution but it didn't lead me to anything [01:13]
rruizt [rruizt!~rruizt@5354177C.cm-6-5a.dynamic.ziggo.nl] has joined #kotlin [01:13]
polyzium I don't know what to do now [01:13]
yawkat you cant do infinite loops on the ui thread or nothing will render [01:17]
polyzium Then how can I keep polling the clock forever? [01:17]
polyzium Or it's impossible? [01:17]
polyzium I can see the result without running it on an UI thread just a moment before the app crashes [01:20]
funeral [funeral!~Funeral@102.79-160-144.customer.lyse.net] has joined #kotlin [01:26]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [01:40]
polyzium parted the channel: "Leaving" [01:57]
zutat [zutat!5d849e1d@gateway/web/freenode/ip.93.132.158.29] has joined #kotlin [02:12]
rohdef [rohdef!~rohdef@90.184.72.135.1.fullrate.ninja] has joined #kotlin [02:14]
t2mkn [t2mkn!~t2mkn@43.226.2.203] has joined #kotlin [02:36]
pheerai [pheerai!~pheerai@92.117.151.96] has joined #kotlin [02:36]
intrigus [intrigus!uid114902@gateway/web/irccloud.com/x-jqsqormpnblohqqy] has joined #kotlin [02:39]
LordDrako [LordDrako!~LordDrako@2001:bc8:3f13:ffc2:61f9:8fc7:be3:377b] has joined #kotlin [02:49]
DTZUZO [DTZUZO!~DTZUZO@S0106bcd16584b0aa.vs.shawcable.net] has joined #kotlin [03:09]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [03:11]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [03:25]
Renari [Renari!~Renari@70.15.16.168.res-cmts.sm.ptd.net] has joined #kotlin [04:27]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [04:54]
glosoli [glosoli!~glosoli@unaffiliated/glosoli] has joined #kotlin [05:01]
sbalmos1 [sbalmos1!~sbalmos@cpe-71-67-115-30.cinci.res.rr.com] has joined #kotlin [05:06]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [05:08]
t2mkn [t2mkn!~t2mkn@43.226.2.203] has joined #kotlin [05:23]
ChrisLane [ChrisLane!~irc@cpc119606-heme14-2-0-cust161.9-1.cable.virginm.net] has joined #kotlin [05:46]
padrepio [padrepio!~padrepio@62-11-54-188.dialup.tiscali.it] has joined #kotlin [05:48]
HatesLongFiles [HatesLongFiles!~Android@cpe-172-193-55-193.qld.foxtel.net.au] has joined #kotlin [05:49]
sbalmos [sbalmos!~sbalmos@cpe-71-67-115-30.cinci.res.rr.com] has joined #kotlin [06:12]
vigilanc1 [vigilanc1!~developer@unaffiliated/vigilancer] has joined #kotlin [06:31]
intrigus [intrigus!uid114902@gateway/web/irccloud.com/x-lzkcsfblnjgrnfrf] has joined #kotlin [06:38]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [06:40]
ziyourenxiang [ziyourenxiang!~ziyourenx@unaffiliated/ziyourenxiang] has joined #kotlin [07:21]
bjartek [bjartek!~bjartek@165.227.136.50] has joined #kotlin [07:35]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [07:46]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [08:56]
lankanmon [lankanmon!~LKNnet@CPE64777d632383-CM64777d632380.cpe.net.cable.rogers.com] has joined #kotlin [10:03]
beepdog [beepdog!~dkowis@sourcemage/elder/dkowis] has joined #kotlin [10:05]
waz [waz!~waz@pdpc/supporter/active/waz] has joined #kotlin [10:05]
rruizt [rruizt!~rruizt@5354177C.cm-6-5a.dynamic.ziggo.nl] has joined #kotlin [10:28]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [10:36]
vigilancer [vigilancer!~developer@unaffiliated/vigilancer] has joined #kotlin [10:39]
vigilancer [vigilancer!~developer@unaffiliated/vigilancer] has joined #kotlin [10:39]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined #kotlin [10:47]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [10:53]
t2mkn [t2mkn!~t2mkn@43.226.2.76] has joined #kotlin [11:07]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined #kotlin [11:20]