Cov txheej txheem:

Android App Part 1: Splash Screen Siv Fragments/Kotlin: 5 Kauj Ruam
Android App Part 1: Splash Screen Siv Fragments/Kotlin: 5 Kauj Ruam

Video: Android App Part 1: Splash Screen Siv Fragments/Kotlin: 5 Kauj Ruam

Video: Android App Part 1: Splash Screen Siv Fragments/Kotlin: 5 Kauj Ruam
Video: Fragments Implementation using Kotlin || Fragments using Kotlin || Android Studio Tutorial || 2023 2024, Kaum ib hlis
Anonim
Image
Image
Fragment Manager thiab 3 Screens
Fragment Manager thiab 3 Screens

Nyob zoo dua, feem ntau koj yuav muaj qee lub sijhawm "dawb" nyob hauv tsev vim yog COVID19 thiab koj tuaj yeem rov qab mus tshawb xyuas cov ncauj lus koj xav kawm yav dhau los.

Kev txhim kho Android App yog ib qho ntawm lawv rau kuv thiab kuv tau txiav txim siab ob peb lub lis piam dhau los los sim zaum ob.

Qhov kev zov me nyuam hauv Kotlin twv yuav raug hu txo qhov kev siv zog ntawm kev sau npe thiab pab ua kom tiav cov txiaj ntsig hauv lub sijhawm luv luv. Nws yog Qhov Zoo Tshaj Plaws!

Hauv kab ntawv qhia no, kuv yuav piav qhia yuav txhim kho Tennis Score Tracker li cas. App no tuaj yeem siv thaum koj ua si nrog phooj ywg thiab/lossis tsev neeg (koj tuaj yeem muab lub ntsiav tshuaj rau koj tus menyuam thiab ua rau nws tsis khoom:)). Cov App no yog ua raws li Kotlin Counter piv txwv.

Cov ntawv qhia muaj cov hauv qab no:

Ntu 1: Splash Screen siv Fragments (peb nyob ntawm no tam sim no)

Ntu 2: Match Configuration - Properties

Ntu 3: Match Score tracker

Lub tswv yim tseem ceeb yog txhawm rau faib cov app hauv 3 cov ntxaij vab tshaus txhua tus ntawm lawv yuav hu rau tom ntej no, ib zaug ua tiav lossis thaum tus neeg siv nias lub khawm sib xws.

Hauv thawj ntu no, Kuv yuav piav qhia yuav ua li cas thiaj tsim tau lub vijtsam nkag -> txheeb xyuas cov vis dis aus saum toj no.

Khoom siv

Nta Android siv hauv Tshooj Lus no:

  • Fragments
  • Animation
  • Kev co
  • Media Player
  • Mloog

Yuav tsum tau cov cuab yeej:

  • Hauv Studio
  • Kotlin 1.3.61
  • API qib 28

Cov Khoom Yuav Tsum Tau

Ib cov ntaub ntawv suab beep

Kauj Ruam 1: Tus Neeg Siv Tsim Tsim

Cia peb piav qhia cov yam ntxwv ntawm peb qhov Intro screen.

  1. peb xav kom muaj lub vijtsam puv xim dawb
  2. peb xav kom muaj lub vijtsam ib txwm nyob hauv hom toj roob hauv pes
  3. peb xav tau peb lub logo-ntawv xim nyob rau hauv grey
  4. peb xav tau peb lub pob xim hauv tones ntsuab
  5. peb xav kom peb lub logo-text ploj mus
  6. peb xav tau lub pob ntaus pob tesniv txav hauv lub vijtsam (ntaus pob)
  7. peb xav ua suab nrov txhua lub sij hawm lub pob nphav saum npoo av
  8. peb xav ua lub xov tooj kev co thaum lub suab ua si
  9. peb xav kom lub sijhawm qhia tawm tsawg dua 4s.

Kauj Ruam 2: Tus Thawj Saib Xyuas Fragment thiab 3 Cov Vijtsam

