private void endKey(final Key key) {
   mParams.onAddKey(key);
   if (mLeftEdge) {
     key.markAsLeftEdge(mParams);
     mLeftEdge = false;
   }
   if (mTopEdge) {
     key.markAsTopEdge(mParams);
   }
   mRightEdgeKey = key;
 }
 private void parseKey(final XmlPullParser parser, final KeyboardRow row, final boolean skip)
     throws XmlPullParserException, IOException {
   if (skip) {
     XmlParseUtils.checkEndTag(TAG_KEY, parser);
     if (DEBUG) startEndTag("<%s /> skipped", TAG_KEY);
     return;
   }
   final Key key = new Key(mResources, mParams, row, parser);
   if (DEBUG) {
     startEndTag(
         "<%s%s %s moreKeys=%s />",
         TAG_KEY, (key.isEnabled() ? "" : " disabled"), key, Arrays.toString(key.getMoreKeys()));
   }
   XmlParseUtils.checkEndTag(TAG_KEY, parser);
   endKey(key);
 }
 private void endRow(final KeyboardRow row) {
   if (mCurrentRow == null) {
     throw new RuntimeException("orphan end row tag");
   }
   if (mRightEdgeKey != null) {
     mRightEdgeKey.markAsRightEdge(mParams);
     mRightEdgeKey = null;
   }
   addEdgeSpace(mParams.mRightPadding, row);
   mCurrentY += row.getRowHeight();
   mCurrentRow = null;
   mTopEdge = false;
 }