<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wends</title>
    <description>The latest articles on DEV Community by Wends (@wendhsz).</description>
    <link>https://dev.to/wendhsz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F45813%2Fb9ddca9f-de44-4d1d-bcaf-cba4860b3127.jpg</url>
      <title>DEV Community: Wends</title>
      <link>https://dev.to/wendhsz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wendhsz"/>
    <language>en</language>
    <item>
      <title>Working From Home</title>
      <dc:creator>Wends</dc:creator>
      <pubDate>Wed, 20 Jul 2022 19:54:39 +0000</pubDate>
      <link>https://dev.to/wendhsz/working-from-home-3k2m</link>
      <guid>https://dev.to/wendhsz/working-from-home-3k2m</guid>
      <description>&lt;p&gt;I've been an office employee for over 7 years, I was employed on my first ever job and being in office, I was thought that leaving yourself idle even for just minutes is bad, boss always have to look at employees if they are working in front of the computer, being a programmer in the office, if you're not busy on your computer 8 hours a day you're not being efficient. Because of this, I had to shut down the world around me and make music my fuel for coding. This was me for over 7 years, time in and time out is one of the most stressful things every weekdays, commuting is just pure pain for me as I'm not a morning person and I have a hard time waking up in the morning even as a child. There are times when I have stress at home that I just can't leave at home making me feel grumpy and make bad vibes ooze out of me. &lt;/p&gt;

&lt;p&gt;Last year I went fulltime working from home, and it feels a lot lighter for me, I can take breaks when I feel stuck and it's so mind-blowing, all along, when I feel stuck I stress about it as I had to fiddle on my computer because it feels like someone is always watching and just waiting to pounce, it gave me anxiety and my hair fell out, turned me into a stress-eater, when all I need is a break, stay away from the computer and think about the course of action I can make to solve problems, with this I'm still able to perform well and was more eager to focus and finish tasks. I'm actually very surprised that I'm able to scratch out things and start anew with better solutions rather than making ends meet with the current action I'm taking making everything look hacky, terrible and unclean. &lt;/p&gt;

&lt;p&gt;With this I realize that I love working from home, I love it when it's more output-driven rather than fiddling in front of the computer when all you need is to step away from it and think without anyone judging.&lt;/p&gt;

&lt;p&gt;Today I had some mental and emotional stress I just can't get out of, I also have a meeting I need to attend to, but I excused myself out of it today and just focused on working because with the mental and emotional stress I just can't function as a social person. Am I the only one like this? Is this entitlement? I actually feel a little guilty doing this... How do you cope up when you go through this?&lt;/p&gt;

</description>
      <category>workfromhome</category>
      <category>productivity</category>
    </item>
    <item>
      <title>New Android Splash Screen</title>
      <dc:creator>Wends</dc:creator>
      <pubDate>Wed, 29 Jun 2022 06:03:15 +0000</pubDate>
      <link>https://dev.to/wendhsz/new-android-splash-screen-3g5o</link>
      <guid>https://dev.to/wendhsz/new-android-splash-screen-3g5o</guid>
      <description>&lt;p&gt;I'm a fan of splash screen, for every project I try to create I always wanted to apply splash screen because it's fun to look at! But I never really liked the previous version of applying it so I don't apply it much. But yesterday, since I started working on my portfolio again, I encountered a new good way to implement it.&lt;/p&gt;

&lt;p&gt;Put this package in &lt;em&gt;build.gradle&lt;/em&gt; (module) in &lt;em&gt;dependencies&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;implementation 'androidx.core:core-splashscreen:1.0.0-beta01'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you can't see 'styles.xml' in your project, go ahead and right click on your res folder and create a new xml file, name it as 'styles.xml' and put this code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;resources&amp;gt;
    &amp;lt;style name="Theme.App.Starting" parent="Theme.SplashScreen"&amp;gt;
        &amp;lt;item name="windowSplashScreenAnimatedIcon"&amp;gt;@drawable/ic_stat_shop&amp;lt;/item&amp;gt;
        &amp;lt;item name="windowSplashScreenBackground"&amp;gt;@color/teal_700&amp;lt;/item&amp;gt;
        &amp;lt;item name="postSplashScreenTheme"&amp;gt;@style/Theme.OnlineShop&amp;lt;/item&amp;gt;

    &amp;lt;/style&amp;gt;
&amp;lt;/resources&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;em&gt;windowSplashScreenAnimatedIcon&lt;/em&gt; is your animated or simple logo, the one you want to see in the middle of your splash screen.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;windowSplashScreenBackground&lt;/em&gt; item is the background color of your splash screen, mine is just from the color xml file but you can also put there the background color of your ic_launcher/logo if you have one. &lt;/p&gt;

&lt;p&gt;The &lt;em&gt;AppTheme&lt;/em&gt; in your postSplashScreenTheme item is the theme name your project is currently using, you can find it inside themes folder inside the themes.xml files.&lt;/p&gt;

