avatarJenna Peddle

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

8995

Abstract

       </div>
        </div>
    </figure></iframe></div></div></figure><p id="a958">In Jetpack Compose, the Modifier.fillMaxSize() ensures that the layout takes up the available space, adapting to different screen sizes. Additionally, using a padding modifier can provide a consistent margin, maintaining a clean and organized appearance across various dimensions.</p><p id="cc20"><b>Managing Orientations:</b></p>
    <figure id="e303">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/LethalMaus/df4d1bf10cfa95fce51b5726f625cd1a.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="864f">By checking the current orientation using LocalConfiguration.current.orientation, you can conditionally define different layouts within a Composable function.</p><h2 id="e9ba">SlidingPaneLayout for Foldables</h2><div id="af7f" class="link-block">
      <a href="https://developer.android.com/jetpack/androidx/releases/slidingpanelayout">
        <div>
          <div>
            <h2>Slidingpanelayout | Jetpack | Android Developers</h2>
            <div><h3>Implement a sliding pane UI pattern. To add a dependency on SlidingPaneLayout, you must add the Google Maven repository…</h3></div>
            <div><p>developer.android.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*Mc7vQwPTUyZoP5KW)"></div>
          </div>
        </div>
      </a>
    </div><ul><li>Incorporate SlidingPaneLayout to create a sliding panel UI for foldable devices.</li></ul>
    <figure id="b2b5">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/LethalMaus/fd469a275aa7e2540f14e0eb889c47d0.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="6ee5">By leveraging these techniques in both Databinding and Jetpack Compose, you can create adaptive layouts that gracefully accommodate different screen sizes, orientations, and even the unique form factors of foldable devices. Whether adjusting dimensions or employing dynamic layouts, the goal is to provide users with a consistent and delightful experience across the diverse spectrum of devices.</p><h1 id="629e">Navigating the Pitfalls &amp; Best Practices</h1><h2 id="6483">Common Pitfalls and How to Avoid Them</h2><p id="c90b"><b>Fixed Dimensions:</b></p><ul><li><b>Pitfall:</b> Hardcoding dimensions can lead to layout distortion on different screen sizes.</li><li><b>Solution:</b> Use relative dimensions, such as wrap_content and match_parent, or utilize density-independent pixels (dp) for consistent sizing across screens.</li><li><b>XML Databinding Example:</b></li></ul>
    <figure id="4910">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/LethalMaus/97189675738255ea3f8326436851255e.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><ul><li><b>Jetpack Compose Example:</b></li></ul>
    <figure id="018c">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/LethalMaus/c6621ee3965756693058026eeb462b83.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="dc90"><b>Ignoring Density Independence:</b></p><ul><li><b>Pitfall</b>: Relying solely on fixed pixel values may lead to inconsistent UI across devices with different pixel densities.</li><li><b>Solution:</b> Use density-independent units (dp in XML, dp or sp in Compose) to ensure that UI elements scale appropriately on different screens.</li><li><b>XML DataBinding:</b></li></ul><div id="0838"><pre><span class="hljs-comment">&lt;!-- res/layout/activity_main.xml --&gt;</span>

<span class="hljs-tag"><<span class="hljs-name">TextView</span> <span class="hljs-attr">android:layout_width</span>=<span class="hljs-string">"wrap_content"</span> <span class="hljs-attr">android:layout_height</span>=<span class="hljs-string">"wrap_content"</span> <span class="hljs-attr">android:textSize</span>=<span class="hljs-string">"16sp"</span> <span class="hljs-attr">android:padding</span>=<span class="hljs-string">"8dp"</span> <span class="hljs-attr">android:text</span>=<span class="hljs-string">"Density-independent Text"</span> /></span></pre></div><ul><li><b>Jetpack Compose:</b></li></ul><div id="24b2"><pre>/<span class="hljs-regexp">/ src/main</span><span class="hljs-regexp">/kotlin/com</span><span class="hljs-regexp">/example/myapp</span><span class="hljs-regexp">/ui/</span><span class="hljs-title class_">MainScreen</span>.kt <span class="hljs-title class_">Text</span>( text = <span class="hljs-string">"Density-independent Text"</span>, fontSize = <span class="hljs-number">16</span>.sp, modifier = <span class="hljs-title class_">Modifier</span>.padding(<span class="hljs-number">8</span>.dp) )</pre></div><p id="c31d"><b>Ignoring Orientation Changes:</b></p><ul><li><b>Pitfall: </b>Neglecting landscape or portrait orientations may result in suboptimal user experiences.</li><li><b>Solution:</b> Design landscape-specific layouts for improved usability when the device is rotated.</li><li><b>XML Databinding Example:</b></li></ul><div id="6536"><pre><span class="hljs-comment"><!-- res/layout-land/activity_main.xml --></span> <span class="hljs-tag"><<span class="hljs-name">LinearLayout</span> <span class="hljs-attr">android:orientation</span>=<span class="hljs-string">"horizontal"</span> <span class="hljs-attr">android:layout_width</span>=<span class="hljs-string">"match_parent"</span> <span class="hljs-attr">android:layout_height</span>=<span class="hljs-string">"match_parent"</span>></span> <span class="hljs-comment"><!-- Landscape-specific UI components --></span> <span class="hljs-tag"></<span class="hljs-name">LinearLayout</span>></span></pre></div><ul><li><b>Jetpack Compose Example:</b></li></ul> <figure id="fcde"> <div> <div>

            <iframe class="gist-iframe" src="/gist/LethalMaus/c34e8858c7bf0d4ae15671d14f67b382.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="913c"><b>Neglecting Foldable Device Considerations:</b></p><ul><li><b>Pitfall:</b> Overlooking the unique form factor of foldable devices may lead to suboptimal user experiences.</li><li><b>Solution:</b> Incorporate resource qualifiers for foldable devices and tailor layouts to make the most of their capabilities.</li><li><b>XML Databinding Example:</b></li></ul><div id="f275"><pre><span class="hljs-comment">&lt;!-- res/layout-large/activity_main.xml --&gt;</span>

<span class="hljs-tag"><<span class="hljs-name">LinearLayout</span> <span class="hljs-attr">android:orientation</span>=<span class="hljs-string">"vertical"</span> <span class="hljs-attr">android:layout_width</span>=<span class="hljs-string">"match_parent"</span> <span class="hljs-attr">android:layout_height</span>=<span class="hljs-string">"match_parent"</span>></span> <span class="hljs-comment"><!-- Foldable device UI components --></span> <span class="hljs-tag"></<span class="hljs-name">LinearLayout</span>></span></pre></div><ul><li><b>Jetpack Compose Example:</b></li></ul> <figure id="6e49"> <div> <div>

            <iframe class="gist-iframe" src="/gist/LethalMaus/e3e1b19d494c32cae17f4908f2605805.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><h1 id="3fee">Extra Tricks for a Seamless Experience</h1><p id="0308"><b>Dynamic Spacing:</b></p><ul><li>Dynamically adjust spacing based on screen size using dimension resources.</li><li><b>XML Databinding Example:</b></li></ul><div id="1ddf"><pre><span class="hljs-tag">&lt;<span class="hljs-name">TextView</span>
<span class="hljs-attr">android:layout_width</span>=<span class="hljs-string">"wrap_content"</span>
<span class="hljs-attr">android:layout_height</span>=<span class="hljs-string">"wrap_content"</span>
<span class="hljs-attr">android:text</span>=<span class="hljs-string">"Dynamic Spacing"</span>
<span class="hljs-attr">android:layout_margin</span>=<span class="hljs-string">"@dimen/margin_standard"</span> /

Options

