Newsletter
REAL HACKER NEWS
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO
No Result
View All Result
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO
No Result
View All Result
REAL HACKER NEWS
No Result
View All Result
Home APPLICATIONS

CompositionLocal in Jetpack Compose | Kodeco, the new raywenderlich.com

Real Hacker Staff by Real Hacker Staff
November 16, 2022
in APPLICATIONS
0
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


Find out about CompositionLocal in Jetpack Compose and implement an environment friendly approach for a number of composables to entry information.

Jetpack Compose permits you to create UIs on your app utilizing Kotlin. It really works by passing information to every UI element — aka composable — to show its state.

However when you’ve gotten a number of composables in your UI that use the identical information or courses, passing them down can rapidly lead to messy and sophisticated code.

That’s why Android gives CompositionLocal. It helps you present courses to a set of composables implicitly, so your code will be easier and easier.

On this tutorial, you’ll improve the UI of a studying record app and be taught all about:

  • How Jetpack Compose structure works.
  • What CompositionLocal is and its differing types.
  • Predefined CompositionLocals accessible to you.
  • Methods to create your personal CompositionLocal.
  • When to make use of CompositionLocal.
  • Alternate options to CompositionLocal.

Getting Began

Obtain the undertaking app by clicking Obtain Supplies on the prime or backside of this tutorial. Open Android Studio Chimpmunk or later and import the starter undertaking.

You’ll construct an app known as ToReadList, which helps you to seek for books and add them to a studying record.

Beneath is a abstract of what every package deal comprises:

  • di: Lessons for offering dependency injection.
  • fashions: Mannequin definitions used within the app.
  • community: Lessons associated to the reference to the API.
  • repositories: Repository-related code.
  • storage: Lessons that deal with the native storage.
  • ui: Composables and theme definition.
  • viewmodels: ViewModel courses.

This pattern app makes use of the OpenLibrary API. You don’t must do any preliminary configuration as a result of OpenLibrary doesn’t require an API key. Be taught extra about OpenLibrary on openlibrary.org.

Construct and run the app. You’ll see an empty display screen with a search floating motion button:

If you happen to press the search FAB you’ll discover that it doesn’t work, which is intentional.

You needed to study CompositionLocal, proper? Nice! You’ll construct out the lacking performance on this tutorial.

Introduction to Jetpack Compose Structure

The times while you needed to cope with the previous View system to create UIs on your Android apps are fortunately previously. With Jetpack Compose, you may create UIs utilizing Kotlin — it’s sooner and simpler.

Nonetheless, the best way Jetpack Compose works is totally completely different than the way it labored with Views.

For instance, as soon as the UI finishes displaying on the display screen, there is no such thing as a option to replace it in Compose. As an alternative, you replace the UI state.

When you set the brand new state, a recomposition — the method that recreates the UI with the brand new state – takes place.

Recomposition is environment friendly and targeted. It solely recreates UI parts which have a unique state and preserves the parts that don’t want to vary.

However how can a composable find out about its state and its modifications? That is the place unidirectional information movement comes into play.

Understanding Unidirectional Knowledge Stream

Unidirectional information movement is the sample that Jetpack Compose makes use of to propagate state to the completely different UI composables. It says that the state flows all the way down to the composables and occasions movement up.

In different phrases, the state passes from one composable to a different till it reaches the innermost composable.

However, every composable notifies its caller each time an occasion takes place. Occasions embrace issues like clicking a button or updating the content material on an edit textual content discipline.

Unidirectional data flow

Implementing Unidirectional Knowledge Stream

At current, the FAB composable doesn’t know in regards to the navigation controller, so it will probably’t carry out navigation to the search display screen. You’ll add performance to the search Floating Motion Button (FAB) as a way to find out how unidirectional information movement works.

Open MainActivity.kt, the category the place the UI tree begins. It additionally comprises the definition for navController. It’s essential cross down navController in order that it reaches the search FAB.

Replace the decision to BookListScreen() as follows:


BookListScreen(books, navController)

That’s the way you cross the navController all the way down to the BookListScreen. Nonetheless, the strategy name will present a compiler error as a result of the parameter is lacking from the operate definition. You’ll repair that subsequent.

