コード例 #1
0
  public static boolean onViewClicked(Context context, View view) {
    if (view == null) return false;

    final Integer changeNumber = (Integer) view.getTag(R.id.changeNumber);
    final String filePath = (String) view.getTag(R.id.filePath);
    final Integer patchset = (Integer) view.getTag(R.id.patchSetNumber);

    if (changeNumber == null) return false;

    // If the server does not support diffs then do not show the dialog
    if (!Config.isDiffSupported(context)) {
      Tools.launchDiffInBrowser(context, changeNumber, patchset, filePath);
      return true;
    }

    PrefsFragment.DiffModes mode = PrefsFragment.getDiffDefault(context);
    if (mode == PrefsFragment.DiffModes.INTERNAL) {
      Tools.launchDiffViewer(context, changeNumber, patchset, filePath);
    } else if (mode == PrefsFragment.DiffModes.EXTERNAL) {
      Tools.launchDiffInBrowser(context, changeNumber, patchset, filePath);
    } else {
      Tools.launchDiffOptionDialog(context, changeNumber, patchset, filePath);
    }

    return true;
  }
コード例 #2
0
  public PatchSetChangesCard(Context context) {
    mContext = context;
    mGreen = context.getResources().getColor(R.color.text_green);
    mRed = context.getResources().getColor(R.color.text_red);
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    mUsingLightTheme = (PrefsFragment.getCurrentThemeID(mContext) == R.style.Theme_Light);
  }