Splash Activity - (b). Write Code

9 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$15
List Price:  $69.99
You save:  $54.99
€14.02
List Price:  €65.44
You save:  €51.41
£12.01
List Price:  £56.04
You save:  £44.03
CA$20.52
List Price:  CA$95.74
You save:  CA$75.22
A$22.95
List Price:  A$107.11
You save:  A$84.15
S$20.43
List Price:  S$95.36
You save:  S$74.92
HK$117.42
List Price:  HK$547.90
You save:  HK$430.48
CHF 13.72
List Price:  CHF 64.03
You save:  CHF 50.30
NOK kr165.58
List Price:  NOK kr772.60
You save:  NOK kr607.02
DKK kr104.56
List Price:  DKK kr487.88
You save:  DKK kr383.32
NZ$25.25
List Price:  NZ$117.84
You save:  NZ$92.59
د.إ55.09
List Price:  د.إ257.06
You save:  د.إ201.97
৳1,650.32
List Price:  ৳7,700.43
You save:  ৳6,050.10
₹1,251.03
List Price:  ₹5,837.33
You save:  ₹4,586.30
RM71.54
List Price:  RM333.81
You save:  RM262.27
₦19,822.11
List Price:  ₦92,489.99
You save:  ₦72,667.87
₨4,173.67
List Price:  ₨19,474.37
You save:  ₨15,300.69
฿554.78
List Price:  ฿2,588.61
You save:  ฿2,033.83
₺487.61
List Price:  ₺2,275.23
You save:  ₺1,787.61
B$76.74
List Price:  B$358.08
You save:  B$281.34
R281.39
List Price:  R1,312.98
You save:  R1,031.59
Лв27.41
List Price:  Лв127.91
You save:  Лв100.49
₩20,671.32
List Price:  ₩96,452.39
You save:  ₩75,781.06
₪57.37
List Price:  ₪267.73
You save:  ₪210.35
₱864.69
List Price:  ₱4,034.64
You save:  ₱3,169.95
¥2,371.42
List Price:  ¥11,065.06
You save:  ¥8,693.64
MX$257.40
List Price:  MX$1,201.03
You save:  MX$943.63
QR54.66
List Price:  QR255.05
You save:  QR200.39
P206.98
List Price:  P965.79
You save:  P758.80
KSh1,992.33
List Price:  KSh9,296.24
You save:  KSh7,303.91
E£717.92
List Price:  E£3,349.82
You save:  E£2,631.90
ብር854.07
List Price:  ብር3,985.10
You save:  ብር3,131.02
Kz12,510.90
List Price:  Kz58,375.85
You save:  Kz45,864.95
CLP$14,225.40
List Price:  CLP$66,375.71
You save:  CLP$52,150.31
CN¥108.68
List Price:  CN¥507.11
You save:  CN¥398.43
RD$881.51
List Price:  RD$4,113.13
You save:  RD$3,231.62
DA2,012.97
List Price:  DA9,392.53
You save:  DA7,379.55
FJ$33.93
List Price:  FJ$158.35
You save:  FJ$124.41
Q116.60
List Price:  Q544.06
You save:  Q427.46
GY$3,145.91
List Price:  GY$14,678.83
You save:  GY$11,532.91
ISK kr2,108.40
List Price:  ISK kr9,837.79
You save:  ISK kr7,729.39
DH151.89
List Price:  DH708.72
You save:  DH556.83
L267.20
List Price:  L1,246.75
You save:  L979.55
ден862.65
List Price:  ден4,025.16
You save:  ден3,162.50
MOP$121.25
List Price:  MOP$565.76
You save:  MOP$444.51
N$287.23
List Price:  N$1,340.22
You save:  N$1,052.99
C$553.38
List Price:  C$2,582.07
You save:  C$2,028.69
रु2,004.71
List Price:  रु9,353.99
You save:  रु7,349.28
S/56.48
List Price:  S/263.57
You save:  S/207.08
K58.04
List Price:  K270.82
You save:  K212.78
SAR56.25
List Price:  SAR262.50
You save:  SAR206.24
ZK398.48
List Price:  ZK1,859.31
You save:  ZK1,460.83
L69.85
List Price:  L325.94
You save:  L256.08
Kč352.42
List Price:  Kč1,644.39
You save:  Kč1,291.97
Ft5,512.35
List Price:  Ft25,720.62
You save:  Ft20,208.27
SEK kr163.33
List Price:  SEK kr762.14
You save:  SEK kr598.80
ARS$13,110.66
List Price:  ARS$61,174.36
You save:  ARS$48,063.69
Bs104.28
List Price:  Bs486.59
You save:  Bs382.30
COP$59,478.98
List Price:  COP$277,528.94
You save:  COP$218,049.96
₡7,538.14
List Price:  ₡35,172.98
You save:  ₡27,634.84
L371.31
List Price:  L1,732.56
You save:  L1,361.24
₲111,628.32
List Price:  ₲520,857.74
You save:  ₲409,229.42
$U579.37
List Price:  $U2,703.34
You save:  $U2,123.97
zł60.51
List Price:  zł282.38
You save:  zł221.86
Already have an account? Log In