Open BookListScreen.kt then replace the composable parameters as follows:


@Composable
enjoyable BookListScreen(
  books: Listing<Ebook>,
  navController: NavHostController
)

You may see the NavHostController in crimson — that can vanish when you import the required class with this:


import androidx.navigation.NavHostController

BookListScreen() now is ready to obtain the navController. Lastly, replace the FloatingActionButton onClick, like this:


FloatingActionButton(onClick = { navController.navigate("search") }) {
  Icon(
    imageVector = Icons.Stuffed.Search,
    contentDescription = "Search"
  )
}

This code makes it in order that while you press the FloatingActionButton, you navigate to the search display screen.

Construct and run. Faucet the search FAB to navigate to the search display screen, like this:

Search screen

Seek for any e-book or writer you wish to see an inventory of outcomes:

Search results

Now you’re capable of seek for books and add them to your to-read record. Faucet a number of Add to Listing buttons so as to add some books to your studying record.

For now, you received’t get any suggestions to verify you’ve added a e-book to your record, however you’ll add that characteristic later.

Navigate again to see all of the studying you should do:

My to read list

Nice job, the fundamental capabilities are working now!

However the design is a bit off for the e-book parts — you get no affirmation after including a e-book and there are not any photos. How are you going to decide a e-book by its cowl when it doesn’t even have one?

Thankfully, you’ve gotten information that each composable can use, resembling context, navController and kinds. You’ll add these UX-improving options within the following sections.

Attending to Know CompositionLocal

As you noticed within the earlier part, information flows down by way of the completely different composables — every mum or dad passes down the required information to their youngsters. So every composable is aware of explicitly which dependencies it wants.

That is notably helpful for information utilized by a selected composable that isn’t used elsewhere.

There are occasions while you need to use information in a number of composables alongside the UI tree. If you happen to comply with the concept that information flows down, then you definately would wish to cross the identical information alongside all composables, which can change into inconvenient.

With CompositionLocal, you may create objects which can be accessible all through the UI tree or only a subset of it. You don’t must cross down the information alongside all composables, so your information is implicitly accessible for the composables to make use of.

You can even change the values of a CompositionLocal to be completely different for a subset of the UI tree, making that implementation accessible solely to the descendants in that subtree. The opposite nodes is not going to be affected.

Beneath is a diagram that represents the UI tree. Right here’s a proof of it:

  • The crimson part is a CompositionLocal implementation.
  • The blue part represents a unique implementation for a similar CompositionLocal.
  • Every implementation is barely accessible to the composables within the subtree the place you outlined every implementation.

Understanding CompositionLocal using UI tree

You may create your personal CompositionLocal however don’t must. Android and Jetpack give you a number of choices.

Studying About Predefined CompositionLocals

Jetpack Compose gives a number of predefined CompositionLocal implementations that begin with the phrase Native, so it’s simple so that you can discover them:

Predefined composition locals

Utilizing Current CompositionLocals

For this train, you’ll add a e-book picture to every e-book in your studying record through the use of the present context.

Open Ebook.kt. Add the next as the primary line within the BookRow() composable:


val context = LocalContext.present

Android gives the LocalContext class that has entry to the present context. To get the precise worth of the context, and another CompositionLocal, you entry its present property.

Make the next code the primary component of Row(), proper earlier than Column().


AsyncImage(
  modifier = Modifier
    .width(120.dp)
    .padding(finish = 8.dp),
  mannequin = ImageRequest
    .Builder(context)
    .information(e-book.coverUrl)
    .error(context.getDrawable(R.drawable.error_cover))
    .construct(),
  contentScale = ContentScale.Crop,
  contentDescription = e-book.title
)

This code provides and masses a picture to every e-book row utilizing the Coil library. It makes use of the context supplied by LocalContext.

Construct and run. Now you may see these covers:

Books with images

Subsequent, you’ll use a Toast message to provide suggestions everytime you add a e-book to the record.

Open Ebook.kt and exchange the Button code on the finish of BookRow() composable with the next:


Button(
  onClick = {
    onAddToList(e-book)
    Toast.makeText(context, "Added to record", Toast.LENGTH_SHORT).present()
  },
  modifier = Modifier.fillMaxWidth()
) {
  Textual content(textual content = "Add to Listing")
}

