<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by silsly on Medium]]></title>
        <description><![CDATA[Stories by silsly on Medium]]></description>
        <link>https://medium.com/@silsly?source=rss-ae20e3a65d7d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*C7e4JltwhGHf90BKXvPu9Q.png</url>
            <title>Stories by silsly on Medium</title>
            <link>https://medium.com/@silsly?source=rss-ae20e3a65d7d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 11:17:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@silsly/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Command PhaseScriptExecution failed with a nonzero exit code]]></title>
            <link>https://silsly.medium.com/command-phasescriptexecution-failed-with-a-nonzero-exit-code-57998c13615e?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/57998c13615e</guid>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Wed, 06 Nov 2024 17:38:23 GMT</pubDate>
            <atom:updated>2024-11-06T17:38:23.614Z</atom:updated>
            <content:encoded><![CDATA[<p>Android application still running well, but cannot run in ios.</p><p>Xcode says “Command PhaseScriptExecution failed with a nonzero exit code”</p><blockquote>Solution is : please login to your apple account</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57998c13615e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter widget rebuilding when TextField widget clicked]]></title>
            <link>https://silsly.medium.com/flutter-widget-rebuilding-when-textfield-widget-clicked-93be558a46ee?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/93be558a46ee</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Thu, 29 Aug 2024 10:30:11 GMT</pubDate>
            <atom:updated>2024-08-29T10:30:11.213Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why my ui always rebuild when focus textfield?</h3><p>When you click on TextField then build() method is called automatically by flutter. It seems your all widget is recreate again.</p><p>There is two responsibilities :</p><ol><li>Remove your <strong>MediaQuery</strong>. When keyboard popup, it will change the size of your screen. And it causing ui rebuild.</li><li>Declare your <strong>GlobalKey&lt;FormState&gt; formKey </strong>as static and outside of your build() method. So your <strong>formKey</strong> just called once.</li></ol><p>Just try it, good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93be558a46ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Version]]></title>
            <link>https://silsly.medium.com/android-version-eff92df0047c?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/eff92df0047c</guid>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Tue, 23 Mar 2021 03:28:30 GMT</pubDate>
            <atom:updated>2021-03-23T03:29:25.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setting Android Version</h3><p>in pubspec.yaml you can see this.</p><pre><strong>version</strong>: A.B.C+X</pre><pre>or for example</pre><pre><strong>version</strong>: 1.0.0+1</pre><p>What’s mean?</p><p><strong>For Android:</strong></p><p>A.B.C represents the versionName such as 1.0.0.</p><p>X (the number after the +) represents the versionCode such as 1, 2, 3, etc.</p><p><strong>Do not forget</strong> to execute flutter build or flutter run after this step, because: When you run flutter build or flutter run after updating this version in the pubspec file, the versionName and versionCode in local.properties are updated which are later picked up in the build.gradle (app) when you build your flutter project using flutter build or flutter run which is ultimately responsible for setting the versionName and versionCode for the apk.</p><p><strong>For iOS:</strong></p><p>A.B.C represents the CFBundleShortVersionString such as 1.0.0.</p><p>X (the number after the +) represents the CFBundleVersion such as 1, 2, 3, etc.</p><p><strong>Do not forget</strong> to execute flutter build or flutter run after this step.</p><p>Thanks for this share :</p><p><a href="https://stackoverflow.com/questions/53570575/flutter-upgrade-the-version-code-for-play-store">Flutter: upgrade the version code for play store</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eff92df0047c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354)) Flutter]]></title>
            <link>https://silsly.medium.com/certificate-verify-failed-unable-to-get-local-issuer-certificate-handshake-cc-354-flutter-8180dbb45e68?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/8180dbb45e68</guid>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Fri, 19 Mar 2021 03:54:42 GMT</pubDate>
            <atom:updated>2021-03-19T03:54:42.309Z</atom:updated>
            <content:encoded><![CDATA[<p>I found this issue when running application in Android Version 19 (KitKat). Damage for this case, my application cannot request HTTP post (the result return null). Even though this application running well in Android Version above 20 (Lollipop).</p><p>Then i found this solution, maybe you can try it.</p><p>Solution :</p><ol><li>Reconfig SSLCertificateChainFile in Apache Server</li><li>Forced allow all certificate when application running</li></ol><p>I try the second solution, just add this codes…</p><pre>try {<br>  final ioc = new HttpClient();<br>  ioc.badCertificateCallback = (X509Certificate cert, String host, int port) =&gt; true;<br>  final http = new IOClient(ioc);<br>  http.post(&#39;url&#39;, body: {&quot;email&quot;: &quot;xyz@xyz.com&quot;, &quot;password&quot;: &quot;1234&quot;}).then((response) {<br>  print(&quot;Reponse status : ${response.statusCode}&quot;);<br>  print(&quot;Response body : ${response.body}&quot;);<br>  var myresponse = jsonDecode(response.body);<br>  String token = myresponse[&quot;token&quot;];<br> });<br>} catch (e) {<br>  print(e.toString());<br>}</pre><p><a href="https://stackoverflow.com/questions/54285172/how-to-solve-flutter-certificate-verify-failed-error-while-performing-a-post-req">how to solve flutter CERTIFICATE_VERIFY_FAILED error while performing a POST request?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8180dbb45e68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app]]></title>
            <link>https://silsly.medium.com/the-gradle-failure-may-have-been-because-of-androidx-incompatibilities-in-this-flutter-app-d9376ee7a07b?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9376ee7a07b</guid>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[androidx]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Fri, 19 Apr 2019 05:01:13 GMT</pubDate>
            <atom:updated>2019-04-19T05:04:21.079Z</atom:updated>
            <content:encoded><![CDATA[<p>If you find the error like this..</p><pre>FAILURE: Build failed with an exception.</pre><pre>* What went wrong:<br>Execution failed for task ‘:location:compileDebugJavaWithJavac’.<br>&gt; Compilation failed; see the compiler error output for details.</pre><pre>* Try:<br>Run with — stacktrace option to get the stack trace. Run with — info or — debug option to get more log output. Run with — scan to get full insights.</pre><pre>* Get more help at <a href="https://help.gradle.org/">https://help.gradle.org</a></pre><pre>BUILD FAILED in 42s<br>Finished with error: Gradle task assembleDebug failed with exit code 1<br>*******************************************************************************************<br>The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.<br>See <a href="https://goo.gl/CP92wY">https://goo.gl/CP92wY</a> for more information on the problem and how to fix it.<br>*******************************************************************************************</pre><p>or like this..</p><pre>Running Gradle task ‘assembleDebug’…<br>registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)<br>registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)<br>registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)<br>registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)<br>registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)</pre><p>or like this..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZErMiwtS6PhAZQRbRO4rKA.png" /></figure><p>It may be happened when you have multiple gradle in one project, the solution is just recheck your gradle.properties, delete the old one, and use the newest one</p><pre><strong>gradle-4.10.1</strong></pre><p>Next, follow this steps :</p><ol><li>Use the newest gradle version and delete the others</li><li>File &gt; Invalidate Caches, Restart</li><li>Build &gt; Clean Project or flutter clean</li><li>File &gt; Sync with All System</li><li>Add this path in gradle-wrapper.properties <strong>distributionUrl</strong>=<strong>https://services.gradle.org/distributions/gradle-4.10.1-all.zip</strong></li><li>See the logcat and find the error, in the above we can see that library <strong>PackageInfo</strong> has deprecated <em>(PackageInfo.java uses unchecked or unsafe operations)</em>. So, fix it by using the newest version of that library (check in <a href="https://pub.dartlang.org/">https://pub.dartlang.org</a>). Use and install it. Run packages get. Done.</li><li>Now run again the project</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9376ee7a07b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Form Validation Flutter]]></title>
            <link>https://silsly.medium.com/form-validation-flutter-e740acb6b32e?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e740acb6b32e</guid>
            <category><![CDATA[regex]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[validator]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Mon, 08 Apr 2019 04:38:16 GMT</pubDate>
            <atom:updated>2019-04-08T04:43:03.414Z</atom:updated>
            <content:encoded><![CDATA[<p>Sebelum <em>user</em> memasukkan inputan pada <em>TextFormField</em>, ada baiknya sistem dapat memvalidasi sebelum data dikirim ke <em>database server</em>. <em>Validator </em>yang kali ini digunakan yaitu <strong>RegEx</strong>. Mari kita kulik dulu yah.</p><p><strong>Regular Expression (RegEx)</strong></p><p>Adalah konstruksi bahasa untuk mencocokkan teks berdasarkan pola tertentu, terutama untuk kasus-kasus kompleks. Contoh misalkan mencari teks berawalan karakter tertentu, memiliki jumlah perulangan dari suatu teks, dan lain sebagainya.</p><p><strong>Struktur RegEx</strong></p><ol><li>GlobalKey&lt;FormState&gt;</li><li>key: formKey</li><li>validate: autoValidate</li><li>if (formKey.currentState.validate())</li></ol><p><strong>Contoh RegEx</strong></p><pre>import &#39;package:flutter/material.dart&#39;;</pre><pre>void main() {<br>  runApp(new MaterialApp(<br>    debugShowCheckedModeBanner: false,<br>    home: new ChangeEmailUi(),<br>  ));<br>}<br><br>class ChangeEmailUi extends StatefulWidget {<br>  @override<br>  _ChangeEmailUiState createState() =&gt; _ChangeEmailUiState();<br>}</pre><pre>class _ChangeEmailUiState extends State&lt;ChangeEmailUi&gt; {</pre><pre>  bool autoValidate = false;<br>  String email;<br>  final inputEmailController = new TextEditingController();<br>  final GlobalKey&lt;FormState&gt; formKey = GlobalKey&lt;FormState&gt;();<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: Scaffold(<br>        body: Form(<br>          key: formKey,<br>          autovalidate: autoValidate,<br>          child: Column(children: &lt;Widget&gt;[<br>            SizedBox(height: 100.0,),<br>            TextFormField(<br>              keyboardType: TextInputType.<em>emailAddress</em>,<br>              controller: inputEmailController,<br>              validator: validateEmail,<br>              onSaved: (value){<br>                email = value;<br>              },<br>              decoration: InputDecoration(<br>                hintText: &#39;Email Address&#39;<br>              ),<br>            ),<br><br>            RaisedButton(<br>              child: Text(&#39;Change Email&#39;),<br>              onPressed: (){<br>                validateInputs();<br>              },)<br>          ],),<br>        ),<br>      ),<br>    );<br>  }<br><br>  String validateEmail(String value) {<br>    Pattern pattern =<br>        r&#39;^(([^&lt;&gt;()[\]\\.,;:\s@\&quot;]+(\.[^&lt;&gt;()[\]\\.,;:\s@\&quot;]+)*)|(\&quot;.+\&quot;))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$&#39;;<br>    RegExp regex = new RegExp(pattern);<br>    if (!regex.hasMatch(value))<br>      return &#39;Enter Valid Email&#39;;<br>    else<br>      return null;<br>  }<br><br>  void validateInputs() {<br>    if (formKey.currentState.validate()) {<br>      formKey.currentState.save();<br>      print(&#39;SUCCESS input email address&#39;);<br>    } else {<br>      print(&#39;FAILED input email address&#39;);<br>      setState(() {<br>        autoValidate = true;<br>      });<br>    }<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e740acb6b32e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter]]></title>
            <link>https://silsly.medium.com/flutter-30a487eb450e?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/30a487eb450e</guid>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Thu, 20 Dec 2018 07:11:21 GMT</pubDate>
            <atom:updated>2018-12-20T07:11:21.789Z</atom:updated>
            <content:encoded><![CDATA[<p>Multiplatform application (Android dan iOS)</p><p><strong>Cara Instalasi</strong></p><ol><li>Download <em>flutter sdk</em> <a href="https://flutter.io/docs/get-started/install"><strong>di sini</strong></a> atau <a href="https://flutter.io/docs/development/tools/sdk/archive"><strong>di sini</strong></a>, gunakan versi yang sudah stabil. Pada kali ini saya menggunakan versi v1.0.0 pada windows.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hfHoeUfwMVGFu5z0eJ4jww.png" /></figure><p>2. Ekstrak file flutter ke dalam direktori. Kali ini saya ektraksi ke folder <em>D:\</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*7gzB4chRZtcsSsuxx9Jt5w.png" /></figure><p>3. Buka Android Studio. Masukan plugin flutter ke dalam Android Studio <em>Configure&gt;Plugins</em>. Kemudian pilih <em>Browse Repositories </em>dan search <em>”Flutter” </em>dan install flutter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*s8mkhJ0p84IKTVDl8DT61Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*hZLZ2-49NHHa-AJXf1q4UA.png" /></figure><p>Setelah flutter berhasil ditambah, akan muncul notifikasi instalasi plugin <em>“Dart”</em> silakan lanjutkan install.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*DOtZRdEBGqieW0f1spBA-g.png" /></figure><p>4. Tunggu hingga proses instalasi selesai, restart Android Studio. Sehingga tampilan di awal menjadi seperti ini. Pilih <em>“Start a new Flutter project”</em> untuk projek pertama anda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*d5DWG_8u7eHk9MiX_06tnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*TjlrHCE__H7efX-VKvtgqA.png" /></figure><p>Beri nama projek dengan huruf kecil dan tanpa spasi (gunakan “_”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*QaVTIFU7TPuWgkXemkVYrQ.png" /></figure><p>Klik <em>“Finish”</em> kemudian tunggu sampai proses building projek selesai.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*roXmbi-t3FlVxnwAPM_zmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*tUVwGgK__QRrvgP8z5ju7Q.png" /></figure><p>Jika muncul error seperti ini <em>“Flutter create command was unsuccessful” </em>maka terdapat beberapa tahapan yang mungkin terlewatkan. Oleh karena itu, jalankan langkah berikut:</p><ol><li>Download Git for Windows <a href="https://git-scm.com/download/win"><strong><em>di sini</em></strong></a><strong><em> </em></strong>, kemudian install. Ketik dan jalankan kode ini git clone -b beta <a href="https://github.com/flutter/flutter.git">https://github.com/flutter/flutter.git</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*WiYLLg4COtI9TgtoEwVqkA.png" /></figure><p>2. Kemudian buka<em> “Control Panel &gt; User Accounts &gt; User Accounts &gt; Change my environment variables”&gt;Path</em>. Masukan pathnya %USERPROFILE%\flutter\bin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*LLqTI8O8t_TP9srwykDCpg.png" /></figure><p>3. Restart Windows</p><p>4. Buka terminal dan jalankan perintah C:\flutter doctor. Tunggu hingga proses instalasi selesai, done.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30a487eb450e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Showing bottom navigation view with 3+ menu items]]></title>
            <link>https://silsly.medium.com/showing-bottom-navigation-view-with-3-menu-items-cc8290d4dcbe?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc8290d4dcbe</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[bottomnavigationview]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Mon, 15 Oct 2018 09:49:13 GMT</pubDate>
            <atom:updated>2018-10-15T16:59:01.036Z</atom:updated>
            <content:encoded><![CDATA[<h3>Showing BottomNavigationView with 3+ Menu Items</h3><ul><li>Make BottomNavigationViewHelper.class</li></ul><pre>import android.annotation.SuppressLint;<br>import android.support.design.internal.BottomNavigationItemView;<br>import android.support.design.internal.BottomNavigationMenuView;<br>import android.support.design.widget.BottomNavigationView;<br>import java.lang.reflect.Field;<br><br>    public class BottomNavigationViewHelper {<br>        @SuppressLint(&quot;RestrictedApi&quot;)<br>        public static void removeShiftMode(BottomNavigationView view) {<br>            BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);<br>            try {<br>                Field shiftingMode = menuView.getClass().getDeclaredField(&quot;mShiftingMode&quot;);<br>                shiftingMode.setAccessible(true);<br>                shiftingMode.setBoolean(menuView, false);<br>                shiftingMode.setAccessible(false);<br>                for (int i = 0; i &lt; menuView.getChildCount(); i++) {<br>                    BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);<br>                    //noinspection RestrictedApi<br>                    item.setShiftingMode(false);<br>                    // set once again checked value, so view will be updated<br>                    //noinspection RestrictedApi<br>                    item.setChecked(item.getItemData().isChecked());<br>                }<br>            } catch (NoSuchFieldException e) {<br>                Log.e(&quot;BottomNav&quot;, &quot;Unable to get shift mode field&quot;, e);<br>            } catch (IllegalAccessException e) {<br>                Log.e(&quot;BottomNav&quot;, &quot;Unable to change value of shift mode&quot;, e);<br>            }<br>        }<br>    }</pre><ul><li>Call it in MainActivity.class</li></ul><pre>BottomNavigationView bottomNavigationView = (BottomNavigationView)findViewById(R.id.bottom_navigation);<br>BottomNavigationViewHelper.removeShiftMode(bottomNavigationView);</pre><ul><li>Set bottom_bar_menu.xml</li></ul><pre>&lt;item android:id=&quot;@id/menu_item&quot;<br>android:title=&quot;text&quot;<br>android:icon=&quot;@drawable/drawable_resource_name&quot;<br>android:showAsAction=&quot;always|withText&quot; /&gt;</pre><ul><li>Set in dimens.xml</li></ul><pre>&lt;resources xmlns:tools=&quot;http://schemas.android.com/tools&quot;&gt;<br>    &lt;dimen name=&quot;design_bottom_navigation_text_size&quot; tools:override=&quot;true&quot;&gt;8sp&lt;/dimen&gt;<br>    &lt;dimen name=&quot;design_bottom_navigation_active_text_size&quot; tools:override=&quot;true&quot;&gt;12sp&lt;/dimen&gt;<br>&lt;/resources&gt;</pre><blockquote>But if you use Android sdk version 28, try to update codes</blockquote><p>In Android SDK version 28 and above they have changed :</p><ol><li><strong>item.setShiftingMode(false)</strong> to <strong>item.setShifting(false)</strong></li><li>Then also they removed the field <strong>mShiftingMode</strong></li></ol><blockquote>So usage will be like this</blockquote><ul><li>MainActivity.class</li></ul><pre>BottomNavigationHelper.removeShiftMode(bottomNav);<br> bottomNav.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED);</pre><ul><li>BottomNavigationHelper.class</li></ul><pre>private static final class BottomNavigationHelper {<br>    @SuppressLint(&quot;RestrictedApi&quot;)<br>    static void removeShiftMode(BottomNavigationView view) {<br>        BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);<br>        for (int i = 0; i &lt; menuView.getChildCount(); i++) {<br>            BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);<br>            //noinspection RestrictedApi<br>            item.setShifting(false);<br>            item.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED);<br><br>            // set once again checked value, so view will be updated<br>            //noinspection RestrictedApi<br>            item.setChecked(item.getItemData().isChecked());<br>        }<br>    }<br>}</pre><blockquote>Running apps, and the result is …</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*0z97znHQDdCX5wNYmlr4wg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc8290d4dcbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android ListView GetView Called Too Much Times]]></title>
            <link>https://silsly.medium.com/android-listview-getview-called-too-much-times-7128a98930a4?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7128a98930a4</guid>
            <category><![CDATA[listview]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[multiplelooping]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Thu, 17 May 2018 02:48:04 GMT</pubDate>
            <atom:updated>2018-05-17T02:48:04.195Z</atom:updated>
            <content:encoded><![CDATA[<p>Dont use your ListView height = “<strong>wrap_content</strong>” . Just change your listView height equals to <strong>fill_parent or match_parent</strong> and try it again.</p><pre>&lt;ListView<br>    android:id=&quot;@+id/lv&quot;<br>    android:layout_width=&quot;<strong>match_parent</strong>&quot;<br>    android:layout_height=&quot;<strong>match_parent</strong>&quot;<br>    android:dividerHeight=&quot;5dp&quot;<br>    android:divider=&quot;@null&quot;&gt;&lt;/ListView&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*PoYFd8u1-E2I7uuSac6ylA.png" /><figcaption>Before -&gt; Multiple Looping</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*iJAyizgJH25dhax5hIu5jg.png" /><figcaption>After -&gt; Normal Looping</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7128a98930a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dagger 2 Android]]></title>
            <link>https://silsly.medium.com/dagger-2-android-2f66e031eacf?source=rss-ae20e3a65d7d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f66e031eacf</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[dagger-2]]></category>
            <dc:creator><![CDATA[silsly]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 17:23:13 GMT</pubDate>
            <atom:updated>2018-04-19T17:24:13.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*hlFGgtG2Aa1qsxtDRb0PlA.jpeg" /></figure><p>Salah satu library yang digunakan oleh <em>developer </em>untuk menerapkan konsep <em>Dependency Injection</em></p><blockquote>“Dependency Injection (DI) is a design pattern that demonstrates how to create loosely coupled classes”</blockquote><p><strong>Dependency Injection (DI)</strong> adalah sebuah <em>design pattern</em> yang menunjukkan bagaimana cara untuk membuat <em>loosely coupled classes. </em>Maksudnya yaitu mengurangi terjadinya <em>class </em>yang saling ketergantungan satu sama lain, sehingga <em>developer </em>tidak perlu khawatir akan adanya <em>bugs </em>pada salah satu <em>class </em>yang sewaktu-waktu akan diubah.</p><h4><strong>Keuntungan</strong></h4><ul><li>Data fleksible/dinamis</li><li>Mengurangi kemungkinan bugs</li><li>Mengurangi <em>line of code</em></li><li>Mempercepat performa aplikasi</li></ul><h4>Contoh Kasus</h4><p>Di bawah ini merupakan contoh aplikasi yang akan menampilkan notifikasi berita pada <em>notifbar</em>. Berikut contoh <em>code</em>nya:</p><p><strong><em>Notification.class</em></strong><em>,</em> yaitu kelas yang berisi perintah logika untuk mengirimkan notifikasi ke aplikasi pengguna.</p><pre><strong>public class</strong> <strong>Notification </strong>{<br>   public void sendNotification(String title, String content){<br>      Toast.<em>makeText</em>(this, title +&quot;, &quot; +content,  <br>      Toast.<em>LENGTH_SHORT</em>).show();<br>   }<br>}</pre><p><strong><em>MyProcess.class</em></strong>, yaitu kelas yang nantinya akan menjalankan perintah yang terdapat di kelas <strong><em>Notification</em></strong><em>.</em></p><pre><strong>public class MyProcess </strong>{<br>   private Notification notification = new Notification();<br><br>   public void processNotification(String title, String content){<br>      this.notification.sendNotification(title, content);<br>   }<br>}</pre><p>Memang perintah <em>logic </em>di atas sudah benar dan dapat dijalankan secara baik, hanya saja terdapat sedikit kekurangan dan dapat menjadi celah terjadinya <em>bugs. </em>Kelas <strong>MyProcess </strong>hanya bertugas untuk memproses notifikasi dari kelas <strong>Notification</strong>. Padahal bisa saja kelas lain juga membutuhkan proses notifikasi dengan variabel yang berbeda dengan kelas <strong>Notification</strong>. Tentunya ini dirasa tidak fleksibel sehingga membutuhkan extra waktu dan tenaga bagi <em>developer </em>untuk mengubah struktur kelas agar dinamis. Namun permasalahan ini tentunya dapat diatasi dengan menggunakan <strong>Dependency Injection</strong>.</p><p>Solusinya yaitu dengan mengubah <em>logic. </em>Pada kelas <strong>MyProcess </strong>tidak lagi mengurusi inisialisasi kelas <strong>Notification</strong>, melainkan hanya menerima objek dari <strong>Notification </strong>saja. Berikut <em>code</em>nya:</p><pre><strong>public class MyProcess </strong>{<br>   private Notification notification;</pre><pre>   public MyProcess(Notification notification) {<br>      this.notification = notification;<br>   }</pre><pre>   public void processNotification(String title, String content) {<br>      this.notification.sendNotification(title, content);<br>   }<br>}</pre><p>Dan tambahkan kelas <strong>MainActivity</strong>:</p><pre><strong>public class MainActivity extends Activity </strong>{<br><br>   private Notification notification;          // Model         <br>   private MyProcess process;                  // Logic<br><br>      @Override<br>      public void onCreate() {<br>         notification= new Notification();     // Inisialisasi model      <br>         process= new MyProcess(notification); // Perintah logic<br>        }<br>    }</pre><p><strong>Kesimpulan: </strong>Dengan begitu kelas apapun meskipun memiliki model kelas yang berbeda tetap akan bisa menggunakan perintah <em>logic sendNotification </em>yang ada pada kelas <strong>MyProcess</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f66e031eacf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>