TokenLayout.java revision f370eece69b53591e104fab667134cfe8d96fabd
public class TokenLayout extends FrameLayout implements View.OnClickListener, PopupMenu.OnMenuItemClickListener, Runnable {
private ProgressCircle mProgressInner;
private ProgressCircle mProgressOuter;
private PopupMenu mPopupMenu;
private int mPosition;
private long mStartTime;
super(context);
}
}
}
protected void onFinishInflate() {
super.onFinishInflate();
setOnClickListener(this);
mMenu.setOnClickListener(this);
}
// Cancel all active animations.
setEnabled(true);
removeCallbacks(this);
// Show the image.
// Set the labels.
} else {
}
// Set the code placeholder.
placeholder[i] = '-';
}
if (v == mMenu) {
mPopupMenu.show();
return;
}
// Increment the token.
// Copy code to clipboard.
// Start animations.
// Handle type-specific UI.
case HOTP:
setEnabled(false);
break;
case TOTP:
break;
}
post(this);
}
Intent i;
return false;
case R.id.action_edit:
getContext().startActivity(i);
break;
case R.id.action_delete:
getContext().startActivity(i);
break;
}
return true;
}
public void run() {
// Get the current data
if (!isEnabled())
// Update the fields
postDelayed(this, 100);
return;
}
}
}