小编dec*_*des的帖子

Android:可以用GestureDetector检测双指双击?

上面的问题.对我来说,一旦检测到双击,getPointerCount()始终为1.

 private GestureDetector mGestureDetector;
 mGestureDetector = new GestureDetector(this, new MyGestureListener());    
Run Code Online (Sandbox Code Playgroud)

...

 public boolean onTouch(View v, MotionEvent event) {
     return mGestureDetector.onTouchEvent(event);
 }  
Run Code Online (Sandbox Code Playgroud)

...

private class MyGestureListener extends  GestureDetector.SimpleOnGestureListener {

    @Override
    public boolean onDoubleTap(MotionEvent e) {
         return super.onDoubleTap(e);
    } 

}
Run Code Online (Sandbox Code Playgroud)

android gesture-recognition

6
推荐指数
1
解决办法
2705
查看次数

Android:build.properties排除

我想知道是否可以从src.dir = ...build.properties中包含的文件夹中排除多个源文件

问候

ant android build

5
推荐指数
1
解决办法
2812
查看次数

Android:FrameLayout 子类不绘制

这是,什么工作:

a) 在 main.xml 中有两个 ImageView 的 FrameLayout

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:id="@+id/frameLayout1"
    android:layout_height="wrap_content">

    <ImageView android:src="@drawable/radar_background"
        android:id="@+id/background" android:layout_width="wrap_content"
        android:layout_height="wrap_content"></ImageView>

    <ImageView android:src="@drawable/radar_sector" android:id="@+id/sector"
        android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

b) 背景旋转动画,而前景扇区保持不变

因为我需要对背景图像做更多的工作,所以我把它放到了一个 FrameLayout 子类中,并相应地更改了 main.xml:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:id="@+id/frameLayout1"
    android:layout_height="wrap_content">

    <com.decades.SensorTest.RadarView
        android:id="@+id/background" android:layout_width="wrap_content"
        android:layout_height="wrap_content" /> 
    <ImageView android:src="@drawable/radar_sector" android:id="@+id/sector"
        android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)

这是新的 RadarView.java:

public class RadarView extends FrameLayout {

    private Bitmap mRadar;

    public RadarView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public RadarView(Context context) {
        super(context);
        init();
    }
    private void init() {
        mRadar = …
Run Code Online (Sandbox Code Playgroud)

performance android custom-view drawbitmap

1
推荐指数
1
解决办法
3884
查看次数