This code shows the Toast message through the use of the context that you simply obtained beforehand with LocalContext.present. You didn’t must cross the context all the way down to this composable to make use of it.

Construct and run. Add a e-book to your studying record. Discover the Toast:

Toast when adding a book

Did you discover the keyboard stays on display screen after you seek for books within the search display screen? You’ll repair that subsequent!

Dismissing the Keyboard

Android gives LocalSoftwareKeyboardController that you need to use to cover the gentle keyboard when wanted.

Open SearchScreen.kt and add the next line of code beneath the searchTerm definition:


val keyboardController = LocalSoftwareKeyboardController.present
Word: You’ll see a warning after including LocalSoftwareKeyboardController that states This API is experimental and is more likely to change sooner or later.

To make the warning go away, add @OptIn(ExperimentalComposeUiApi::class) exterior the definition of SearchScreen().

Replace keyboardActions contained in the OutlinedTextField composable as follows:

Related articles

Flutter Desktop Apps: Getting Started

Flutter Desktop Apps: Getting Started

March 28, 2023
Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

March 27, 2023

keyboardActions = KeyboardActions(
  onSearch = {
    // 1.
    keyboardController?.cover()
    onSearch(searchTerm)
  },
  onDone = {
    // 2.
    keyboardController?.cover()
    onSearch(searchTerm)
  }
),

You simply added the required code in sections one and two to cover the gentle keyboard when the person presses the search or performed buttons on the keyboard.

Construct and run. Navigate to the search display screen and seek for a e-book. After you press the search key on the keyboard, the keyboard will disappear. Nice work!

As you noticed on this part, there are a number of present CompositionLocal implementations on your use. You even have the choice to create your personal and can dig into that idea subsequent.

Creating Your Personal CompositionLocals

In some situations, it’s possible you’ll need to implement your personal CompositionLocal. For instance, to supply the navigation controller to the completely different composables in your UI or implement a customized theme on your app.

You’re going to work by way of these two examples within the following sections.

Jetpack Compose gives two methods to make use of CompositionLocal, relying on the frequency that the information modifications:

  • staticCompositionLocalOf()
  • compositionLocalOf()

Utilizing staticCompositionLocalOf()

One option to create your personal CompositionLocal is to make use of staticCompositionLocalOf(). When utilizing this, any change on the CompositionLocal worth will trigger your complete UI to redraw.

When the worth of your CompositionLocal doesn’t change typically, staticCompositionLocalOf() is an efficient alternative. A very good place to make use of it’s with the navController within the app.

A number of composables could use the controller to carry out navigation. However passing the navController all the way down to all of the composables can rapidly change into inconvenient, particularly if there a number of screens and locations the place navigation can happen.

Moreover, for your complete lifetime of the app, the navigation controller stays the identical.

So now that you simply perceive its worth, you’ll begin working with CompositionLocal.

Open CompositionLocals.kt, and add the next code:


val LocalNavigationProvider = staticCompositionLocalOf<NavHostController> { error("No navigation host controller supplied.") }

This line creates your static CompositionLocal of sort NavHostController. Throughout creation, you may assign a default worth to make use of.

On this case, you may’t assign a default worth to CompositionLocal as a result of the navigation controller lives inside the composables in MainActivity.kt. As an alternative, you throw an error.

It’s vital to resolve wether your CompositionLocal wants a default worth now, or if you happen to ought to present the worth later and plan to throw an error if it’s not populated.

Word: A finest follow is to start the title of your supplier with the prefix Native in order that builders can discover the accessible cases of CompositionLocal in your code.

Open MainActivity.kt then exchange the creation of the navController with the next line:


val navController = LocalNavigationProvider.present

You get the precise worth of your CompositionLocal with the present property.

Now, exchange the decision to BookListScreen() with the next:


BookListScreen(books)

This composable doesn’t must obtain the navController anymore, so that you take away it.

Open BookListScreen.kt, and take away the navController parameter, like this:


@Composable
enjoyable BookListScreen(
  books: Listing<Ebook>
) {

You eliminated the parameter, however you continue to want to supply the navController to deal with the navigation.

Add the next line at the start of the strategy:


val navController = LocalNavigationProvider.present

You get the present worth of your navigation controller, however as an alternative of passing it explicitly, you’ve gotten implicit entry.

Construct and run. As you’ll discover, the app crashes.

Open Logcat to see the next error:


2022-07-02 15:55:11.853 15897-15897/? E/AndroidRuntime: FATAL EXCEPTION: most important
  Course of: com.rodrigoguerrero.toreadlist, PID: 15897
  java.lang.IllegalStateException: No navigation host controller supplied.

The app crashes since you didn’t present a worth for the LocalNavigationProvider — now you already know you continue to want to try this!

Offering Values to the CompositionLocal

To supply values to your CompositionLocal, you should wrap the composable tree with the next code:


CompositionLocalProvider(LocalNavigationProvider gives rememberNavController()) {

}

On this code:

  • CompositionLocalProvider helps bind your CompositionLocal with its worth.
  • LocalNavigationProvider is the title of your personal CompositionLocal.
  • gives is the infix operate that you simply name to assign the default worth to your CompositionLocal.
  • rememberNavController() — the composable operate that gives the navController because the default worth.

Open MainActivity.kt and wrap the ToReadListTheme and its contents with the code above. After you apply these modifications, onCreate() will look as follows:


override enjoyable onCreate(savedInstanceState: Bundle?) {
  tremendous.onCreate(savedInstanceState)

  setContent {
    // 1.
    CompositionLocalProvider(LocalNavigationProvider gives rememberNavController()) {
      ToReadListTheme {
        // 2.
        val navController = LocalNavigationProvider.present
        NavHost(navController = navController, startDestination = "booklist") {
          composable("booklist") {
            val books by bookListViewModel.bookList.collectAsState(emptyList())
            bookListViewModel.getBookList()
            BookListScreen(books)
          }
          composable("search") {
            val searchUiState by searchViewModel.searchUiState.collectAsState(SearchUiState())
            SearchScreen(
              searchUiState = searchUiState,
              onSearch = { searchViewModel.search(it) },
              onAddToList = { searchViewModel.addToList(it) },
              onBackPressed = {
                searchViewModel.clearResults()
                navController.popBackStack()
              }
            )
          }
        }
      }
    }
  }
}

Right here, you:

  1. Wrap the code with CompositionLocalProvider.
  2. Learn the present worth of your CompositionLocal.

The worth you present is now accessible to your complete UI tree that CompositionLocalProvider surrounds.

Construct and run as soon as once more — it shouldn’t crash anymore. Navigate to the search display screen to watch that the navigation nonetheless works.

Utilizing a Customized CompositionLocal With a Customized Theme

Jetpack Compose offers you entry to MaterialTheme courses to type your app. Nonetheless, some apps want their very own design system.

With CompositionLocal, you’ve gotten the choice to supply the required courses to type all of your composables. In reality, that’s what MaterialTheme makes use of behind the scenes.

The starter consists of two courses with customized colours and fonts:

  • MyReadingColors(), positioned in Colours.kt, defines a customized coloration palette.
  • MyReadingTypography(), positioned in Kind.kt, outline the app’s customized fonts.

It’s essential create two cases of CompositionLocal to make use of these courses: one for the customized colours and one other for the customized fonts.

Open CompositionLocals.kt, and add the next code on the finish of the file:


// 1.
val LocalColorsProvider = staticCompositionLocalOf { MyReadingColors() }
// 2.
val LocalTypographyProvider = staticCompositionLocalOf { MyReadingTypography() }

Right here, you create two static CompositionLocal cases:

1. The primary holds the customized colours on your app’s theme, supplied by MyReadingColors().
2. The second holds the customized fonts, supplied by MyReadingTypography().

To make your customized theme accessible in a approach much like MaterialTheme, add the next code to the highest of Theme.kt:


// 1.
object MyReadingTheme {
  // 2.
  val colours: MyReadingColors
  // 3.
  @Composable
  get() = LocalColorsProvider.present
  // 4.
  val typography: MyReadingTypography
  // 5.
  @Composable
  get() = LocalTypographyProvider.present
}

You do a number of issues on this code:

  1. Create the item MyReadingTheme that holds two style-related variables.
  2. Add the colours variable of sort MyReadingColors.
  3. Create a customized getter for colours. This technique gives the present worth of your LocalColorsProvider.
  4. Add the typography variable of sort MyReadingTypography.
  5. Add a customized getter for typography. This technique gives the present worth of your LocalTypographyProvider.

Now you may entry your colours and typography utilizing a syntax like this: MyReadingTheme.colours or MyReadingTheme.typography.

Keep in Theme.kt, and exchange ToReadListTheme() with the next code:


@Composable
enjoyable ToReadListTheme(content material: @Composable () -> Unit) {
  // 1.
  CompositionLocalProvider(
    LocalColorsProvider gives MyReadingColors(),
    LocalTypographyProvider gives MyReadingTypography()
  ) {
    MaterialTheme(
      // 2.
      colours = lightColors(
        main = MyReadingTheme.colours.primary100,
        primaryVariant = MyReadingTheme.colours.primary90,
        secondary = MyReadingTheme.colours.secondary100,
        secondaryVariant = MyReadingTheme.colours.secondary90
      ),
      content material = content material
    )
  }
}

Right here, you:

  1. Present values to your colours and typography suppliers. For this case, that is an non-obligatory step since you added the default values while you created two CompositionLocal.
  2. Set default coloration values in keeping with your customized theme.

Construct and run. Discover that the search FAB has a ravishing new coloration:

Color with custom theme

Lastly, open Ebook.kt and exchange the contents of the Column composable with the next:


Column {
  // 1.
  Textual content(textual content = e-book.title, type = MyReadingTheme.typography.H5)
  Spacer(modifier = Modifier.peak(4.dp))
  // 2.
  Textual content(textual content = e-book.writer, type = MyReadingTheme.typography.subtitle)
  Spacer(modifier = Modifier.peak(4.dp))

  if (showAddToList) {
    Button(
      onClick = {
        onAddToList(e-book)
        Toast.makeText(context, "Added to record", Toast.LENGTH_SHORT).present()
      },
      modifier = Modifier.fillMaxWidth()
    ) {
      Textual content(textual content = "Add to Listing")
    }
  }
}

On this code, you:

  1. Use the H5 typography from MyReadingTheme for the e-book title.
  2. Use the subtitle typography from MyReadingTheme for the e-book writer.

Construct and run. You may see your new fonts within the record of e-book objects:

Typography with custom theme

Nice job! Now you’re prepared to make use of the opposite sort of CompositionLocals: compositionLocalOf.

Utilizing compositionLocalOf()

Opposite to staticCompositionLocalOf, compositionLocalOf will solely invalidate the composables that learn its present worth. To utilize compositionLocalOf, you should present values for a few paddings used within the e-book lists.

Open Theme.kt and add the next code on the prime of the file:


information class MyReadingPaddings(
  val small: Dp,
  val medium: Dp
)

This class holds two Dp values for a small and medium padding.

Now, open CompositionLocals.kt and add the next code on the backside of the file:


val LocalPaddings = compositionLocalOf { MyReadingPaddings(small = 8.dp, medium = 16.dp) }

With this line, you create LocalPaddings as a compositionLocalOf, with the required default values. Because you already supplied default values, you don’t have so as to add LocalPaddings with the CompositionLocalProvider.

Open Ebook.kt then exchange the content material of Card() as follows:


Card(
  modifier = modifier
    .fillMaxWidth()
    // 1.
    .padding(all = LocalPaddings.present.small),
  elevation = 12.dp,
  form = RoundedCornerShape(measurement = 11.dp)
) {
  Row(
    modifier = Modifier
      // 2.
      .padding(LocalPaddings.present.medium)
  ) {
    AsyncImage(
      modifier = Modifier
        .width(120.dp)
        // 3.
        .padding(finish = LocalPaddings.present.small),
      mannequin = ImageRequest
        .Builder(context)
        .information(e-book.coverUrl)
        .error(context.getDrawable(R.drawable.error_cover))
        .construct(),
      contentScale = ContentScale.Crop,
      contentDescription = e-book.title
    )
    Column {
      Textual content(textual content = e-book.title, type = MyReadingTheme.typography.H5)
      Spacer(modifier = Modifier.peak(4.dp))
      Textual content(textual content = e-book.writer, type = MyReadingTheme.typography.subtitle)
      Spacer(modifier = Modifier.peak(4.dp))

      if (showAddToList) {
        Button(
          onClick = {
            onAddToList(e-book)
            Toast.makeText(context, "Added to record", Toast.LENGTH_SHORT).present()
          },
          modifier = Modifier.fillMaxWidth()
        ) {
          Textual content(textual content = "Add to Listing")
        }
      }
    }
  }
}

On this code, you set the:

  1. Complete padding of the cardboard with a worth of LocalPaddings.present.small.
  2. Complete padding of the row with a worth of LocalPaddings.present.medium.
  3. Finish padding of the picture with a worth of LocalPaddings.present.small.

Construct and run. Your display screen ought to look the identical, however you didn’t must set the padding values manually in all places, nor did you must cross the values from one composable to the opposite.

Understanding When to Use CompositionLocal

It’s tempting to make use of CompositionLocal to cross information to all of your composables. Nonetheless, you want to pay attention to some guidelines that assist decide when to make use of them.

  1. You may present a worth by way of CompositionLocal when the worth is a UI tree-wide worth. As you noticed earlier than with navController, the theme-related values and paddings you applied within the earlier sections can be utilized by all composables, a subset, and even a number of composables without delay.
  2. It’s essential present a good default worth, or as you realized, throw an error if you happen to neglect to supply a default worth.

In case your use case doesn’t meet these standards, you continue to have a number of choices to cross information to your composables.

Alternate options to CompositionLocal

You may cross parameters explicitly to the composables, however it’s best to solely cross the information that every composable wants to make sure your composables stay reusable.

For instance, in Ebook.kt you see the next code:


@Composable
enjoyable BookRow(
  // 1.
  e-book: Ebook,
  modifier: Modifier = Modifier,
  // 2.
  showAddToList: Boolean = false,
  onAddToList: (Ebook) -> Unit = { }
)

This composable receives the next information:

  1. A Ebook object. This composable makes use of title, writer and coverId from the Ebook object.
  2. And showAddToList. which determines if the composable wants to indicate the button so as to add a e-book to your record.

At a minimal, the composable wants each of those information factors to work and be reusable. In reality, you employ this composable in each BookListScreen() and SearchScreen().

One other different to CompositionLocal is to make use of inversion of management — the composable receives a lambda operate as a parameter to make use of when wanted.

For instance, BookRow() receives the lambda operate onAddToList.

You may see within the following code when the composable executes this operate:


Button(
  onClick = {
    onAddToList(e-book)
    Toast.makeText(context, "Added to record", Toast.LENGTH_SHORT).present()
  },
  modifier = Modifier.fillMaxWidth()
) {
  Textual content(textual content = "Add to Listing")
}

The composable calls onAddToList(e-book) when the person faucets the button, however the composable doesn’t know which logic to carry out subsequent.

Discover the next code in MainActivity.kt:


SearchScreen(
  searchUiState = searchUiState,
  onSearch = { searchViewModel.search(it) },
  onAddToList = { searchViewModel.addToList(it) },
  onBackPressed = {
    searchViewModel.clearResults()
    navController.popBackStack()
  }
)

In onAddToList, you may see the logic that executes when a person faucets the button. With this implementation, the BookRow() composable has no thought in regards to the particulars round how so as to add the e-book the record, therefore, you may reuse it elsewhere.

Now that you simply’re conscious of the options, you may resolve when it’s acceptable to make use of CompositionLocal.

The place to Go From Right here?

Obtain the finished undertaking information by clicking the Obtain Supplies button on the prime or backside of the tutorial.

Nice work! You realized how CompositionLocal might help you simplify your composable code and when to make use of CompositionLocal over a few of its options.

If you wish to be taught extra about Jetpack Compose, see Jetpack Compose by Tutorials e-book.

One other nice useful resource to be taught Jetpack Compose is that this Jetpack Compose video course.

Lastly, it’s all the time a good suggestion to go to the Jetpack Compose official documentation.

I hope you loved this tutorial on CompositionLocals in Jetpack Compose. You probably have any questions or feedback, please be a part of the discussion board dialogue beneath.



Source link

Tags: ComposeCompositionLocalJetpackKodecoraywenderlich.com
Share76Tweet47

Related Posts

Flutter Desktop Apps: Getting Started

Flutter Desktop Apps: Getting Started

by Real Hacker Staff
March 28, 2023
0

Requires a pro subscription Pro Version history Flutter 3.7, Dart 2.19, Android Studio 2021.3.1 or higher, Visual Studo Code 1.7.4...

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

Mercari reduces 355K lines of code, a 69% difference, by rebuilding with Jetpack Compose

by Real Hacker Staff
March 27, 2023
0

Posted by the Android team In 2020, the Mercari team took on a big initiative to update its app’s technical...

Apple Releases iOS/iPadOS 16.4 With New Emoji, Web Push Notifications and More

by Real Hacker Staff
March 27, 2023
0

Apple Watch users can now also download watchOS 9.4 The watchOS 9.4 update can be downloaded now through the companion...

There’s only one thing Apple should launch at WWDC 2023, and it isn’t a VR headset

There’s only one thing Apple should launch at WWDC 2023, and it isn’t a VR headset

by Real Hacker Staff
March 27, 2023
0

Artificial Intelligence. A.I. What exactly is it and why is Apple so bad at it right now?In fact, I have...

iPhone camera blinking? Here’s how to fix it!

iPhone camera blinking? Here’s how to fix it!

by Real Hacker Staff
March 27, 2023
0

Is your iPhone camera blinking or flickering when you try to take a photo? There could be many reasons why...

Load More
  • Trending
  • Comments
  • Latest

eSIMs Will Transform the Way You Think About Mobile Data and Security

March 7, 2023

XMOS Launches XVF3800 High-Performance Voice Processor for Enterprise and Consumer Voice Conferencing Platforms

March 7, 2023

Chinese Hackers Using Russo-Ukrainian War Decoys to Target APAC and European Entities

December 7, 2022

Sennheiser Starts Shipping EW-DX Digital Wireless Microphone Series

November 22, 2022

Hello world!

0
US Commodities Regulator Beefs Up Bitcoin Futures Review

US Commodities Regulator Beefs Up Bitcoin Futures Review

0
Bitcoin Hits 2018 Low as Concerns Mount on Regulation, Viability

Bitcoin Hits 2018 Low as Concerns Mount on Regulation, Viability

0
India: Bitcoin Prices Drop As Media Misinterprets Gov’s Regulation Speech

India: Bitcoin Prices Drop As Media Misinterprets Gov’s Regulation Speech

0
Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

March 28, 2023
China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

March 28, 2023
Two 3DS HOME Themes Are Now Free To Download (North America)

Two 3DS HOME Themes Are Now Free To Download (North America)

March 28, 2023
Russia-Ukraine war: List of key events, day 398 | Russia-Ukraine war News

Russia-Ukraine war: List of key events, day 398 | Russia-Ukraine war News

March 28, 2023

Recent News

Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

Elon Musk says Twitter will only show verified accounts on its algorithmic timeline

March 28, 2023
China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

China Premier Li tells Apple’s Tim Cook country to open further | Business and Economy

March 28, 2023

Categories

  • APPLICATIONS
  • AUDIO
  • CAMERA
  • COMPUTERS
  • GAMING
  • LAPTOP
  • REVIEWS
  • SECURITY
  • SMARTPHONES
  • Uncategorized
REAL HACKER NEWS

We bring you the best news on Internet new gadgets hacking and technology from around the world

  • Contact
  • Cookie Privacy Policy
  • Terms and Conditions
  • Privacy Policy
  • Disclaimer
  • DMCA

© 2003 Real Hacker News

No Result
View All Result
  • Home
  • REVIEWS
  • SECURITY
  • GAMING
  • SMARTPHONES
  • CAMERA
  • COMPUTERS
    • LAPTOP
  • APPLICATIONS
  • AUDIO

© 2003 Real Hacker News

Go to mobile version