-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
134 lines (87 loc) · 13.9 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>一指流沙</title>
<subtitle>风华是一指流沙,苍老是一段年华!</subtitle>
<link href="/myBlog/atom.xml" rel="self"/>
<link href="https://github.com/xyygit/myBlog.git/myBlog/"/>
<updated>2017-07-07T10:16:48.926Z</updated>
<id>https://github.com/xyygit/myBlog.git/myBlog/</id>
<author>
<name>生如夏花</name>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>android默认弹出软件盘</title>
<link href="https://github.com/xyygit/myBlog.git/myBlog/2017/07/07/%E9%BB%98%E8%AE%A4%E5%BC%B9%E5%87%BA%E8%BD%AF%E4%BB%B6%E7%9B%98/"/>
<id>https://github.com/xyygit/myBlog.git/myBlog/2017/07/07/默认弹出软件盘/</id>
<published>2017-07-07T10:03:36.000Z</published>
<updated>2017-07-07T10:16:48.926Z</updated>
<content type="html"><![CDATA[<p>记录一种简单的方法进入某个页面时自动弹出软键盘<br><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><!-- 忘记密码页 --></div><div class="line"> <activity</div><div class="line"> android:name=<span class="string">".account.activity.ForgetPwdActivity"</span></div><div class="line"> android:screenOrientation=<span class="string">"portrait"</span></div><div class="line"> android:windowSoftInputMode=<span class="string">"stateVisible"</span>/></div></pre></td></tr></table></figure></p>
]]></content>
<summary type="html">
<p>记录一种简单的方法进入某个页面时自动弹出软键盘<br><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2
</summary>
<category term="Android" scheme="https://github.com/xyygit/myBlog.git/myBlog/categories/Android/"/>
<category term="软键盘" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/%E8%BD%AF%E9%94%AE%E7%9B%98/"/>
</entry>
<entry>
<title>android点击输入框以外的区域,隐藏软键盘</title>
<link href="https://github.com/xyygit/myBlog.git/myBlog/2017/06/29/%E9%9A%90%E8%97%8F%E8%BE%93%E5%85%A5%E6%B3%95/"/>
<id>https://github.com/xyygit/myBlog.git/myBlog/2017/06/29/隐藏输入法/</id>
<published>2017-06-29T03:03:38.000Z</published>
<updated>2017-06-29T03:16:20.414Z</updated>
<content type="html"><![CDATA[<h1 id="android点击输入框以外的区域,隐藏软键盘"><a href="#android点击输入框以外的区域,隐藏软键盘" class="headerlink" title="android点击输入框以外的区域,隐藏软键盘"></a>android点击输入框以外的区域,隐藏软键盘</h1><h2 id="首先设置拦截器,监听点击事件"><a href="#首先设置拦截器,监听点击事件" class="headerlink" title="首先设置拦截器,监听点击事件"></a>首先设置拦截器,监听点击事件</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">public</span> <span class="keyword">boolean</span> <span class="title">dispatchTouchEvent</span><span class="params">(MotionEvent ev)</span> </span>{</div><div class="line"></div><div class="line"> <span class="keyword">if</span> (ev.getAction() == MotionEvent.ACTION_DOWN) {</div><div class="line"> View v = getCurrentFocus();</div><div class="line"> <span class="keyword">if</span> (isShouldHideKeyboard(v, ev)) {</div><div class="line"> hideKeyboard(v.getWindowToken());</div><div class="line"> }</div><div class="line"> }</div><div class="line"> <span class="keyword">return</span> <span class="keyword">super</span>.dispatchTouchEvent(ev);</div><div class="line">}</div></pre></td></tr></table></figure>
<h2 id="根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时没必要隐藏"><a href="#根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时没必要隐藏" class="headerlink" title="根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时没必要隐藏"></a>根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时没必要隐藏</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">boolean</span> <span class="title">isShouldHideKeyboard</span><span class="params">(View v, MotionEvent event)</span> </span>{</div><div class="line"></div><div class="line"> <span class="keyword">if</span> (v != <span class="keyword">null</span> && (v <span class="keyword">instanceof</span> EditText)) {</div><div class="line"> <span class="keyword">int</span>[] l = {<span class="number">0</span>, <span class="number">0</span>};</div><div class="line"> </div><div class="line"> v.getLocationInWindow(l);</div><div class="line"> </div><div class="line"> <span class="keyword">int</span> left = l[<span class="number">0</span>];</div><div class="line"> <span class="keyword">int</span> top = l[<span class="number">1</span>];</div><div class="line"> <span class="keyword">int</span> bottom = top + v.getHeight();</div><div class="line"> <span class="keyword">int</span> right = left + v.getWidth();</div><div class="line"> </div><div class="line"> <span class="keyword">if</span> (event.getX() > left && event.getX() < right && event.getY() > top && event.getY() < bottom) {</div><div class="line"> <span class="comment">// 点击EditText的事件,忽略它。</span></div><div class="line"> <span class="keyword">return</span> <span class="keyword">false</span>;</div><div class="line"> } <span class="keyword">else</span> {</div><div class="line"> <span class="keyword">return</span> <span class="keyword">true</span>;</div><div class="line"> }</div><div class="line">}</div><div class="line"> <span class="comment">// 如果焦点不是EditText则忽略,这个发生在视图刚绘制完,第一个焦点不在EditText上,和用户用轨迹球选择其他的焦点</span></div><div class="line"> <span class="keyword">return</span> <span class="keyword">false</span>;</div><div class="line">}</div></pre></td></tr></table></figure>
<h2 id="隐藏输入法"><a href="#隐藏输入法" class="headerlink" title="隐藏输入法"></a>隐藏输入法</h2><figure class="highlight java"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">private</span> <span class="keyword">void</span> <span class="title">hideKeyboard</span><span class="params">(IBinder token)</span> </span>{</div><div class="line"> <span class="keyword">if</span> (token != <span class="keyword">null</span>) {</div><div class="line"> InputMethodManager im = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);</div><div class="line"> im.hideSoftInputFromWindow(token, InputMethodManager.HIDE_NOT_ALWAYS);</div><div class="line"> }</div><div class="line">}</div></pre></td></tr></table></figure>
<hr>
<p>感谢您花费时间阅读!</p>
<p>作者 [@yann]<br>2017 年 06月 28日 </p>
]]></content>
<summary type="html">
<h1 id="android点击输入框以外的区域,隐藏软键盘"><a href="#android点击输入框以外的区域,隐藏软键盘" class="headerlink" title="android点击输入框以外的区域,隐藏软键盘"></a>android点击输入框以外的区域
</summary>
<category term="Android" scheme="https://github.com/xyygit/myBlog.git/myBlog/categories/Android/"/>
<category term="android" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/android/"/>
<category term="输入法" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/%E8%BE%93%E5%85%A5%E6%B3%95/"/>
</entry>
<entry>
<title>我的第一篇博客</title>
<link href="https://github.com/xyygit/myBlog.git/myBlog/2017/06/22/%E6%88%91%E7%9A%84%E7%AC%AC%E4%B8%80%E7%AF%87%E5%8D%9A%E5%AE%A2/"/>
<id>https://github.com/xyygit/myBlog.git/myBlog/2017/06/22/我的第一篇博客/</id>
<published>2017-06-22T01:50:00.000Z</published>
<updated>2017-07-07T10:05:59.481Z</updated>
<content type="html"><![CDATA[<p>您好!欢迎来到我的个人技术博客。</p>
]]></content>
<summary type="html">
<p>您好!欢迎来到我的个人技术博客。</p>
</summary>
<category term="搭建博客" scheme="https://github.com/xyygit/myBlog.git/myBlog/categories/%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/"/>
<category term="npm" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/npm/"/>
<category term="hexo" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/hexo/"/>
<category term="github" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/github/"/>
</entry>
<entry>
<title>Hello World</title>
<link href="https://github.com/xyygit/myBlog.git/myBlog/2017/06/22/hello-world/"/>
<id>https://github.com/xyygit/myBlog.git/myBlog/2017/06/22/hello-world/</id>
<published>2017-06-22T01:05:59.029Z</published>
<updated>2017-06-28T09:48:17.800Z</updated>
<content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="external">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="external">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo new <span class="string">"My New Post"</span></div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="external">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo server</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/server.html" target="_blank" rel="external">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo generate</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/generating.html" target="_blank" rel="external">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo deploy</div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/deployment.html" target="_blank" rel="external">Deployment</a></p>
]]></content>
<summary type="html">
<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.
</summary>
<category term="hello world" scheme="https://github.com/xyygit/myBlog.git/myBlog/categories/hello-world/"/>
<category term="npm" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/npm/"/>
<category term="hexo" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/hexo/"/>
<category term="github" scheme="https://github.com/xyygit/myBlog.git/myBlog/tags/github/"/>
</entry>
</feed>