&lt;p&gt;Add the style to your mainactivity in androidmanifest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;activity
            android:name=".MainActivity"
            android:theme="@style/Theme.App.Starting"
            android:exported="true" &amp;gt;
            &amp;lt;intent-filter&amp;gt;
                &amp;lt;action android:name="android.intent.action.MAIN" /&amp;gt;

                &amp;lt;category android:name="android.intent.category.LAUNCHER" /&amp;gt;
            &amp;lt;/intent-filter&amp;gt;
        &amp;lt;/activity&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, don't forget to add this code before &lt;code&gt;setContentView(R.layout.activity_main);&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or else you'll encounter this error, as I did:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.onlineshop/com.test.onlineshop.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>android</category>
      <category>appdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How I Understand SOLID Principles</title>
      <dc:creator>Wends</dc:creator>
      <pubDate>Sat, 20 Feb 2021 16:39:06 +0000</pubDate>
      <link>https://dev.to/wendhsz/how-i-understand-solid-principles-547c</link>
      <guid>https://dev.to/wendhsz/how-i-understand-solid-principles-547c</guid>
      <description>&lt;p&gt;SOLID principles consist of five principles namely: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;S&lt;/strong&gt;ingle-Responsibility Principle&lt;br&gt;
&lt;strong&gt;O&lt;/strong&gt;pen-Closed Principle&lt;br&gt;
&lt;strong&gt;L&lt;/strong&gt;iskov Substitution Principle&lt;br&gt;
&lt;strong&gt;I&lt;/strong&gt;nterface Segregation Principle&lt;br&gt;
&lt;strong&gt;D&lt;/strong&gt;ependency Inversion Principle&lt;/p&gt;

&lt;p&gt;First, what is principle? According to google, one of the meanings of &lt;em&gt;principle&lt;/em&gt; is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a fundamental truth or proposition that serves as the foundation for a system of belief or behavior or for a chain of reasoning.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So, as how I understood it, these principles are a plan of actions that serves as a foundation for a system. &lt;/p&gt;

&lt;p&gt;What exactly are these principles about?&lt;/p&gt;

&lt;p&gt;Here we go.&lt;/p&gt;

&lt;h3&gt;
  
  
  Single-Responsibility Principle
&lt;/h3&gt;

&lt;p&gt;From what I've learned, the only thing that I remember is that &lt;em&gt;a class should only have one job.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If I have to explain to someone who doesn't know anything about programming. I think the best explanation is comparing this definition to a real life object. &lt;/p&gt;

&lt;p&gt;I think the best fit for this idea is a faucet. You turn it on and water flows out, you turn it off the water stops flowing, the faucet's only job is to control the flow of water and nothing else. You can't make it work like a sink or a plate or any other things, because it only has &lt;em&gt;one job&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open-Closed Principle
&lt;/h3&gt;

&lt;p&gt;The key meaning for me is &lt;em&gt;open for extension but closed for modification.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A class should be extendable but close for modification. Alright, so it's like a parent and child relationship. You can never modify a parent's attribute but it can always be (at this situation) be inherited by the child.&lt;/p&gt;

&lt;h3&gt;
  
  
  Liskov Substitution Principle
&lt;/h3&gt;

&lt;p&gt;Before we proceed, who is Liskov first and why is it important this principle should be named after this name.&lt;/p&gt;

&lt;p&gt;Liskov is a computer scientist. According to wikipedia&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strong) behavioral subtyping, that was initially introduced by Barbara Liskov in a 1987 conference keynote address titled Data abstraction and hierarchy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Liskov substition is about substitution of related classes, so, if a child class is derived from its parent class, it should have the ability to become a substitute of the parent class. &lt;/p&gt;

&lt;p&gt;So like for example, the trackpad and mouse, they bought can be substitutable with each other because they have the same functions needed to move the arrow around the screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Interface Segregation Principle
&lt;/h3&gt;

&lt;p&gt;A class should never be forced to implement an attribute from an interface which the class doesn't need.&lt;/p&gt;

&lt;p&gt;Consider it like, when you create an interface for game object movement, the main game object (the player character) has the ability to walk, run, climb and dash, adding these to the object movement interface will violate this principle if this interface will be implemented as well with a patrol type enemy, which doesn't need the other functions other than walk or run.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependency Inversion Principle
&lt;/h3&gt;

&lt;p&gt;This allows decoupling... but wait, what is decoupling?&lt;br&gt;
According to google, decoupling means&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;separate, disengage, or dissociate (something) from something else.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hmm.. I still find this vague. If anyone can explain this to me like I'm a 12 years old, please do. But I will update this later if ever I get the whole idea.&lt;/p&gt;

&lt;p&gt;I read SOLID principle from &lt;a href="https://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-designhttps://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design"&gt;https://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-designhttps://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design&lt;/a&gt;&lt;/p&gt;

</description>
      <category>solidprinciple</category>
      <category>solid</category>
      <category>principle</category>
    </item>
  </channel>
</rss>