Fragment Manager thiab 3 Screens
Fragment Manager thiab 3 Screens

Cia peb nco qab lub tswv yim tseem ceeb ntawm peb App, peb xav kom muaj 3 cov ntxaij vab tshaus (Intro, Properties and Match Score). Rau qhov no peb yuav siv Fragments. Yog li peb xav tau 3 ntawm lawv ib qho rau txhua lub vijtsam. Xa mus rau thawj cov ntawv qhia me me.

Hauv qhov thib ob, peb tuaj yeem pom yuav ua li cas peb hu peb thawj ntu. Splash fragment yog qhov yuav siv rau peb Intro.

Kauj ruam 3: App thiab Intro Screen Layout

App thiab Intro Screen Layout
App thiab Intro Screen Layout
App thiab Intro Screen Layout
App thiab Intro Screen Layout
App thiab Intro Screen Layout
App thiab Intro Screen Layout
  • Txhawm rau txhim kho txoj haujlwm ntawm lub vijtsam thiab tsis quav ntsej ib qho kev hloov pauv ntawm lub xov tooj, peb yuav tsum ntxiv cov lej hauv qab no Daim Duab 1 hauv AndroidManifest.xml.
  • Txhawm rau tshem tawm Action Bar los ntawm txhua cov ntxaij vab tshaus, peb yuav tsum ntxiv cov lej hauv qab daim duab 2 hauv style.xml
  • Txhawm rau thawb lub vijtsam hauv txhua lub vijtsam, peb yuav tsum teeb tsa tus chij raws li hauv daim duab 3 ntawm 2 txoj kev sib txawv. Oncreate () thiab onWindowFocusChanged.

Kauj Ruam 4: Txheeb Logo thiab Pob Syles

Txhais Logo thiab Pob Syles
Txhais Logo thiab Pob Syles
Txhais Logo thiab Pob Syles
Txhais Logo thiab Pob Syles
  • peb tau txhais ua ntej peb cov ntawv ua grey, qhov no tau ua tiav hauv cov ntaub ntawv style.xml. Xa mus rau Pic 1.
  • peb tau txhais zoo ib yam tias lub pob yuav tsum nyob hauv lub suab ntsuab. Rau qhov no, peb tsim ball.xml hauv qab daim nplaub tshev. Kos Duab 2

Kauj Ruam 5: Kev piav qhia cov duab

Kuv yuav piav qhia ntawm no cov laj thawj thiab ua ntu zus ntawm cov yeeb yaj kiab. Kuv xav tias nws tsis muaj qhov nkag siab ntxiv cov code snippets ntawm no, zoo dua koj mus hla txoj cai koj tus kheej.

Lub tswv yim ntawm cov animation yog raws li hauv qab no:

  • Tom qab cov ntawv tawg tau tsim, cov ntawv logo tau tsim thiab pib
  • Thaum ua tiav cov ntawv logo cov duab ua kom tiav, ntaus pob tesniv thawj qhov kev txav mus los tau thov
  • Thaum thawj qhov kev txav mus los parabolic tau ua tiav, lub suab tau ua thiab lub xov tooj vibrates.. thiab tom ntej parabolic txav tau thov
  • Thaum qhov kev txav mus los zaum kawg tau ua tiav thiab suab/kev vibration tau ua tiav peb mus txog qhov chaw hu rau peb lub vijtsam thib ob.

Nco tseg: Kuv tsis tau tsim chav kawm paub daws teeb rau kev ua yeeb yaj kiab, vim tias kuv xav ua kom txoj cai tiaj tus … yooj yim ua raws tsawg kawg rau kuv:)

Kuv yuav tshaj tawm ntu thib ob ntawm kab ntawv nyob rau hnub tom ntej, ua raws kuv yog tias koj nyiam ntu no thiab yog tias tsis yog, Kuv yuav zoo siab tau txais koj cov lus tawm tswv yim.

Pom zoo: