avatarBev Benyamin

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1763

Abstract

colors = TextFieldDefaults.textFieldColors( backgroundColor = MaterialTheme.colors.surface ), placeholder = { Text(stringResource(R.string.placeholder_search)) }, modifier = modifier .fillMaxWidth() .heightIn(min = <span class="hljs-number">56.</span>dp) ) }</pre></div><h1 id="8783">Explanation</h1><ul><li>You can see in the above figure we need to design the search bar</li><li>The design is divided into many tiny pixels. We can use these pixels to find the dimension or spacing between different items.</li><li>The search bar has a height of 56 dp and a width equal to the parent.</li><li>Each pixel is 56/7=8dp</li><li>We will use a material component called a <b>Text field</b> to implement a search bar.</li><li>It is very similar to Edit Text for views. Like Edit Text it allows users to enter text into a UI.</li><li>It is of two types filled and outlined. It is mainly used in forms and dialogs. like — first name, last name, phone, address, etc.</li></ul><figure id="b858"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*0OlgZ49VIGSscHCP-EO4Fw.png"><figcaption></figcaption></figure><ul><li>As per the design, using a modifier <code>heightIn</code> we have added the min-height of 56.dp, and <code>fillMaxWidth</code> modifier utilizes the entire width of the parent.</li><li>It is the best practice to provide min-height so that the user can increase it according to his preferences.</li><li>we use <b>modifiers </b>to

  • change the composable size, layout, behavior, and appearance
  • Add information like accessibility labels
  • Process user input
  • Add high-level interactions, like making an element clickable, scrollable, draggable, or zoomable.</li><li

Options

we can chain multiple modifier methods to create a more complex adaptation.</li><li><code>value </code>parameter is used to provide any value to the Text field</li><li><code>onValueChange</code> callback performs any action when the Text field value changes.</li><li>SearchBar composable accepts a modifier that it is passing to TextField. It is the best practice followed by every composable.</li><li>It allows the caller to customize the look and feel of the composable, which makes it more flexible and reusable.</li><li>we have added a search icon to the Text field using the parameter <code>leadingIcon</code>.</li><li>We have added a background to the text Field using the parameter <code>colors </code>and method <code>TextFieldDefaults.textFieldColors</code></li><li><code>TextFieldDefaults</code> data class contains many parameters like <code>backgroundColor</code>, <code>textColor</code>, <code>placeholderColor </code>etc. We need not specify different parameters for it, we can simply use inbuilt methods of <code>TextFieldDefaults</code> .</li><li>we have added a placeholder text or hint using the parameter <code>placeholder</code> .</li></ul><h1 id="7309">Source Code</h1><ul><li><a href="https://github.com/abhineshchandra1234/MySoothe">https://github.com/abhineshchandra1234/MySoothe</a></li></ul><h1 id="f826">References</h1><ul><li><a href="https://developer.android.com/codelabs/jetpack-compose-layouts?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fjetpack-compose-for-android-developers-1%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fjetpack-compose-layouts#3">Search bar — Modifiers</a></li><li><a href="https://m3.material.io/components/text-fields/overview">Text fields</a></li></ul></article></body>

Travel and family humor

My Hubby’s Head On A Spit

Mission Accomplished

Well, kind of. Photo by David Trinks on Unsplash

My husband’s job is very demanding. So much so that he couldn’t go to our nephew’s destination wedding. It was a week-long celebration in Playa Del Carmen Mexico, aka Paradise. There was just no way he could even swing the main 3-day celebration.

I was really upset thinking I would be sad without him there.

So Lucy thought she had a hilarious solution. I found a picture of him wearing a suit, made copies, and cut them out. I then glued them to popsicle sticks. I thought it was a great idea. Now he would be in all the family photos. That was my plan.

Lucy forgot about all the times I threatened to put his head on a spit if I caught him doing this or that.

My 3rd shift husband. Trying to ignore his chatty wife on a morning flight years ago. Photo by author.

So while I thought it would be funny, he thought I was making a statement because he couldn’t get off of work. To him the pictures looked like me laughing and saying haha, I got your head on a “spit”, I’m in paradise, that you paid for, while you’re sweating in a factory. Suck it, dude!

I.E. A DECLARATION OF WAR to him.

Our nephew and I. Authors photo.

He was like, here she’s in paradise, with our kids, I paid for it all and she’s sending me pictures laughing at me. I’ll show her! He called some of his friends to plan a night out.

So while he was planning his revenge, I thought I was hilarious. That was until I sent him some of the pictures and he stopped answering my calls. 😂

Photo by John Arano on Unsplash

But I was just trying to be sweet, kind of.

More of a smart-ass.

But Bev’s great ideas usually turn into a Lucy Ricardo episode.

Sorry to my hubby, but a premium, ALL-inclusive resort in a tropical paradise destination IS fun, even if he wasn’t there. 50 people came for the wedding so I was with lots of family and friends. Our 2 adult children arrived 2 days before me. I couldn’t help it, or fake it. I LOVED Playa Del Carmen!!! They offered morning yoga classes on the beach. Then the resort personnel would give daily salsa classes near the pool where you could also get a massage. Or take a shuttle into town to explore the little shops. It was paradise.

Authors photo. Me, forcing our daughter to take a picture with the stick. She knew he wouldn't like it, Daddy's girl.
Authors photo. Our son, mama's boy was on my side and thought it was hilarious.

After morning beach yoga you could find a lounger closer to the water. Waiters walked around with giant trays of drinks. Mai Tai’s, Margaritas, Beers, water, etc. I was the first person out of my room most mornings. Couldn’t wait for another day of fun. I was sending my family messages bright and early to get them to come join me for more fun.

It was HOT. Like 105 at the outside wedding but it was beautiful. It was also steps from the ocean so you could just take a dip if you got overheated.

Authors photo. My nephew and his beautiful bride

See how surprised my sister was to see my hubby at the reception!

My sister Authors photo

My brother didn’t think he was going to be able to have a drink with his brother-in-law. But you can see right here my hubby enjoying a rum and coke with my brother.

My brother Authors photo

And here is my hubby with the groom, our Nephew.

My nephew and I Authors photo

Even though I meant it differently than he saw it, he WAS at our nephew’s wedding in paradise, thanks to me.

Everyone wanted to take pictures with him, thanks to me.

He was kind of a star you might say. Once again, thanks to me.

You see? I took him to Mexico with me. Well, that’s how I meant it even if he didn’t see it that way.

My sister Authors photo

I do appreciate all he does for us, forever and always.

January 23rd was the 36th anniversary of our first date. Since we became inseparable. Well, other than Mexico. And he was kind of there, if only with his head on a “spit” 😂.

My hubby in Mexico, kind of Authors photo
This Happened To Me
Humor
New Writers Welcome
Travel
Family
Recommended from ReadMedium