Transcript

Okay, so this is no time we'll come over to our user interface. And the noise interface, we're going to work with several activities. We're going to have a splash activity, that is activity, crud activity, as well as the current activity. So we'll start with the splash activity. Now, what's the rollover screen? Well, of course, normally is a splash screen, if you want to, especially show you a brand for example, your logo, okay, your total your subtitle for your company, you can show it, even the splash screen now.

However, it's important to know that splash screen is normally optional, and also consistent with the amount of pain that is pressure to be shown. Okay? So, we're also going to use it for something very important in the truth easy to preload our data is okay. We're not just going to show it for aesthetic purposes, but to reach to preload our galleries in memory, such as That will never get over to there is activity or data is already pre loaded. So just filter them down okay. So we'll start here by writing our inputs.

So an important content and context input hundred is the vendor input important to view returning mission returning mission. The portal to view returning mission returning mission is important to jet image view the input anchored to jet the text view then input anchor text the top top productivity then input anxiolytics equal the consumer group providers input info composure personal then personal data in common cache manager then pasilla Gary Coleman the tutors Then personal diary, view model diary model, then I will be GitHub the confession x Did you pump the fuel pump context proper public class splash activity extents appcompat activity. So our first task will be to define of course the widgets that we're going to render in our special activity, then M is inclined view by ID. So, I was pressed Springfield's private image view m logo, then private text view, main character as the separator, the private void initialize widgets, then m logo equal to find view by ID or detected m logo, the main character are the ID two main character, then subtitle Undertaker subtitle so The next method we're going to create is a method that is going to allow us to navigate over to a dish to our next activity, okay?

Which is our various activity after a specific number of seconds or milliseconds, okay? So, this will go to sleep a thread for like around half a second, okay? And you can change that number before proceeding over to our database activity. So, this method is optional, okay, so you can exclude it from your project. So we're going to go over to our database activity after one second but half a second. So privately proceed, thread t equal to new thread the actual read public void from then try then sleep 500 milliseconds, then you tell the top 10 activity, pressure activity to do As a context, and then there is activity did class as a credit activity, then finished the current activity, then so production, we're going to catch any truck and exception he stopped this then to start to start on a thread, okay where the next method we're going to create is going to allow us to actually preload our data to be able to pull other berries and hold it in memory.

So we're going to be there calculating hospice screen. And this is going to save us some time because when these is navigating over to the receptivity, will have already pre loaded our data. So come on, say private void clear data, Gary to model that model equal to form a group project dusted off, this didn't get the review model class, the entire review more group get the data to solve this then there is the if there is not equal to null, and there is it says, zero, then cache manager or memory cache equal to Doris, in cache manager to Darris, dirty equal to first, then proceed. Okay, so you can see we're using the view model providers to clean up the view model instance. Then, you know, a mutable live data by calling design. Then of course, we register the observer using the observer method, the observer is this richer, okay?

And then we're going to be given it this will return for us. Our dad is richer, so check if it's not quote and then we'll go To add it to a cache Okay, all there is memory cache right there. Okay, then proceed to the next activity. Okay so private void shows pression emission in an emission, but from topical to an emission here's the corrode and emission. Then these are named top to bottom, then m logo. Let's start on emission, stop and emission 15 equal to an emission enters the payload and emission is the Africa unlimited in the main title will start on a mission fit in then some Tater let's start a new mission for doing this.

That pervert Doris Okay, so this is how we're showing our special mission feature. We first learn the new mission to define when define new missions. Top to bottom as well as fading, who can actually find them in the morning, just in our resources. So if we go over to the earning folder in our resources, we can see we have several animations filled in as well as the top to become so these are the ones that were using culture okay. So, we apply for doing a search filled in animations to a main character as the sub character. Then they go from Top Gun to preach to our vocal, okay.

Then once you've done that and then pre loaded So, activate, then attach this context context to this. Then super touch base context, flow pump context for the new business, then activate, protected preferred credit, then Bangor saved instance state, then superbrat on credit second step, then set content view our cloud activities fresh, then this debt initial is widgets, then this shows pressure on emotion and transit. Okay, so you can see here we've just overridden two methods. The first one is going to allow us to pump Of course often SoftLayer funds in this activity, the custom from the tracing Of course, using our cryptography library. The second method, of course, is a classical equipment which is invoked when activities created, okay. So we just invoke these two methods.

So this, this is it. This is our show our splash activity. So this is a creature let's proceed To the next part

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.