本文整理汇总了Java中android.support.v4.view.GestureDetectorCompat.setOnDoubleTapListener方法的典型用法代码示例。如果您正苦于以下问题:Java GestureDetectorCompat.setOnDoubleTapListener方法的具体用法?Java GestureDetectorCompat.setOnDoubleTapListener怎么用?Java GestureDetectorCompat.setOnDoubleTapListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.GestureDetectorCompat
的用法示例。
在下文中一共展示了GestureDetectorCompat.setOnDoubleTapListener方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Attacher
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
mDraweeView = new WeakReference<>(draweeView);
draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
draweeView.setOnTouchListener(this);
mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
new GestureDetector.SimpleOnGestureListener() {
@Override public void onLongPress(MotionEvent e) {
super.onLongPress(e);
if (null != mLongClickListener) {
mLongClickListener.onLongClick(getDraweeView());
}
}
});
mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
示例2: initTracker
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
private void initTracker() {
if (!Utils.hasExternalStoragePermission(this)) {
ActivityCompat.requestPermissions(
this,
new String[] {
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
},
Constants.REQUEST_CODE_PERMISSION_EXTERNAL_STORAGE);
}
// TODO(youngseokyoon): consolidate the Tracker into UserActionLogger
mLogger = UserActionLogger.getInstance(this);
mGestureListener = new GestureListener(this);
mGestureDetector = new GestureDetectorCompat(this, mGestureListener);
mGestureDetector.setOnDoubleTapListener(mGestureListener);
}
示例3: Attacher
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public Attacher(DraweeView<GenericDraweeHierarchy> draweeView) {
mDraweeView = new WeakReference<>(draweeView);
draweeView.getHierarchy().setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
draweeView.setOnTouchListener(this);
mScaleDragDetector = new ScaleDragDetector(draweeView.getContext(), this);
mGestureDetector = new GestureDetectorCompat(draweeView.getContext(),
new GestureDetector.SimpleOnGestureListener() {
@Override
public void onLongPress(MotionEvent e) {
super.onLongPress(e);
if (null != mLongClickListener) {
mLongClickListener.onLongClick(getDraweeView());
}
}
});
mGestureDetector.setOnDoubleTapListener(new DefaultOnDoubleTapListener(this));
}
示例4: onCreate
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_unlock);
mDetector = new GestureDetectorCompat(this, this);
// Set the gesture detector as the double tap
// listener.
mDetector.setOnDoubleTapListener(this);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
示例5: Window
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public Window(MainService context, int contentView){
this.context = context;
LayoutInflater inflater = (LayoutInflater) this.context.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
windowManager = (WindowManager) this.context.getSystemService(Context.WINDOW_SERVICE);
window = inflater.inflate(R.layout.window, null);
mRealDisplaySize = this.context.getRealDisplaySize();
params = getDefaultParams();
WindowView mWindowView = (WindowView) window.findViewById(R.id.window_view);
ResizeView mResizeView = (ResizeView) window.findViewById(R.id.resize_view);
mWindowView.setWindowListener(this);
mResizeView.setWindowListener(this);
GestureDetectorCompat detectorCompat = new GestureDetectorCompat(context, this);
detectorCompat.setOnDoubleTapListener(this);
mWindowView.setDetector(detectorCompat);
RelativeLayout relativeLayout = (RelativeLayout) window.findViewById(R.id.content_view);
relativeLayout.addView(inflater.inflate(contentView, relativeLayout, false));
windowManager.addView(window, params);
// Hacky way to check if we are fullscreen
WindowManager.LayoutParams p = new WindowManager.LayoutParams();
p.width = 1;
p.height = WindowManager.LayoutParams.MATCH_PARENT;
p.type = WindowManager.LayoutParams.TYPE_PHONE;
p.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
p.format = PixelFormat.TRANSPARENT;
p.gravity = Gravity.END | Gravity.TOP;
mHeightView = new View(context);
windowManager.addView(mHeightView, p);
}
示例6: onCreate
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
public void onCreate(SurfaceHolder surfaceHolder) {
super.onCreate(surfaceHolder);
drawScript = new LWQSurfaceHolderDrawScript(surfaceHolder);
gestureDetectorCompat = new GestureDetectorCompat(LWQWallpaperService.this, this);
gestureDetectorCompat.setOnDoubleTapListener(this);
EventBus.getDefault().register(this);
LWQWallpaperController wallpaperController = LWQWallpaperControllerHelper.get();
if (!wallpaperController.activeWallpaperLoaded()) {
wallpaperController.retrieveActiveWallpaper();
}
}
示例7: init
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
/**
* initializes standards
*/
private void init() {
background = new Paint();
background.setColor(Color.rgb(57,75,133));
lines = new Paint();
lines.setColor(Color.rgb(243,173,30));
buttons = new Paint();
buttons.setColor(Color.WHITE);
// point in time text
pitText = new Paint();
pitText.setTextAlign(Paint.Align.LEFT);
pitText.setColor(Color.LTGRAY);
pitText.setTextSize(50);
// point in time + time frame text
pitplusText = new Paint();
pitplusText.setTextAlign(Paint.Align.RIGHT);
pitplusText.setColor(Color.LTGRAY);
pitplusText.setTextSize(50);
// time frames text
tfText = new Paint();
tfText.setTextAlign(Paint.Align.CENTER);
tfText.setColor(Color.LTGRAY);
tfText.setTextSize(50);
selectedTfText = new Paint();
selectedTfText.setTextAlign(Paint.Align.CENTER);
selectedTfText.setColor(Color.BLACK);
selectedTfText.setTextSize(50);
detector = new GestureDetectorCompat(this.getContext(), this);
detector.setOnDoubleTapListener(this);
Log.d(TAG, "created");
}
示例8: onCreate
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "onCreate");
/** NO_TITLE SCREEN_ON FULLSCREEN */
Window win = getWindow();
win.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
win.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
win.requestFeature(Window.FEATURE_NO_TITLE);
/**摄像头方向*/
isOritationLanscape = getIntent().getBooleanExtra("oritation_landscape", false);
if (isOritationLanscape) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.activity_streaming_landscape);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
setContentView(R.layout.activity_streaming_portrait);
}
/**推流视频宽度*/
mVideoWidth = getIntent().getIntExtra("res_w", 1280);
/**推流视频高度*/
mVideoHeight = getIntent().getIntExtra("res_h", 720);
/**视频帧率*/
mFrameRate = getIntent().getIntExtra("frame_rate", 15);
/**视频码率*/
mBitrate = getIntent().getIntExtra("bitrate", 1024) * 1000;
/**推流地址*/
mStreamingUrl = getIntent().getStringExtra("push_url");
initUIElements();
/**摄像头为前置摄像头*/
mCurrentCamera = LiveConfig.CAMERA_FACING_FRONT;
/**是否开始散光灯*/
isFlashOn = false;
initUIEventHandler();
/**推流状态的监听*/
initStateListener();
/**初始化推流会话*/
initRTMPSession(mCameraView.getHolder());
mDetector = new GestureDetectorCompat(this, this);
mDetector.setOnDoubleTapListener(this);
}
示例9: onCreate
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_locked_screen);
startService(new Intent(this, LockScreenService.class).setAction(Intent.ACTION_SYNC));
if (!isMyServiceRunning(LockScreenService.class)) {
startService(new Intent(this, LockScreenService.class).setAction(Intent.ACTION_SYNC));
}
this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
/*
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
View view = (View) findViewById(R.id.layout);
view.startAnimation(AnimationUtils.loadAnimation(
context, R.anim.right_out;
));
*/
// Instantiate the gesture detector with the
// application context and an implementation of
// GestureDetector.OnGestureListener
mDetector = new GestureDetectorCompat(this, this);
// Set the gesture detector as the double tap
// listener.
mDetector.setOnDoubleTapListener(this);
txtTime = (TextView) findViewById(R.id.textClock2);
TimeFace = Typeface.createFromAsset(getAssets(), "Roboto-Light.ttf");
txtTime.setTypeface(TimeFace);
txtDate = (TextView) findViewById(R.id.date);
batteryStatus = (TextView) findViewById(R.id.test);
this.mHandler = new Handler();
this.mHandler.postDelayed(m_Runnable, 500);
init();
reset();
}
示例10: ItemGestureListener
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public ItemGestureListener(Context context, Item item, ItemGestureCallback callback) {
detector = new GestureDetectorCompat(context, this);
detector.setOnDoubleTapListener(this);
this.item = item;
this.callback = callback;
}
示例11: init
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
private void init(Context context){
mDetector = new GestureDetectorCompat(context, this);
mDetector.setOnDoubleTapListener(this);
}
示例12: onCreate
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
won = false;
setTitle("2048");
setContentView(R.layout.activity_main);
SharedPreferences data =
getSharedPreferences("com.jbapps.twenty48", MODE_PRIVATE);
highScore = data.getInt("highScore", 0);
model = new Model();
textView1 = (TextView)findViewById(R.id.textView1);
textView2 = (TextView)findViewById(R.id.textView2);
textView3 = (TextView)findViewById(R.id.textView3);
textView4 = (TextView)findViewById(R.id.textView4);
textView5 = (TextView)findViewById(R.id.textView5);
textView6 = (TextView)findViewById(R.id.textView6);
textView7 = (TextView)findViewById(R.id.textView7);
textView8 = (TextView)findViewById(R.id.textView8);
textView9 = (TextView)findViewById(R.id.textView9);
textView10 = (TextView)findViewById(R.id.textView10);
textView11 = (TextView)findViewById(R.id.textView11);
textView12 = (TextView)findViewById(R.id.textView12);
textView13 = (TextView)findViewById(R.id.textView13);
textView14 = (TextView)findViewById(R.id.textView14);
textView15 = (TextView)findViewById(R.id.textView15);
textView16 = (TextView)findViewById(R.id.textView16);
scoreView = (TextView)findViewById(R.id.textView17);
highScoreView = (TextView)findViewById(R.id.textView18);
textViews = new ArrayList<TextView>();
textViews.add(textView1);
textViews.add(textView2);
textViews.add(textView3);
textViews.add(textView4);
textViews.add(textView5);
textViews.add(textView6);
textViews.add(textView7);
textViews.add(textView8);
textViews.add(textView9);
textViews.add(textView10);
textViews.add(textView11);
textViews.add(textView12);
textViews.add(textView13);
textViews.add(textView14);
textViews.add(textView15);
textViews.add(textView16);
mDetector = new GestureDetectorCompat(this, this);
mDetector.setOnDoubleTapListener(this);
GridLayout gridLayout = (GridLayout) findViewById(R.id.gridLayout1);
gridLayout.addOnLayoutChangeListener(new OnLayoutChangeListener() {
@Override
public void onLayoutChange(View view, int arg1, int arg2, int arg3,
int arg4, int arg5, int arg6, int arg7, int arg8) {
int sideLength;
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
sideLength = view.getWidth() / 4;
} else {
sideLength = view.getHeight() / 4;
}
for (TextView text : textViews)
{
text.setWidth(sideLength);
text.setHeight(sideLength);
text.setGravity(Gravity.CENTER);
}
}
});
update();
}
示例13: TouchGestureDetector
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
public TouchGestureDetector(Context context, OnTouchGestureListener listener) {
mGestureDetector = new GestureDetectorCompat(context, listener);
mGestureDetector.setOnDoubleTapListener(listener);
mScaleGestureDetector = new ScaleGestureDetector(context, listener);
ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, false);
}
示例14: onCreate
import android.support.v4.view.GestureDetectorCompat; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "=== Starting demo");
// comment the following two lines if the log is too verbose
SystemOutLogProvider prov = new SystemOutLogProvider();
com.lightstreamer.client.LightstreamerClient.setLoggerProvider(prov);
checkPlayServices();
String serverAddress = getResources().getString(R.string.host);
String adapterName = "DEMO";
String senderId = getResources().getString(R.string.sender_id);
LsClient.instance.initClient(serverAddress, adapterName, getApplicationContext(), senderId);
GestureControls gs = new GestureControls();
mDetector = new GestureDetectorCompat(this,gs);
mDetector.setOnDoubleTapListener(gs);
this.handler = new Handler();
getSupportActionBar().setTitle(R.string.lightstreamer);
setContentView(R.layout.stocks);
if (findViewById(R.id.fragment_container) != null) {
//single fragment view (phone)
if (savedInstanceState != null) {
return;
}
StocksFragment firstFragment = new StocksFragment();
firstFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, firstFragment).commit();
}
}
开发者ID:Lightstreamer,项目名称:Lightstreamer-example-MPNStockList-client-android,代码行数:44,代码来源:StockListDemo.java