android.view.KeyEvent.startTracking()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(472)

本文整理了Java中android.view.KeyEvent.startTracking()方法的一些代码示例,展示了KeyEvent.startTracking()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.startTracking()方法的具体详情如下:
包路径:android.view.KeyEvent
类名称:KeyEvent
方法名:startTracking

KeyEvent.startTracking介绍

暂无

代码示例

代码示例来源:origin: KeepSafe/TapTargetView

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 if (isVisible() && cancelable && keyCode == KeyEvent.KEYCODE_BACK) {
  event.startTracking();
  return true;
 }
 return false;
}

代码示例来源:origin: hidroh/materialistic

/**
 * Calls from {@link Activity#onKeyDown(int, KeyEvent)} to delegate
 * @param keyCode    event key code
 * @param event      key event
 * @return  true if is intercepted as navigation, false otherwise
 */
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
    return mBackInterceptor != null && mBackInterceptor.onBackPressed();
  }
  if (!mEnabled) {
    return false;
  }
  if (keyCode == KeyEvent.KEYCODE_VOLUME_UP ||
      keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
    event.startTracking();
    return true;
  }
  return false;
}

代码示例来源:origin: jdamcd/android-crop

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: stackoverflow.com

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: yuliskov/SmartYouTubeTV

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: stackoverflow.com

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_MENU) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: stackoverflow.com

public boolean onKeyDown(int i, KeyEvent keyevent) {
   if (i == 27) {
     keyevent.startTracking();
     return true;
   }
   else {
     return super.onKeyDown(i, keyevent);
   }
 }

代码示例来源:origin: stackoverflow.com

onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_MENU) {
    event.startTracking();
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: stackoverflow.com

public boolean onKeyDown(int keyCode, KeyEvent event)  {
1801        if (keyCode == KeyEvent.KEYCODE_BACK) {
1802            if (getApplicationInfo().targetSdkVersion
1803                    >= Build.VERSION_CODES.ECLAIR) {
1804                event.startTracking();
1805            } else {
1806                onBackPressed();
1807            }
1808            return true;
1809        }

代码示例来源:origin: stackoverflow.com

public boolean onKeyDown(int keyCode, KeyEvent event)  {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    if (getApplicationInfo().targetSdkVersion
        >= Build.VERSION_CODES.ECLAIR) {
      event.startTracking();
    } else {
      onBackPressed();
    }
    return true;
  }
<snip>

代码示例来源:origin: kingargyle/adt-leanback-support

public static void startTracking(KeyEvent event) {
  event.startTracking();
}

代码示例来源:origin: bradand/XMouse

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  switch(keyCode){
   /*case KeyEvent.KEYCODE_MENU:
  case KeyEvent.KEYCODE_SEARCH:
  case KeyEvent.KEYCODE_BACK:*/
    case KeyEvent.KEYCODE_VOLUME_UP:
      event.startTracking();
      return true;
    case KeyEvent.KEYCODE_VOLUME_DOWN:
      event.startTracking();
      return true;
  }
  return super.onKeyDown(keyCode, event);
}
@Override

代码示例来源:origin: klinker24/launcher3

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (!mChildrenFocused && keyCode == KeyEvent.KEYCODE_ENTER) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: enricocid/LaunchEnr

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (!mChildrenFocused && keyCode == KeyEvent.KEYCODE_ENTER) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: klinker24/Android-Blur-Launcher

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (!mChildrenFocused && keyCode == KeyEvent.KEYCODE_ENTER) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: henrichg/PhoneProfilesPlus

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
 if (isVisible() && cancelable && keyCode == KeyEvent.KEYCODE_BACK) {
  event.startTracking();
  return true;
 }
 return false;
}

代码示例来源:origin: liuguangqiang/IPicker

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: redfish64/TinyTravelTracker

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK
      && event.getRepeatCount() == 0) {
    event.startTracking();
    return true;
  }
  return super.onKeyDown(keyCode, event);
}

代码示例来源:origin: fengdai/FragmentMaster

public boolean onKeyDown(int keyCode, KeyEvent event) {
  if (keyCode == KeyEvent.KEYCODE_BACK) {
    if (mFragmentContext.getApplicationInfo().targetSdkVersion
        >= Build.VERSION_CODES.ECLAIR) {
      event.startTracking();
    } else {
      onBackPressed();
    }
    return true;
  }
  return false;
}

代码示例来源:origin: Ryfthink/TV-HorizontalListView

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  boolean handled = false;
  switch (keyCode) {
    case KeyEvent.KEYCODE_DPAD_LEFT:
      handled = moveLeft();
      break;
    case KeyEvent.KEYCODE_DPAD_RIGHT:
      handled = moveRight();
      break;
    case KeyEvent.KEYCODE_DPAD_CENTER:
    case KeyEvent.KEYCODE_NUMPAD_ENTER:
    case KeyEvent.KEYCODE_ENTER:
      event.startTracking();
      handled = true;
      break;
  }
  return handled || super.onKeyDown(keyCode, event);
}

相关文章