

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UI &#8211; Max的程式語言筆記</title>
	<atom:link href="https://stackoverflow.max-everyday.com/tag/ui/feed/" rel="self" type="application/rss+xml" />
	<link>https://stackoverflow.max-everyday.com</link>
	<description>我要當一個豬頭，快樂過每一天</description>
	<lastBuildDate>Mon, 11 Dec 2017 07:12:04 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://stackoverflow.max-everyday.com/wp-content/uploads/2017/02/max-stackoverflow-256.png</url>
	<title>UI &#8211; Max的程式語言筆記</title>
	<link>https://stackoverflow.max-everyday.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>處理App icon</title>
		<link>https://stackoverflow.max-everyday.com/2017/09/app-icon/</link>
					<comments>https://stackoverflow.max-everyday.com/2017/09/app-icon/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Thu, 28 Sep 2017 06:51:10 +0000</pubDate>
				<category><![CDATA[Android筆記]]></category>
		<category><![CDATA[電腦相關應用]]></category>
		<category><![CDATA[UI]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=1418</guid>

					<description><![CDATA[之前都是使用 makeappicon 網站來做 ...]]></description>
										<content:encoded><![CDATA[<p>之前都是使用 <a href="http://makeappicon.com/">makeappicon</a> 網站來做 app icon, 後來發現 <a href="https://romannurik.github.io/AndroidAssetStudio/">Android Asset Studio</a> 也很好用，可以用來處理簡單的 icon. Android Asset Studio網站上看到的icon 也可以在 github 裡下載的到：</p>
<p><a href="https://github.com/google/material-design-icons">https://github.com/google/material-design-icons</a></p>
<p>附註：在github 上最多只能瀏覽 1000 個檔案，而且預覽不方便，建議 git clone 或 download 下來會方便一點。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4>相關網站：</h4>
<p>makeappicon<br />
<a href="http://makeappicon.com/">http://makeappicon.com/</a></p>
<p>Android Asset Studio<br />
<a href="https://romannurik.github.io/AndroidAssetStudio/">https://romannurik.github.io/AndroidAssetStudio/</a></p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2017/09/app-icon/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to close an ActionMode menu programmatically?</title>
		<link>https://stackoverflow.max-everyday.com/2017/03/how-to-close-an-actionmode-menu-programmatically/</link>
					<comments>https://stackoverflow.max-everyday.com/2017/03/how-to-close-an-actionmode-menu-programmatically/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Thu, 23 Mar 2017 18:36:47 +0000</pubDate>
				<category><![CDATA[Android筆記]]></category>
		<category><![CDATA[Dropboxlike開發筆記]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Dropboxlike]]></category>
		<category><![CDATA[UI]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=390</guid>

					<description><![CDATA[這個 ActionMode 用起來滿神奇的，他幾...]]></description>
										<content:encoded><![CDATA[<p>這個 ActionMode 用起來滿神奇的，他幾乎算是一個特定區塊的dialog，但是和 dialog 不同的是會和上一個 activity overlap 在一起，並可以存取 parent fragment 或 activity 裡的變數內容，更像是 toolbar 的概念。</p>
<p>要開始／結束 ActionMode 是用：</p>
<p>Whenever you are creating/starting ActionMode Create by</p>
<pre class="default prettyprint prettyprinted"><code><span class="pln">mMode </span><span class="pun">=</span><span class="pln"> startActionMode</span><span class="pun">(....);</span></code></pre>
<p>To Dismiss it use following Syntax</p>
<pre class="default prettyprint prettyprinted"><code><span class="kwd">if</span> <span class="pun">(</span><span class="pln">mMode </span><span class="pun">!=</span> <span class="kwd">null</span><span class="pun">)</span> 
 <span class="pun">{</span><span class="pln">
     mMode</span><span class="pun">.</span><span class="pln">finish</span><span class="pun">();</span>
 <span class="pun">}

</span></code></pre>
<p>from:<br />
<a href="http://stackoverflow.com/questions/11158957/how-to-close-an-actionmode-menu-programmatically-on-honeycomb">http://stackoverflow.com/questions/11158957/how-to-close-an-actionmode-menu-programmatically-on-honeycomb</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2017/03/how-to-close-an-actionmode-menu-programmatically/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Android] 漂亮的欄位輸入介面 TextInputLayout</title>
		<link>https://stackoverflow.max-everyday.com/2016/10/android-%e6%bc%82%e4%ba%ae%e7%9a%84%e6%ac%84%e4%bd%8d%e8%bc%b8%e5%85%a5%e4%bb%8b%e9%9d%a2-textinputlayout/</link>
					<comments>https://stackoverflow.max-everyday.com/2016/10/android-%e6%bc%82%e4%ba%ae%e7%9a%84%e6%ac%84%e4%bd%8d%e8%bc%b8%e5%85%a5%e4%bb%8b%e9%9d%a2-textinputlayout/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Fri, 21 Oct 2016 16:56:47 +0000</pubDate>
				<category><![CDATA[Android筆記]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[UI]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=70</guid>

					<description><![CDATA[之前使用的文字輸入介面，只有使用一個 EditT...]]></description>
										<content:encoded><![CDATA[<p>之前使用的文字輸入介面，只有使用一個 EditText 加 Hint(或稱為Placehole) 就結束了，在使用者輸入資料之前，是可以看的到欄位名稱沒錯，但使用者填完之後之後，畫面上會變成一堆的文字，不知道什麼值要對應到什麼欄位。</p>
<p>參考了 <a href="https://github.com/haiwen/seadroid">seafile</a> 的account_detail.xml寫法，完成後的畫面如下:</p>
<p><a href="http://max-everyday.com/wp-content/uploads/2016/10/Screenshot_2016-10-22-08-44-17-191_com.lwfd_.hiftp_.png"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-1557" src="http://max-everyday.com/wp-content/uploads/2016/10/Screenshot_2016-10-22-08-44-17-191_com.lwfd_.hiftp_.png" alt="screenshot_2016-10-22-08-44-17-191_com-lwfd-hiftp" width="480" height="853" /></a></p>
<p>滿神奇的，還可以顯示password 欄位值的值為明碼。還會有欄名縮放＋移動位置的動畫，滿酷的，附上的我 layout xml 檔:</p>
<blockquote>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/activity_login"
    tools:context="com.lwfd.hiftp.LoginActivity"&gt;

    &lt;android.support.design.widget.TextInputLayout
        android:id="@+id/ip_hint"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_width="368dp"
        android:layout_height="wrap_content"
        android:paddingTop="@dimen/activity_horizontal_margin"
        &gt;
        &lt;EditText
            android:id="@+id/ip"
            android:hint="@string/prompt_ip"
            android:inputType="textUri"
            android:maxLines="1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/et_margin_bottom"
            android:layout_marginLeft="@dimen/auto_complete_ed_margin_left"
            android:layout_marginRight="@dimen/auto_complete_ed_margin_right"
            android:fontFamily="sans-serif"
            /&gt;

    &lt;/android.support.design.widget.TextInputLayout&gt;

    &lt;android.support.design.widget.TextInputLayout
        android:id="@+id/port_hint"
        app:layout_constraintTop_toBottomOf="@+id/ip_hint"
        app:layout_constraintLeft_toLeftOf="@+id/ip_hint"
        android:layout_width="368dp"
        android:layout_height="wrap_content"&gt;

        &lt;EditText
            android:inputType="number"
            android:text="@string/default_port"
            android:id="@+id/port"
            android:hint="@string/prompt_port"
            android:maxLines="1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/et_margin_bottom"
            android:layout_marginLeft="@dimen/auto_complete_ed_margin_left"
            android:layout_marginRight="@dimen/auto_complete_ed_margin_right"
            android:fontFamily="sans-serif"
            /&gt;
    &lt;/android.support.design.widget.TextInputLayout&gt;



    &lt;android.support.design.widget.TextInputLayout
        android:id="@+id/account_hint"
        app:layout_constraintTop_toBottomOf="@+id/port_hint"
        app:layout_constraintLeft_toLeftOf="@+id/ip_hint"
        android:layout_width="368dp"
        android:layout_height="wrap_content"&gt;

        &lt;EditText
            android:text="@string/default_id"
            android:id="@+id/account"
            android:maxLines="1"
            android:hint="@string/prompt_account"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/et_margin_bottom"
            android:layout_marginLeft="@dimen/auto_complete_ed_margin_left"
            android:layout_marginRight="@dimen/auto_complete_ed_margin_right"
            android:fontFamily="sans-serif"
            /&gt;

    &lt;/android.support.design.widget.TextInputLayout&gt;


    &lt;android.support.design.widget.TextInputLayout
        android:id="@+id/password_hint"
        android:layout_width="368dp"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/account_hint"
        app:layout_constraintLeft_toLeftOf="@+id/ip_hint"
        &gt;

        &lt;EditText
            android:id="@+id/password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/et_margin_bottom"
            android:layout_marginLeft="@dimen/auto_complete_ed_margin_left"
            android:layout_marginRight="@dimen/auto_complete_ed_margin_right"
            android:fontFamily="sans-serif"
            android:hint="@string/prompt_password"
            android:inputType="textPassword" /&gt;
    &lt;/android.support.design.widget.TextInputLayout&gt;

    &lt;Button
        android:text="@string/action_save"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:id="@+id/save_button"

        app:layout_constraintTop_toBottomOf="@+id/password_hint"
        app:layout_constraintLeft_toLeftOf="@+id/ip_hint"
        android:paddingBottom="@dimen/long_btn_padding_bottom"
        android:paddingTop="@dimen/long_btn_padding_top"
        android:layout_marginLeft="@dimen/long_btn_margin_left"
        android:layout_marginStart="@dimen/long_btn_margin_left"
        android:textAllCaps="false"/&gt;


&lt;/android.support.constraint.ConstraintLayout&gt;</pre>
</blockquote>
<p>Android 新的 ConstraintLayout，還滿好玩用，目前操作起來優點似乎滿多的，但目前還是 beta, 而且1~2天就改一個版號，目前出到  1.0.0 beta 了，也許過一陣子會更穩定一點。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2016/10/android-%e6%bc%82%e4%ba%ae%e7%9a%84%e6%ac%84%e4%bd%8d%e8%bc%b8%e5%85%a5%e4%bb%8b%e9%9d%a2-textinputlayout/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Android] 實作LINE Login，增加按鈕到PreferenceFragment</title>
		<link>https://stackoverflow.max-everyday.com/2016/08/add-buttons-to-preferencefragment/</link>
					<comments>https://stackoverflow.max-everyday.com/2016/08/add-buttons-to-preferencefragment/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Tue, 02 Aug 2016 16:47:06 +0000</pubDate>
				<category><![CDATA[Android筆記]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[BOT]]></category>
		<category><![CDATA[LINE]]></category>
		<category><![CDATA[UI]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=56</guid>

					<description><![CDATA[在實作 LINE Login 時，送出要切換 c...]]></description>
										<content:encoded><![CDATA[<p>在實作 LINE Login 時，送出要切換 channel 從 developing 為 published 的申請，LINE 官方回email說需要在畫面上看到 LINE Loing 的 button, 由於是把 line login 放在  perferencefragment裡，但是很久很久以前在實作 PreferenceFragment 時, 發現沒有 button 可以用, 無法做設定參數以外的事情,很久以前的解法是要分成2個 xml 檔案，或同一個xml 放2個 layout，解決完的畫面如下:</p>
<p><a href="http://max-everyday.com/wp-content/uploads/2016/08/Screenshot_2014-10-15-19-30-41.png"><img decoding="async" class="alignnone wp-image-1065 size-medium" src="http://max-everyday.com/wp-content/uploads/2016/08/Screenshot_2014-10-15-19-30-41-500x500.png" alt="Screenshot_2014-10-15-19-30-41" width="500" height="500" /></a></p>
<p>在研究了一下 <a href="https://github.com/haiwen/seadroid">seafile</a> 的作法，他也沒有解決這個問題，可能是沒有這個需求，seafile 的作法在是 layout/preference_list_fragment.xml 裡放多個 layout, listview 的部份留給 preference fragment 使用。</p>
<hr />
<p>我發現，照著 solar/<a href="https://gist.github.com/solar/1002049/">IconPreference.java</a> 使用的範例，可以做出 button preference 也可以在程式碼裡動態地修改 button 裡的文字。解決完的畫面如下:</p>
<p><a href="http://max-everyday.com/wp-content/uploads/2016/08/Screenshot_2016-08-03-03-37-03_com.miui_.home_.png"><img decoding="async" class="alignnone wp-image-1066 size-medium" src="http://max-everyday.com/wp-content/uploads/2016/08/Screenshot_2016-08-03-03-37-03_com.miui_.home_-281x500.png" alt="Screenshot_2016-08-03-03-37-03_com.miui.home" width="281" height="500" /></a></p>
<p>只是，比較特別的是 Fragment 裡的 ListView 用來顯示 Preference, Preference 被建立後 protected void onBindView(View view) 的時間點在 Fragment onCreate() 或  Fragment 的 onCreateView 之後，所以無法直接塞 onClick 事件給自定設定的 ButtonPreference 來使用，解法是把要做的事件先放到 新建立的ButtonPreference 裡，等 ButtonPreference 在 onBindView 後，並存取到 button 時，再用 setOnClickListener() 來執行該方法。</p>
<p>從畫面可以看到，原本有button 的應該長的像他上面那行，用Facebook 登入，是用文字。會想挑戰這個解法是因為 LINE Developer 回信給我，說「LINE Login」 的按鈕，規格不符。於是我就從<a href="https://developers.line.me/web-login/setting-up-login-button">網頁版</a>下載了圖片＋文字來用，但很怪，LINE 他們只提供了&#8221;Log In&#8221; 的多國語言字串，卻沒提供 Log Out 的。</p>
<p>整組程式都寫好，最後要送出申請為「已發佈」(Published) 被 LINE 的人打搶，被打搶的Email:</p>
<figure id="attachment_2286" aria-describedby="caption-attachment-2286" style="width: 1344px" class="wp-caption alignnone"><a href="http://max-everyday.com/wp-content/uploads/2016/08/Screenshot-2017-01-04-17.21.45.jpg"><img loading="lazy" decoding="async" class="wp-image-2286 size-full" src="http://max-everyday.com/wp-content/uploads/2016/08/Screenshot-2017-01-04-17.21.45.jpg" width="1344" height="1156" /></a><figcaption id="caption-attachment-2286" class="wp-caption-text">Request was reject by our review criteria.</figcaption></figure>
<p>Facebook login 和 LINE Login 相比：</p>
<ul>
<li>Facebook在設定開發者的憑證(Android Package Signature) 上面比LINE 方便，可以同時設定 developing ／released 的碼.</li>
<li>Facebook 使用者多。</li>
<li>Facebook 允許developer 拿到 user 公開的 id, photo 和 email, LINE 不能拿到公開 LINE ID。</li>
<li>Facebook 的 status 從 developing 切換到 published 不需要「先」通過人工審核，切換一下很快，所有的人都可以存取我們的App，並立即取得facebook 帳號的授權。</li>
<li>比較特別的是當使用我們facebook App 的人多了，facebook 會寄通知信來，要求在 facebook 的設定裡增加隱私權的宣告，那也很簡單，網路上有很多產生獸，點一點就完成了。</li>
</ul>
<hr />
<h4>相關網址：</h4>
<ul>
<li><a href="https://developers.line.me/line-login/overview">https://developers.line.me/line-login/overview</a></li>
<li><a href="https://developers.line.me/web-login/setting-up-login-button">https://developers.line.me/web-login/setting-up-login-button</a></li>
<li><a href="https://developers.line.me/channel-console/publish-app">https://developers.line.me/channel-console/publish-app<br />
</a>Every Channel has a status. To publish your application, you must change the status of your Channel to PUBLISHED.</li>
<li>[Android]實作Facebook login<br />
<a href="http://max-everyday.com/2016/09/android-facebook-login/">http://max-everyday.com/2016/09/android-facebook-login/</a></li>
<li>關於LineBot(7) &#8211; 使用Line Login實現oAuth SSO(單一登入)<br />
<a href="http://studyhost.blogspot.tw/2016/12/linebot7-line-loginoauth-sso.html">http://studyhost.blogspot.tw/2016/12/linebot7-line-loginoauth-sso.html</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2016/08/add-buttons-to-preferencefragment/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Android] 不讓轉向造成畫面重整</title>
		<link>https://stackoverflow.max-everyday.com/2016/07/android-orientation-changes-reload/</link>
					<comments>https://stackoverflow.max-everyday.com/2016/07/android-orientation-changes-reload/#respond</comments>
		
		<dc:creator><![CDATA[max-stackoverflow]]></dc:creator>
		<pubDate>Fri, 22 Jul 2016 16:46:01 +0000</pubDate>
				<category><![CDATA[Android筆記]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[UI]]></category>
		<guid isPermaLink="false">http://stackoverflow.max-everyday.com/?p=53</guid>

					<description><![CDATA[發現寫好的App預設在轉向(rotate scr...]]></description>
										<content:encoded><![CDATA[<p>發現寫好的App預設在轉向(rotate screen) 時會造成 activity 的 reload 事件。解法是：</p>
<p>Add this to your manifest under <code>&lt;activity&gt;</code>:</p>
<blockquote>
<pre class="default prettyprint prettyprinted"><code><span class="pln">android</span><span class="pun">:</span><span class="pln">configChanges</span><span class="pun">=</span><span class="str">"keyboardHidden|orientation|screenSize"</span></code></pre>
</blockquote>
<hr />
<p>解法真是簡單&#8230;</p>
<h4>相關文章：</h4>
<p>How do ı disable reload page on change screen orientation?<br />
<a href="http://stackoverflow.com/questions/17241745/android-how-do-%C4%B1-disable-reload-page-on-change-screen-orientation">http://stackoverflow.com/questions/17241745/android-how-do-%C4%B1-disable-reload-page-on-change-screen-orientation</a></p>
<p>Don&#8217;t reload application when orientation changes<br />
<a href="http://stackoverflow.com/questions/5913130/dont-reload-application-when-orientation-changes">http://stackoverflow.com/questions/5913130/dont-reload-application-when-orientation-changes</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stackoverflow.max-everyday.com/2016/07/android-orientation-changes-reload/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