></span></pre></div><ul><li><b>Jetpack Compose Example:</b></li></ul><div id="a566"><pre><span class="hljs-selector-tag">Text</span>( text = <span class="hljs-string">"Dynamic Spacing"</span>, modifier = Modifier .<span class="hljs-built_in">padding</span>(<span class="hljs-built_in">dimensionResource</span>(id = R.dimen.margin_standard)) )</pre></div><p id="1ec8"><b>Responsive Font Sizes:</b></p><ul><li>Use dimension resources to adjust font sizes responsively.</li><li><b>XML Databinding Example:</b></li></ul><div id="7238"><pre><span class="hljs-tag"><<span class="hljs-name">TextView</span> <span class="hljs-attr">android:layout_width</span>=<span class="hljs-string">"wrap_content"</span> <span class="hljs-attr">android:layout_height</span>=<span class="hljs-string">"wrap_content"</span> <span class="hljs-attr">android:text</span>=<span class="hljs-string">"Responsive Font"</span> <span class="hljs-attr">android:textSize</span>=<span class="hljs-string">"@dimen/text_size_medium"</span> /></span></pre></div><ul><li><b>Jetpack Compose Example:</b></li></ul><div id="879d"><pre><span class="hljs-keyword">Text</span>( <span class="hljs-keyword">text</span> = <span class="hljs-string">"Responsive Font"</span>, fontSize = dimensionResource(id = R.dimen.text_size_medium).value )</pre></div><p id="ff03">Navigating the diverse landscape of screen sizes, orientations, and foldable devices requires attention to detail. By avoiding common pitfalls and implementing these extra tricks, you can create adaptive layouts that provide a seamless and enjoyable user experience across a wide range of devices.</p><h1 id="724b">Testing Across the Spectrum: Espresso, Firebase Device Farm, and Emulators</h1><p id="f7de">Ensuring your app performs seamlessly across diverse screen sizes and orientations requires a robust testing strategy. In this section, we’ll explore how to effectively test your application using Espresso, leverage Firebase Device Farm for comprehensive device coverage, and set up custom emulators tailored to your testing needs. Additionally, we’ll provide scripts for running these tests, both locally and within a continuous integration (CI) pipeline.</p><h2 id="d5d7">Espresso for Local Testing</h2><p id="3c72">Espresso is a powerful testing framework for Android that allows you to write concise and reliable UI tests. To test different screen sizes and orientations locally, you can use Espresso’s ViewMatchers and ViewActions in conjunction with the ViewAssertions to validate UI elements.</p><p id="1119"><b>Espresso Code Example:</b></p> <figure id="e57e"> <div> <div>

            <iframe class="gist-iframe" src="/gist/LethalMaus/d59c45ea83a143f9e81cabff1e5294b2.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><h2 id="ade1">Firebase Device Farm for Comprehensive Testing</h2><div id="c926" class="link-block">
      <a href="https://firebase.google.com/docs/test-lab">
        <div>
          <div>
            <h2>Firebase Test Lab</h2>
            <div><h3>Test your app on devices hosted in a Google data center.</h3></div>
            <div><p>firebase.google.com</p></div>
          </div>
          <div>
            <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*_syWJhiB1iPapT92)"></div>
          </div>
        </div>
      </a>
    </div><p id="624c">Firebase Device Farm provides a cloud-based solution for testing your app on a wide range of real devices. You can create test matrices to cover different screen sizes, orientations, and devices, ensuring thorough testing across various configurations.</p>
    <figure id="f3c7">
        <div>
          <div>
            <img class="ratio" src="http://placehold.it/16x9">
            <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4_ZEEX1x17k%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4_ZEEX1x17k&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4_ZEEX1x17k%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="e689"><b>Firebase Test Lab Code Example:</b></p>
    <figure id="83a5">
        <div>
          <div>
            
            <iframe class="gist-iframe" src="/gist/LethalMaus/f4f1bc1cb5b2e0e9acd015c4b88d7697.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><h2 id="3b50">Emulator Setup for Custom Testing Environments</h2><p id="9c86">Android emulators provide a flexible way to create custom virtual devices for testing. You can configure emulators to match specific screen sizes, resolutions, and orientations to mimic real-world scenarios.</p><h2 id="d185">Custom Emulator Setup:</h2><p id="6b87"><b>Create a new emulator with AVD Manager: </b>Specify device details such as screen size, resolution, and orientation.</p><div id="cc39"><pre>emulator -avd <span class="hljs-title class_">Pixel</span>_6_API_32 -orientation portrait</pre></div><p id="2825"><b>Start the emulator:</b> Launch the emulator with the desired configuration.</p><h2 id="b314">Script for Running Tests Locally:</h2><div id="b14f"><pre><span class="hljs-meta">#!/bin/bash</span>

<span class="hljs-comment"># Assuming your Espresso tests are in the 'androidTest' directory</span> ./gradlew connectedAndroidTest</pre></div><h2 id="8c3b">Script for CI Pipeline (Firebase Device Farm Integration):</h2> <figure id="411f"> <div> <div>

            <iframe class="gist-iframe" src="/gist/LethalMaus/f42ef9d5be37616ab0d3f7c4fe74245e.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="2828">By incorporating these testing strategies into your development workflow, you can ensure that your app functions seamlessly across a spectrum of screen sizes, resolutions, and orientations. Whether testing locally with Espresso, exploring diverse configurations on Firebase Device Farm, or creating custom emulators, a comprehensive testing approach is essential for delivering a high-quality user experience.</p><h1 id="1d6d">Conclusion</h1><p id="123e">It is more important than ever to design experiences that work seamlessly across a wide range of screen sizes, orientations, and foldable devices. This exploration of the nuances of multi-form factor testing and development has made the way clearer for developers trying to figure out how to deal with the challenges of the digital world.</p><p id="7a08">Using the ideas of adaptable design in both Jetpack Compose and XML databinding, developers can create layouts that fluidly adjust to the ever-widening range of devices. The adaptability provided by these methods guarantees that customers, irrespective of the device they use, get a consistent and enjoyable experience on smartphones, tablets, and foldables.</p><p id="8650">Testing, a cornerstone of app development, has been explored through the lenses of Espresso, Firebase Device Farm, and emulator setups. From local testing to cloud-based solutions, developers can employ a variety of tools to ensure their apps perform flawlessly across diverse environments. Whether running Espresso tests for specific configurations, leveraging Firebase for comprehensive device coverage, or scripting emulator setups for local and CI/CD pipeline testing, the arsenal is rich with options.</p><p id="bdba">As we approach to the end of this investigation, it is clear that embracing diversity is essential for success. By grasping the subtleties of various form factors, avoiding typical mistakes, and adding extra tactics, developers can make applications that are capable of surpassing constraints. In a world where creativity has no boundaries, progressive developers continue to be distinguished by their commitment to creating inclusive and flexible digital experiences.</p><p id="7b0b">I hope that this article acts as a compass for developers, helping them navigate the complexities of developing and testing multi-screen applications and providing inspiration for the construction of programmes that not only fulfil current needs but also remain robust in the face of future technological breakthroughs. We look forward to a time when consumers everywhere will be able to explore a universe of seamless possibilities with each tap, swipe, and fold.</p></article></body>

How Trisha Paytas Shows the Dark Side of Personal Branding & Social Media

Trisha Paytas eating a slice of pizza

Throughout my time at university, I have come to hate the idea of personal branding. I find the concept dehumanizing, unnecessarily restrictive, and entirely unrealistic. As the number of personal branding seminars my peers and I are forced to take rises, so to does the life become drained from my Facebook and Twitter feeds. Boring retweets of news articles and the occasional PG gif are the only remnants of a place where actual human beings with actual human thoughts once occupied. These seminars from ‘personal-branding coaches’ have left everyone terrified of using social media in a meaningful way; too scared to show even a glimmer of their political leanings, to take a stance on controversial topics, or even to be playful or marginally off-colour.

Employability > everything else.. I guess?

Traditional personal branding is exhausting. For me, the endeavour was impossible. I consider myself to be a jack-of-many-trades (and the master of none). The prospect of branding myself one particular way was incredibly daunting, and no matter how hard I tried to squeeze myself into a box, I always fell out of shape. I, like every other human in existence, was not born square-shaped. I stopped trying to wrestle myself to fit somewhere I clearly didn’t belong, and have since embraced what I was meant to be: misshapen, a bit PG-13, and entirely human.

I realize that I am an outlier in this, and that successful personal branding can lead to a lot of popularity, wealth, and open the doors for some really cool opportunities. But, we must ask ourselves: at what cost? Is denying our human nature and refusing to engage meaningfully with media worth the money, fame and (alleged) increased employability?

I’m not so sure it is.

My distaste for personal branding is likely what led to me to my discovery of Trisha Paytas: a controversial Youtuber with over one billion views, famous for eating copious amounts of food, having emotional breakdowns on her kitchen floor, and releasing questionable christian pop music (amongst other things)

I was initially attracted to Trisha Paytas and her content because it was so seemingly unpolished and authentic. At least amidst the sea of perfect ‘beauty gurus’, with their jump cuts, uplifting background music, and yankee candles burning in the background. To me, Paytas was the antitheses of a personal brand, and I loved every imperfect minute of it.

It seemed like a lot of other people loved it too, and the multi-talented, perpetually entertaining Paytas now boasts over 3.5 million Youtube subscribers, and 1.5 million Instagram followers.

youtube.com/blndsundoll4mj
instagram.com/trishapaytas

Along with being a social media mogul, Paytas has published two books, released a number of EP’s and singles, was featured in various music videos, and is a reality TV star; known for My Strange Addiction, Ellen, The Tyra Show, America’s Got Talent, and, most notably, Celebrity Big Brother UK.

Her start on Youtube was pretty normal, she uploaded a nice medley of vlogs, sit-down-chat videos, with a couple of trolling videos thrown in for good measure:

I think people gravitated to Trisha for the same reasons as myself; her unrefined and unapologetic nature was refreshing in an otherwise artificial, people-pleasing environment.

Yet, after nearly a decade of watching Patyas, her content began to change. Sit-down chat videos became replaced by emotional meltdowns on the floor or eating shows.A homogenous personality, theme and mood began to emerge in each upload. There was an air of intentionality in every post, and I realized that not having a traditional personal brand, was Trisha’s version of a personal brand. Her ‘raw’ kitchen floor breakdowns were a cash cow, and her emotion-fuelled binges were likely carefully crafted to rake in impressions. Trisha undoubtedly knows she fills a gap in the market, and exploits her role as the internet’s raunchy, relatable content creator to the furthest extent.

This is not all to say that there’s anything inherently wrong with playing the social media game like this, at the end of the day Trisha’s content (like most reality TV) is entertainment, and viewers should probably expect to have to suspend their disbelief a little bit. I don’t want to paint Paytas as a manipulative master-mind. While I don’t doubt her intelligence, I think her brand of ‘comical’ excessiveness and emotional instability formed organically, and perhaps initially, without any real intention. What happened to Trisha inevitably happens to a lot of edgy content-creators: the pursuit of views leads to an inescapable (and sometimes dangerous) niche.

As for Trisha’s niche, it turns out, Paytas’ fans really like to see her go through emotional turmoil, add to her hoard of clothing, fail at diets, and eat a lot of fast food. Driven by success, Paytas appeases her fans desires, and now almost exclusively uploads eating shows, massive clothing hauls, or (sometimes contrived) kitchen floor meltdowns. As an avid fan of Trisha this behaviour, and the immediate reinforcement it receives, is worrisome. In her earlier years on Youtube, Trisha discussed in-depth her struggles with binge eating disorder, with her shopping addiction, mood disorders, and her history of turbulent and volatile relationships. She documented countless attempts at overcoming her mental illnesses, never to any avail. Videos showcasing her pitfalls received nearly double the attention than those focused on her betterment — and people quickly grabbed onto the ‘relatable meme-queen’; failing to see the struggling human-being behind the personal brand. Her serious mental illnesses have become so ingrained with her perceived persona, that fans (and maybe even Trisha herself) can no longer distinguish between disease and quirk. Trisha memes are littered throughout each corner of the internet, our blindness to, or unwillingness to recognize the dangers of Trisha’s content have led fans to incessantly make a mockery out of the life-threatening diseases she has claimed to grapple with. As fans of Trisha, we have effectively made her dangerous vices profitable, and given her the ultimatum of vitality or views.

Despite their inherently fluid and moldable nature, personal brands can feel very permanent and limiting. When the foundation for one’s personal brand is a string of mental illnesses, the practice can quickly become deadly. Personal brands likely feel even more concrete as a large scale content creator, as any changes to the way you portray yourself will likewise alter the relationship between you and your audiences; directly affecting your livelihood and widely -analyzed public image.

We often talk about social media and mental health, particularly in regards to its ability to deteriorate feelings of self-worth, increase anxiety, and worsen depression. We rarely consider the physical and mental dangers that can come with striving to meet fan expectations, pursuing virality, or even just maintaining a contrived public image. Trisha is not the only internet star to sacrifice her wellbeing or simply go too far for the sake of views. Some other recent cases of content creators prioritizing impressions above all else include the Youtuber who got shot by his pregnant girlfriend during a video stunt, the hundreds of internet users who filmed themselves eating tide pods, and of course, Logan Paul, who exploited a suicide victim for an eye-catching thumbnail. The phenomena of people endangering themselves or others, whether physically or mentally, for the sake of internet fame will only become more exasperated with rising levels of content saturation. As both content creators and consumers we have a collective responsibility to not create, share, or glorify content demonstrating harmful behaviours (even if you think it would make a really funny meme, or iPhone case).

The bottom line is this: no amount of views, digital popularity, or prospective employers will ever matter more than your mental wellbeing.

“The truth is that we don’t need everyone to like us; we need a few people to love us. Because what’s better than being roundly liked is being fully known — an impossibility both professionally and personally if you’re so busy being likeable that you forget to be yourself. “ — Jessica Valenti

It so incredibly easy to lose sight of our authentic selfs when we craft our digital identities in the image of what we think will be likeable or well perceived. If we can learn anything from bubbly, talented Trisha and her convergence of personal branding and mental illness it’s probably to stop taking personal brands so seriously. We are humans not corporations, we were designed to grow and change and flip and flop. We don’t have to worry about limiting ourselves to one direction, profession or aesthetic. Like Trisha has shown, we can quickly trap ourselves into dangerous or unnatural places when we focus too much on carving out a box to fit our human form.

Social Media
Recommended from ReadMedium