Android の タッチイベント とか

今や重なりあったアクション付きのUIが流行りとなり, 当然「タッチイベント」も重なり合ってくるわけでのメモ.

devsbuild_it_sites_default_files_PRE_andevcon_mastering-the-android-touch-system_pdf

andevcon_mastering-the-android-touch-system.pdf

「親から子(背面から前面)に伝わっていく」ので, activity → view.

Android のタッチイベントを理解する(その1) - Unmotivated

なので, 早めに捉えると範囲が広く, 遅めに捉えると限定的で実装手間も少なくできる.

Android: Difference between onInterceptTouchEvent and dispatchTouchEvent? - Stack Overflow

親で伝搬を止める.

...
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
    boolean response = super.onInterceptTouchEvent(event);
    float x = event.getX();
    switch (event.getActionMasked()) {
    case MotionEvent.ACTION_DOWN:
        mTouchX = x;
        break;
    case MotionEvent.ACTION_MOVE:
        float dX = Math.abs(x - mTouchX);
        if (dX > minSwipeDistance)
            return true;
        break;
    }
    return response;
}
...

子から伝搬を止めるのをやめさせる.

...
findViewById(R.id.button)
    .getParent()
    .requestDisqllowInterceptTouchEvent(true);
...

ほとんどのユーザからのイベントは重なっていることを実感するなど.

Correctly detecting a swipe on a GridView placed inside a ViewPager in Android - Stack Overflow


Android-Studio で「Push failed: Failed with error: fatal: protocol error: bad line length character: ***」

GUI上で git push できなくなった Android Studio.

workspace_xml_Android_Studio_AI-141_1793788

git 自体は正常.

$ ssh -T [email protected]
You can use git or hg to connect to Bitbucket. Shell access is disabled.

Git プラグインのせいなのか.

IDE_Fatal_Errors

仕方ないので, ターミナルからコマンドラインでPUSH.

$ cd /Users/maochanz/path/to/MyProject
$ git -c core.quotepath=false push --progress --porcelain origin refs/heads/master:master
...
[master e99f35f] テスト
 1 file changed, 10 insertions(+), 10 deletions(-)

GUIプラグイン, 予想外のレスポンスを処理できなかったのですか, そうですか.
git.jetbrains.org - idea/community.git/commitdiff

これは対応してくれるよね, だめかな.


Android-Studio 「monitoring device...」てでてるけど...

これ. Android-Studio 1.2.

monitoring_device

消えないけど...

とりあえず「x」で消していいのでしょうね.

Issues_-_android_-_Android_Open_Source_Project_-_Issue_Tracker_-_Google_Project_Hosting

Issue 159382 - android - Monitoring device spinner - Android Open Source Project - Issue Tracker - Google Project Hosting