Placeholder Image

字幕表 動画を再生する

  • Hey, everybody, welcome to live coating with Jesse.

  • I'm Jesse.

  • And today we're going to keep working on our brain computer app.

  • We have all of our phase one functionality working, but it doesn't look very good.

  • So we need to style it a little bit.

  • Just make it look a little bit nicer.

  • Doesn't have to be like amazing, right?

  • But we want to look a little bit better.

  • And if we get through that today, then we're going to do whatever else we need to do to get it ready to actually go to the Google play store.

  • We're gonna launch this first.

  • That's an android app.

  • Later on on IOS I happen to have an android phone.

  • So that's why I'm doing android first.

  • And I'm on a PC.

  • Uh, who?

  • I do have a Mac that I can use to launch this as an eyeless apa's well, but it's not as good for streaming.

  • So we're gonna try this first Azan android app since the last time we streamed.

  • I did in stole, uh, android studio so we can simulate the android app right now, I'm just gonna stay in the the web mode because it's easier to work with when we're styling.

  • But at some point when we need to, we can also check out the simulator in Android Studio.

  • Okay, So, see, there's a lot of you here, and a lot of you've been waiting for a long time.

  • I noticed a few.

  • You are in time zones toe where it's like 2 a.m. three a.

  • M.

  • Something like that.

  • I apologize for that.

  • I, um I used to be able to stream earlier in the day to accommodate time zones, especially the time zones, like, if you're in India or time zones in that area.

  • Ah, but unfortunately, I have to work during that time period now, So it's kind of hard for me to accommodate, I guess if I waited till even later, like towards nighttime here in my time zone, uh, I it would be Maybe morning.

  • There's just not really a time that I can stream that would accommodate all time zone.

  • So, uh, let me know if this is a very awkward time for you, and I'll keep that in mind.

  • But, um, I guess pride, the best thing for me to do maybe, is just try to do different times when I can, so that you could always watch the recording.

  • But, you know, maybe sometimes you can catch it live if I switch up the times.

  • One other thing I wanted to ah, to tell you all before we get started with the code, you may have noticed that part two is no longer available.

  • So this is part four of a streaming Siri's part two is not available.

  • Eso, after trying to figure out what happened apart to my best guess is that what happened is that I accidentally deleted.

  • It s Oh, I'm very sorry about that.

  • Um, I'm not I don't really remember the leading it for sure, but would, I do remember, is that before the last stream, like, right before the last dream, I was trying to set the stream up, and I accidentally created the stream with, um, basically like no scheduled start time, which means the stream would be scheduled start immediately.

  • And then I quickly realised my mistake and started a new stream.

  • Tried to start a new stream with the same name that would have the correct start time.

  • And I wanted to quit that old stream basically delete the old stream, so I wouldn't confuse people who were thinking that it would start immediately.

  • And, um, what I think happened is that I thought I was deleting that that stream that should have never been created.

  • But in reality, I may be deleted the wrong stream.

  • And I really did the 2nd 1 That's what I think happened.

  • Uh, the the reason I think that is because after I finished that stream, which a stream three, I went back and saw that the duplicate of Stream three was still there had never been deleted.

  • And so I'm thinking, maybe that's what happened.

  • I tried to contact you tube through the feedback.

  • Like their feedback motile on like Creator studio is like the YouTube, um, kind like admin panel for, um, creators.

  • I tried sending a message there.

  • I don't really know if they'll get around.

  • I don't know if they even would, um, put, like, recreate that video.

  • I know it's possible.

  • I have read online that it happens sometimes that they will recreate the video, but I'm not 100% sure like free code.

  • Can't doesn't monetize, so I don't know.

  • I don't know how Google would view that if it would.

  • You know, I've heard that they do it for large channels.

  • This is kind of a large channel, but I don't know.

  • So we'll see.

  • I'm kind of expecting that that video never come back.

  • So I really apologize for that.

  • Um I mean, I like I tried to read everything I could and do whatever I could to try to get it back.

  • But it's ending.

  • It's out of my hands at this time.

  • So anyway, uh, that's what happened to number two.

  • I did have a few people ask about it, so I figured I'd just let everybody know.

  • So let's go ahead and get started when, Like I said, we're gonna do some styling.

  • We may also add in you maybe clean up the code a little bit if I noticed somewhere where we could clean it up.

  • It's still very simple, though.

  • We've managed to do everything all in one file, but we do have some places where you know, for instance, we still some commented out code.

  • You know, this if statement is kind of pointless, right?

  • Since we're not doing anything else.

  • So a few places where we could clean things up, you know?

  • Rather not ship unnecessary code if I don't have to, so we'll be on the lookout for that.

  • But for now, we want to do some styling, which we basically did.

  • You're very, very little styling.

  • You know, up to this point, I don't even know if we have an object for Stiles.

  • No, we don't.

  • Okay, let's do that first.

  • Let's make that.

  • So in react, Native.

  • Let me set my timer as well.

  • So I'm gonna set a timer for 25 minutes and I'll do code for 25 minutes.

  • And then when the timer goes off, I'll go back to the live chat.

  • I'll answer some questions as many as I can get to in a five minute time period, and then we'll do a little bit more coke.

  • All right, So Okay, we did import style sheet, so maybe we have it somewhere.

  • I just don't know where we're using style sheets.

  • Here we go.

  • Just got mixed in there with everything else.

  • So when you're doing react native, it's ah, it's a good idea to use this style sheet dot Create and to put your styles in here.

  • It helps, as far as I know, with what react native does behind the scenes that helps with performance eso Let's let's move our styles into are, uh, style sheet dot create object and then we'll go from there that'll clean things up a little bit, get our styles.

  • Oh, in the same spot.

  • So if I take this so this would be our our inputs, it looks like all our imports have the same the same styling, so I should be able to select all of them and let's get rid of them.

  • And let's say style equals stiles dot input and then appear in our style objects.

  • Let's create a key called input.

  • Whoa, Didn't not mean for that to happen.

  • Input.

  • And then let's paste.

  • Oops.

  • I wondered if that was gonna happen, since I I cut all of them.

  • But let's paste our styles into here.

  • Okay?

  • Now what we should get is are let's log out so we can actually see this.

  • See if it'll area.

  • Um, so see these now have the same styles and we cleaned up a decent amount of code here because we just move this into Stiles.

  • This works just like a normal style sheet with a few differences.

  • So a normal style she uses CSS syntax, right?

  • This is Josh Shipp objects syntax.

  • So you notice we don't have hyphenated properties here, there?

  • Campbell case.

  • So if you take your normal CSS properties and camel, case them than the work.

  • And, um, also, we have no values and react native, so there's no pixels at the end.

  • It's just straight numbers.

  • Okay, Anything else is a string.

  • We can also throw JavaScript in here, which is a pretty cool feature.

  • Um, and then by default, everything is in flex box in react native and the flex direction by default is column.

  • Whereas normally in on the Web, the default flex direction is ro.

  • Those are the main differences now.

  • React native uses a subset of CSS, which means that you can't use all of what's available in CSS and react native, but most of it's still available.

  • S so if you if you try to do something that's not available, you'll get a message in, um, well in your browser, depending on what you're using, Ah, whether a browser or, uh, an emulator or testing on a device.

  • At some point you'll get some warning to say that.

  • You know, this doesn't work.

  • At the very least, you'll see on the screen that it doesn't work.

  • Right?

  • So, for now, uh, I think everything we're trying to do will definitely work.

  • So let's look through the rest of our app just to make sure we didn't miss anything.

  • No, we didn't miss anything.

  • So right now, let's add some styling to our our links here, or I'm sorry, our inputs here, Um, the inputs are really close together, which looks kind of weird.

  • So let's add a little little space between these, so I'm gonna add Ah, that's that's, um, Margin.

  • And I'm gonna do margin vertical.

  • This is a little different.

  • You don't see this too often in CSS, but in react native with our style sheet weaken.

  • Same Arjun vertical.

  • And let's just give it an eight and see how that looks.

  • Now, what this will do is margin.

  • Vertical will add a margin on the top and the bottom at the same time.

  • So we end up with in between inputs.

  • Here we end up with actually 16 pixels or 16 units, right of margin and then at the bottom.

  • Here we have eight, so I don't know.

  • Sorry if it Ah, there's a little bit of a delay on the stream.

  • My computer has been doing this weird thing lately where every once in a while, like I could hear my music, like slows down and from recording a video, are streaming it just like stops for a second or two.

  • I haven't been able to figure out what's doing it yet.

  • Hopefully, I can just maybe try to restart.

  • That'll fix the problem.

  • Um, all right, So I don't really like that much, huh?

  • That much padding.

  • And to be honest with you, let's Ah, let's give this a little mobile mobile view here.

  • So let's try to imitate a mobile view and see if we can get a right Now it's showing this I wonder Device toe.

  • All right, Cool.

  • So we can kind of see how this would look on a mobile device.

  • It's actually look super small.

  • I think we can definitely make this stuff bigger.

  • I wonder why.

  • Why did it look so small?

  • Uh, did we have it on?

  • Oh, because I had it zoomed in a lot, that's why.

  • So, uh, definitely going to take the zoom off of that, at least on the desktop or the Web version, I don't know.

  • And my, uh, my timer stopped.

  • That's interesting.

  • I wonder if my stream freezing in my timer stopping or have anything to do with each other.

  • I guess we'll have to keep an eye on the clock.

  • Now, Uh, at about 5 30 Eastern time or about 1/2 hour into the stream, I'm gonna take a break and go to the good of the chat.

  • All right, so let's Ah, let's make these a little bit bigger.

  • I want to make let's make the text bigger as well.

  • Uh, which?

  • I don't think we have any styles on the text.

  • So let's make style equals, Let's say styles dot who heading?

  • I've been typing on a different keyboard Old day for work.

  • So now I'm ah, keep miss typing everything.

  • So we're gonna do for our texts whenever the style start heading.

  • Oops.

  • And, uh, let's give this a font size of let's say 24 to see what?

  • That how that looks all right.

  • A little bit bigger.

  • Not you bad and um, I kinda you know, I want this to be kind of stand out a little bit more.

  • So let's do margin bottom.

  • Uh, well, we'll give this a 16 for a margin.

  • Bottom forgot my comma.

  • See what that looks like.

  • Okay, a little bit better.

  • All right.

  • Not bad.

  • And actually, with more space there, the spacing on these inputs doesn't look quite as bad.

  • Also are inputs are you know, I think they could definitely be wider.

  • Like, right now, you can't even see, uh, all the content.

  • I wonder what would happen if we just comment out the with.

  • Would it go for with Okay, it's it looks like maybe it's it's defaulting to some sort of pre set with.

  • I guess I'm okay with that, To be honest with you, though, I mean, I think we could go like there's quite a bit of white space here.

  • We may wanna, you know, go a little bit wider.

  • Especially because the device ideas is so large.

  • There may not really be a way to fit it in there, but actually feeling just a little bit wider.

  • I think it would.

  • It would work eso Let's figure out why it's getting this with and I'm gonna We don't need much space for the preview, right?

  • And I'm gonna look over here, make this just a bit smaller.

  • Sorry if it makes it harder to see.

  • But, um, I want to see what kind of styles were getting here.

  • And if we go already computed.

  • So if we look here and inspect the input right, we're so we're on the input.

  • And if we go to computed, we could stroll down.

  • It's in alphabetical order and we can go with and see like All right.

  • Actually, when it's great out like this, this doesn't mean that they So what makes you could see it?

  • You could see it.

  • I was afraid my face was covering it up.

  • When is great out like this, it means that there's no with directly applied to that.

  • So I'm guessing that this is just taking up the full space of its container.

  • So let's check the container.

  • Ah, maybe not.

  • So where that's interesting.

  • Maybe maybe we'll get lucky and just find it in here.

  • I'm sure it's just it's an odd number to default to rate.

  • Was it defaulting to 1 52 Yes, that is odd.

  • And we could see there's not really It's not like the container is forcing it to be there.

  • This is the container.

  • So, uh, the container is much bigger.

  • Let's see.

  • We'll see what we can do.

  • Uh, let's see if we can do some flex box stuff here.

  • So if we do flex one flex, one should stretch this out.

  • I was afraid it would do that.

  • Um, so flick it stretches out the wrong way.

  • Probably because we have it set.

  • Uh, flex direction.

  • Row.

  • That's why, uh uh, this get rid of the flakes.

  • All right.

  • Uh, see, you keeps telling me that the stream is not get enough data me check my connection.

  • That's weird.

  • Connection seems all right.

  • Let me know if if anybody's having trouble seeing this.

  • I'm gonna um Yeah, connection looks good.

  • Maybe in about five minutes.

  • I'm gonna interesting question.

  • So if you're in the chat right now asking questions of stuff, hang in there for about five more minutes, and, uh well, uh, well, it's just the questions here.

  • Let's see.

  • I don't remember if you could do this in react Native.

  • 100%.

  • I'm pretty sure it's not going to give us what you want, but it's worth a shot.

  • Hey, it worked.

  • Now it works now on the web.

  • Monahan percent sure it would work on mobile, but that definitely made things larger.

  • And I don't want that.

  • I don't want it to be that big.

  • So what we can do those we can say with 100.

  • But then we can also set a max with and we could see, like, you know what we really wanted to be like.

  • How wide is it right now?

  • 3 18 Uh, what if we said, you know, really never wanted to be more than, uh, to 80?

  • This just c to a D.

  • C.

  • I look okay, Um, we could probably go a little bit smaller.

  • Since we have our device, I d.

  • There.

  • Let's see if we can get away with, like, 2 60 Okay, 2 60 That gives us enough space for our number.

  • Now, the reason that these little icons are showing up is because I have last past, and so it's shown up there.

  • These won't normally show up unless somebody had last past.

  • But in case they do, we'll have a little space for him.

  • Uh, we got enough space for the device I D.

  • And certainly enough space for the email and password doesn't matter because, you know doesn't really show up anyway.

  • And let's see, I really don't like that these air right up next to the edge of this, uh, so I wonder if we could do something about that.

  • Let's see if there is.

  • Let's let's go to our documentation for a text input and see if there's some way to get a little bit of padding in between, um, this Maybe we could, But you see, if padding or work, that's where the shot and then we won't have to go to the documentation.

  • Let's just say padding, uh, horizontal.

  • And let's give, Ah, four for Patty horizontal.

  • See what it does.

  • Cool.

  • All right.

  • They gave us a little bit of padding, too.

  • Awesome.

  • All right, so that works.

  • Um, it's looking a little bit better.

  • Uh, this button says, Press me.

  • That's not what we wanted to say.

  • Um, so let's change what the button says.

  • So we wanted to say Maybe submit.

  • See how that looks.

  • Submit.

  • Looks good also, you know, maybe we could do something with the way the button looks.

  • And I think there's probably some built in styling options for this button, so we definitely could look that that.

  • So let's check out react native button.

  • And, um, let's see this reference here.

  • Cool.

  • We have accessibility label, which you probably add that accessibility label and this takes a string on.

  • We could just say submit.

  • That's pretty shape forward.

  • Would you submit with me?

  • Okay.

  • We could color the colors for the color of the text in Iowa or the background color and Andrey among away about that.

  • Now, just leave it as the default.

  • I mean, just for, uh otherwise, I'm going to take a long time to figure out what color I want it to be.

  • So I don't wanna, um I don't want to do that.

  • We're not working on end and test yet, so I'm gonna leave the test.

  • I d out and let's see what else we have.

  • Okay.

  • It looks like there's nothing else built in in terms off styling.

  • Just see, it's not going to show us.

  • I was hoping we get a preview of what it would look on different devices, but does it show?

  • All right, So what we can do is add style on here.

  • So this will be the last thing we do before I go to the questions, our styles, that button.

  • And we have another button, actually.

  • So let's make sure we, uh the ad, this button and why is it seen style?

  • Can we not give a style to this button from?

  • Maybe we can Maybe that's it.

  • Maybe we're stuck with this.

  • This style, which is fine.

  • I want to keep this very simple for the for the first release I could always add, um, add in better, better styles you later on.

  • All right, so here we go.

  • So we have our inputs and our submit button slightly better look to it.

  • A little bit more space here.

  • And, uh, now, let me go to that shot set a time here.

  • You know this this timer that I've been using?

  • It's the tomato timer.

  • Dotcom.

  • It's been just stopping out of nowhere.

  • The last couple of days, I might switch it up and go back.

  • I used to have a different timer that I use, but I forget the euro for it, but May may have to switch it up.

  • All right, so I'm gonna try to answer as many questions as I can if I accidentally skipped your question, you know, just, like, ask it again or put it down on the comments, and I'll try to get to it.

  • Right.

  • So, um, I have some questions, people, a few people asking what is a brain computer app?

  • So bring keep your app is just an app that reads your brain waves.

  • Uh, well, I should say this is a device.

  • It's a combination of a device in a nap.

  • So this is the device I'm using.

  • It is called the Notion Brain Computer.

  • It's built by a company called Generosity.

  • It's a start up company, and, um, inside of this is the same tech you'd find in a cell phone on or like an Internet of things device.

  • You put it on your head, it reads your brain waves, and then you can send those brain ways to wherever you want.

  • In this case, we're sending it to our app and for this app for keeping it very simple.

  • And we're just tracking the level of focus.

  • I believe it's the gamma waves in your brain.

  • Give you a good indication of how focused you are.

  • So we're tracking the level of focus.

  • And if the focus drops below a certain level, we're changing the color of the screen, and we're making the device vibrate.

  • And so that's what a brain computer app is for this project.

  • I hope to do some projects in the future where we do other things with the data coming out of the brain.

  • But this is kind of a proof of concept.

  • Just to show that we can rely a B, get data to a mobile device through a react native app amusing react native and Expo s.

  • So this is kind of phase one project one of your working with brain waves and react.

  • Native Alex asked if this is going to be posted on the channel after the live stream ends?

  • Yes, it will.

  • And I will not delete it this time.

  • Let's see, uh, Rudra asked, what is a variable and programming, um variable is ah, little piece of data, right that you can assign.

  • Well, it's something that you can assign data too.

  • Okay.

  • S O let me give you a I gotta have a very boring here somewhere, right?

  • Here we go.

  • So we have constant notion is a type of variable called a constant.

  • That means that we can't change it after we sign it a value.

  • And we've named your variable notion.

  • And that notion notion holds the value of a new notion that we've been Stan.

  • She ated with a particular device.

  • I d.

  • All right.

  • So variable Could be a lot of different kinds of data.

  • Could be just a string, Which would be like a word, uh, or a number, right.

  • It could be an object.

  • It could be an array.

  • So there's a variable.

  • Could be a lot of different things, But at its most basic thing, it's just something that you used to hold a value.

  • Everybody, everybody is saying hello from different parts of the world.

  • How's it going?

  • Uh, are never asked what my time zone is.

  • I am in Eastern standard time.

  • So it's the east coast of the United States.

  • Is my time zone So the same time zone as New York City?

  • Um, that's probably the biggest city.

  • I think in this time zone.

  • Let's see, Uh, my Tommy says, Did you really delete it?

  • I unfortunately, I really did delete the second part of this stream, Uh, the second part of this series.

  • So ah, very upset about that.

  • Like I was honestly, like I felt sick when I realized what had happened.

  • So I mean, there's still some small hope that somebody in YouTube will get my feedback message and, uh, and have mercy on my mistake and bring the video back up.

  • But I just, um from what I read online, I don't think they do that.

  • I think at some point in the past, they used to do that kind of thing, But I don't I don't think they do it anymore.

  • So, um, we'll see.

  • Uh, it's all right.

  • So I'm just looking through, trying to find questions.

  • Just still a lot of people saying Hello.

  • Eso uh, All right.

  • So this is hello from Brazil.

  • Hey, as it going, um, someone print off says, how much money can we earn in react?

  • Native Depends on where you get a job from here in the United States.

  • React.

  • Native developer could most certainly get a job making over $100,000 a year.

  • It's definitely not uncommon for that to happen.

  • Different parts of the world are obviously very different.

  • Um, and you know, different companies pay differently, but it's It's certainly it's certainly possible to make to make that much, which, unless you're in like a very big city, that's that's an excellent salary.

  • Like from where I'm from.

  • There's not very many people that make that much money.

  • So, um, react native can make you a lot of money.

  • I was born in one of the poorest states in the United States, which United States that pretty wealthy countries.

  • So I guess it's it's not super poor, but it's just, you know, I don't really know that many people that made that much money when I was growing up, All right?

  • Awesome, actually.

  • Get through most of the questions.

  • Eso go back and do some work code.

  • Um, the last.

  • Another question just came in right when I said that, and it was ah, react native versus flutter who wins?

  • In your opinion, I, um I really can't comment on that because I haven't actually built anything with flutter, so I feel like I'm not in a good place to comment.

  • I really, like react native.

  • That can do a lot of things.

  • I've heard good things about flutter, but like I said, I can't.

  • I think you could build awesome things with react, native or flutter.

  • Obviously, if I had to choose something to build a project with right now, I choose react native, because that's what I use every day and I know it.

  • But if I didn't know either one, you know, I would definitely take a look at flutter and see.

  • You know, maybe I would Maybe I'll use it.

  • All right, so let's go back.

  • I'm gonna try setting my timer again, See if it works this time and, ah, let's go back in here.

  • And I want to submit and see what our styling looks like on the once.

  • We're, like, logged in in the log in view.

  • And also, I don't want to forget something to tell you.

  • All right, now, so you can remind me, um, the, uh um Red flash.

  • So we put in a style where, like, the screen would flash red if your focus got below a certain level that when you first start up the AC.

  • That red's is like the default color, so we don't want that to happen.

  • So I think I'd like to try to get rid of that as the default color.

  • So we'll take a look at our styles and see how we can do that, Um, but otherwise leads, Let's log in and let's see you have a password.

  • Cool.

  • All right, so one thing I'm seeing years, the focus text is quite small, and it's very close to this lug out button.

  • So I think what I'd like to do here is make this text a bit bigger and add a little space here between focus and log out.

  • Um, and that's probably about it in terms of styling made.

  • So I said, Well, it's not gonna look very like really pretty, but I wanted to look like it's not broken or anything like that.

  • And ah, let's see.

  • Um, I just keep losing my, uh, styles object.

  • Well, I guess we don't really.

  • We want to put a separate style on our focus text, so because I don't want it to be quite a CZ, big as they're heading, so style equals, Let's just I'm just gonna call it focus, Focus, text.

  • Probably not the best name, especially if we re use this style.

  • If we end up using it will rename it to something a little bit more generic.

  • But for now, I think that'll that'll work.

  • So let's say focus, text.

  • And but to make the phone size, let's give it 18.

  • Okay, there'll be nice, nice and big for readability.

  • But then also not definitely, uh, like, noticeably smaller than the heading.

  • And then let's give it, let's say 88 pixels on the bottom between the button and the focus sex.

  • So we're gonna do a margin bottom of eight.

  • I keep saying pixels, but when I say pixels that I have it.

  • But I really just mean like, units, right?

  • Whatever that translates to on a particular device.

  • Okay.

  • All right.

  • That's that's better.

  • A little bit of separation there.

  • We can see what the focus is, and, um, yeah, see, that was good.

  • The only other thing I want to do is, uh what do you think about this?

  • Focus.

  • Um, right now, the focus is a number between zero and one.

  • Do you think it would be easier for the user if they saw that as a percentage so set of 10.23 If they saw 23% do you think that would be easier?

  • Let me know what you will think in the chat.

  • Uh, it wouldn't be too hard to you.

  • Make that display as a percentage.

  • Um, and then it might be a little bit more obvious to say, like, I'm 100% focused normally.

  • 20% focus.

  • Uh, yeah.

  • Let me know what you think.

  • Looks like I got one.

  • Yes, for that night.

  • Okay.

  • Um, okay, we got a couple of yeses.

  • Cool.

  • Let's do it.

  • All right, so right now, we are showing the focus.

  • Here is just the raw data of focus.

  • Um, but what we could do is we could say, like, focus.

  • And we could multiply that by 100 and then we can add in a percentage sign and let's see.

  • See how that looks.

  • Cool.

  • 23%.

  • Not not too hard.

  • Um, I don't know why 23 keeps coming up.

  • Is the default?

  • I have no idea.

  • Maybe that's just the baseline that comes through.

  • Maybe that's the last value that came through before I turned my device off last time.

  • I don't know.

  • Um cool.

  • Now you notice we still are seeing that flash of red every time we, uh, we restart.

  • So let's look at our styles and see how we have that set up.

  • Uh, so it looks like we're saying, Ah, the background color.

  • We're saying if the focus is less than 0.2 or 20% and we have a user then display read otherwise display white.

  • Now, I don't know if this will work, but it's it's possible that if we just switched these around, maybe it would read the white first.

  • And we should be able to do that if we just say, um, if the focus is greater, would just flip around these values greater than 0.2 and we don't have a user.

  • Then let's display white.

  • Otherwise, red.

  • I don't know if this is gonna solve our problem, but if there's some sort of solution that might work and it's very easy to try, I'm always up for trying it.

  • Uh huh.

  • And no, that did not work at all.

  • Good.

  • That is, in fact, the opposite of what we wanted.

  • How Did I get the opposite?

  • Um, let's see.

  • And Ah, sorry.

  • I got somebody is trying to say Not nice stuff.

  • So, um, it's gonna hide the messages.

  • Um, okay.

  • All right.

  • So that definitely didn't work.

  • And, uh, let's see.

  • But look, so you got somebody else's spamming a lot of messages.

  • So, um, there we go.

  • All right?

  • There to clean up the chat a little bit.

  • Sorry about that.

  • Okay.

  • All right.

  • What the heck did I do here?

  • Well, let's go.

  • Let's just go back.

  • Because that's not what we wanted.

  • Area.

  • All right, Should That's better, huh?

  • Let me see.

  • I'm gonna check the chat as well to see if any of you realize what my mistake was.

  • See a J say, Hey, J, how's it going?

  • Uh, a J is one of the, um, cofounders of generosity.

  • And who made this, uh, this device.

  • So the, uh, notion headset.

  • Um, hey, this is last value.

  • Is that what I I don't know if he was referring to what I was doing here or commenting on somebody else.

  • Okay.

  • Um, all right.

  • Let's let me think for a second on how we could make that work.

  • I'd rather try to avoid the flash of red if we could, but it's not like I absolutely have to have.

  • I see.

  • So, huh, Actually, if I reverse these colors and we get a flash flash a white, maybe it would be Oh, now I know why I did that.

  • Because I said, if we we don't have a user No, I confused myself.

  • All right, let's go back to what I did before, so I know for sure.

  • I want focus.

  • If focus is greater, then point to I wanted to be white for sure.

  • Uh, you focussed greater than 0.2.

  • I wanted to be white.

  • It's curated.

  • This your second, right?

  • And sweatshirt.

  • Yeah, that's which.

  • So folks created a point you wanted to you white.

  • And then if User All right.

  • All right.

  • This is a slightly more complicated thing, but let's see if it works.

  • Uh, we still have the flash.

  • Let's see if it'll happen for saving it with this up.

  • Hoops Kofi saved.

  • All right?

  • Actually didn't happen.

  • Let me actually change something and then we'll see.

  • I was still getting that Flasher red.

  • I guess it doesn't matter.

  • Uh, now What this does is I just kind of split it up and added to kind of like to turn areas.

  • So, um, it's saying like if the focus is greater than 0.2, then we just make it white.

  • But if it's not, then we go to the the right side of our turn ery and then we check and see.

  • Is there a user?

  • Um, if there is no user us, there's no user.

  • Then we do nothing.

  • Which would make the default color.

  • Um, I guess nothing.

  • It would be whatever the default normally is, Um, which I'm assuming is just white.

  • Or it would be red.

  • I wonder if we even need to add White, like, what's hard to fault without it.

  • But, um, let's say that, All right, Cool.

  • Yes.

  • So we don't really even need white.

  • So I'm thinking we could we could get rid of the white all together so we don't need it.

  • And instead, we could do these hands.

  • We'll switch the focus back to it focuses less than all right.

  • We're still getting our, um our flash of red that I don't want but were ableto get rid of our white we don't need it.

  • Uh, see, what we do have what we could try to do instead is Let's try this out.

  • Uh, well, first, I'm gonna look at the chat and see if anybody has an idea.

  • All right?

  • Looks like No, but, uh, here's what I'm thinking.

  • You could let me know what you think about this idea.

  • What if we take out all of this logic from here and instead in this use effect which are already using to turn on and off the vibration?

  • We use this to change the color on dumb weaken.

  • Set the color as part of ST Oh, I think it's worth a try.

  • In which case, let's go up here.

  • Forget anymore, State.

  • We might have to clean this up a little bit, but for now, I think this will be should be fine.

  • We can, Yeah.

  • Let's clean this up here and let's say, um say B g color set, background color, and we're going to go use states and the default background color is gonna be white.

  • And let's see, but you some type shipped stuff here.

  • I think we can say amusing typescript.

  • But as somebody pointed out to me in the comments.

  • It's a typescript project, but I'm not actually using types.

  • So let's see if we can, uh, used types here.

  • So what this is doing?

  • Let's see if it actually is doing this yet.

  • So right now we're basically using type Skip to say, Ex con's on Lee.

  • Be whiter, red.

  • We could add more if we wanted, but for right now, this could only be white or red, and it's gonna give us some cool auto complete stuff which check it out down here.

  • So weaken, set the background set B g color.

  • And now we're going to say we can either do white or red.

  • There's our options.

  • So let's throw in the option of Red and then we gotta set it back the other way, right?

  • So if we're not, if we are focused, if we regain a certain level of focus, let's reset this too.

  • Wait, Cool.

  • Now, down here, we can just set our background color to be G color.

  • So if this works, let's see if it works first.

  • If it does, I think I kind of like that better because all the actions that happen win terms of a shift in focus are all located in one place.

  • And then we keep logic out of our styles.

  • It looks a little bit cleaner.

  • And I totally forgot to look to see if this even changed.

  • Did anything, uh, see sweet?

  • We got rid of that flash.

  • Now we just have to see, like, did it actually work?

  • So I'm gonna turn on the headset, and I got it.

  • Give it a second to turn on and connect it.

  • It's starting up.

  • Takes just a couple seconds to start up.

  • Once it starts up, I'm gonna put it on and see if we can get that focus down lower.

  • Actually, if it's stuck a 23 we can probably change it.

  • Let's just let's cheat and just change it.

  • Radio.

  • Hey, cool.

  • So we get red, and if this was a mobile device, it would be vibrating.

  • Now let's switch it back and we get Wait.

  • Cool.

  • So now the color Is that all right?

  • And then the notion is, uh, it's starting up so I can see all my other screen.

  • I've got a dash word up.

  • It's starting the operating system on the headset, so it should be something pretty soon, and there's a lot going on in the chat.

  • So, uh, I'm gonna get back to that in a few minutes.

  • Here?

  • Yeah, About five minutes.

  • I'm gonna get back to the chat.

  • All right.

  • That's cool.

  • Um, let's clean this up a little bit.

  • So its user so set user else.

  • Um, let's get rid of this l since we're not doing anything there, And if I think that was the only spot where we had unused code.

  • All right, cool.

  • So we're connected now.

  • I'll put this on for a little bit so we can get some real data.

  • Okay, Cool.

  • So we should be getting real data here.

  • Uh, I've got ah.

  • Okay.

  • Signal coming in.

  • Oh, goodness.

  • All right.

  • I just noticed something I don't if you caught that on the screen, but we got a ton of decimal places out here, so I don't want all those decimal places.

  • So let's let's make sure that we don't We don't have that.

  • And, um, actually, that was kind of weird.

  • That even came on the screen because we do have this to fixed too.

  • That's on.

  • So said focus the number We're putting into focus is actually already with to fix.

  • So, you know, it came up again.

  • Very weird.

  • Which I kind of don't want to show a bunch of decimal places anyway, so let's just go ahead and, uh, at were yet this focus.

  • Um, that's good, huh?

  • To fixed.

  • You know, maybe when we're multiplying, it's it's messing it up.

  • And let's just see, can we do to fig zero?

  • Is that gonna mess it up?

  • Number to fix returns?

  • A string representing a number.

  • Interesting.

  • Let's see if we can hopes.

  • Not on the end.

  • Put that in the wrong spot.

  • There you go to fix, See if that works.

  • All right?

  • No, we may or may not see that that number pop up, but I'm thinking that since we're doing this after any calculation takes place, then we'll actually get to fix zero, Which means we will have no decimal places.

  • Yeah, so that was cool.

  • I'm glad I put the head.

  • So see that that particular bug?

  • Ah, the auto formatting on that.

  • It's a little weird, but cool.

  • All right, So and my I only got, like, another minute before I wanted to stop and go back to the channel.

  • Um, what I wanted to do next.

  • If I had time, we'll start to get this ready.

  • Thio to go to the app store s.

  • Oh, what I'm gonna do is just kind of go through what we need said let's go to, uh, Expo and see you get started.

  • You predict documentation?

  • That's what I want So amusing Expo toe Help us build this reactor Native app s o we they have documentation for Let's see, So some of the stuff that we haven't done yet is like this splash screen eso It's just something that will show up in the app and so we could add this into our app and AP icon So we got to think about what we want to do for the app icon.

  • I'm I'm really any good with any type of like photo or image editing stuff, so I'll probably just find something online that, like, automatically creates all the icon sizes that we need.

  • Um, that'll be, uh, see what it is.

  • And there's there was some documentation that talked about actually releasing stuff to the APP store.

  • Oh, no way it would Publisher at publish So there's a couple options we could do with Publish.

  • Um, we could publish through ah, through expo or could publish, um, like, on my own server.

  • So I haven't decided what I want to do, so that would be the first step, and then we would actually deploy.

  • So I'm gonna skip the apple store.

  • For now.

  • We're gonna goto Android in the Google play store, and, uh, this is the next step of what we need to do.

  • So we basically are gonna run an expo command, and, um, it's gonna bundle everything for us.

  • So we just need to make sure that we have our Abdel Jason file sorted out on it has the right info in there, and then I already have an account for the Google play store.

  • So we should submit it like if we get the bundle right, then we can submit it.

  • And, um, it says we can do it manually.

  • Um, and then we can actually just uploaded straight from command line, which is pretty sweet once we do it manually the first time.

  • And I'll try to do as much as possible with this on a live stream.

  • I know how to do it today because I've been screaming already for over an hour, but the next dream, this is what we're going to be working on.

  • Uh, I don't know how long it'll take to get approved, but I mean, I'll let everybody know once it gets gets approved, but basically, that's these are the next steps that we're going to do.

  • And, um, really, I think the hardest part at this point is just making sure that our app that Jason is looking good and figuring out what I want my app icon to be because I I really have no idea.

  • Um but I'll show you right now.

  • What are apt Dodge?

  • A son looks like.

  • So, um, right now, it's just whatever was the default, which it takes the name from Mukden name I put in when I started the project.

  • Right.

  • So, um, I believe the icon is like the Default Expo icon in the same way, with a splash so we can see that this icon is just the default.

  • The cost of the project is blank.

  • Same thing with the splash.

  • No, rather not have nothing there, but at least like there's something there, right?

  • It wouldn't It wouldn't throw on air saying it's nothing there.

  • Um, so, yeah, that's that's about it.

  • Not really.

  • Not much else left to do.

  • Uh, you actually deploy this.

  • So now, having said that, the only people that are really gonna be able to use this, you know, anybody that has one of these headsets, I mean, anybody could download it, but they're not gonna be able to get the brain data.

  • Right.

  • So, um, it will be a very, very limited audience.

  • And, uh, after that, there's other features I'd liketo add to this, and I'd like to have it a Web version in an IOS version.

  • So those are the next steps?

  • For now, I'm gonna go back to the chat and answer the rest of the questions and Ah, see, I guess so.

  • I'm going to keep keep tracking my focus here.

  • Well, way while I answer questions.

  • All right, let's see.

  • We'll figure out where I left off it.

  • Uh, Let's see.

  • Um, finding uses.

  • Can you tell me the prerequisite of this course?

  • Um, I don't really know.

  • Like what, Thea, um prerequisites would be like it would definitely help if you know, a little bit about, um, react Native, Uh, I guess other than that, you know, we don't really need to know much in terms of, like the brain computer interface.

  • Like it's it just It has a job, a script, a p I.

  • So you don't need to know a lot about the internal workings of what's happening.

  • Let's see, uh, question says, Do you have a cat?

  • I do not have a cat.

  • No, have four Children and ah, no cat.

  • I have the only pets that I have an hour to goldfish there behind me.

  • That's it.

  • There's a lot going on in the chat, but not a lot of questions.

  • Uh, Jenna phone questions.

  • All right, so there's some some questions and comments based on the that red screen that kept coming up where?

  • When we didn't want it to.

  • So thank you for all the advice on there.

  • Uh, Amina.

  • So what's the haps purpose?

  • The purpose is to, ah let let the user know when their focus is dropped below a certain level.

  • It's crazy.

  • You can see how much like trying to go through the questions and, like move back and forth lowers my focus.

  • Normally, if I'm just coating my focus is a lot higher than this.

  • But more consistently, but trying to talk and read the chat, Uh, really, like, I guess, Like, divert my attention. 01:08:05.250 --> 01:08

Hey, everybody, welcome to live coating with Jesse.

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

A2 初級

React Nativeを使って脳内コンピュータアプリを構築する(パート4) - Jesseとのライブコーディング (Build a Brain Computer App with React Native (Part 4) - Live Coding with Jesse)

  • 3 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語