use of com.ichi2.anki.model.WhiteboardPenColor in project Anki-Android by ankidroid.
the class ReviewerNoParamTest method whiteboardPenColorChangeChangesDatabaseLight.
@Test
public void whiteboardPenColorChangeChangesDatabaseLight() {
Whiteboard whiteboard = startReviewerForWhiteboard();
whiteboard.setPenColor(ARBITRARY_PEN_COLOR_VALUE);
WhiteboardPenColor penColor = getPenColor();
assertThat("Light pen color is changed", penColor.getLightPenColor(), is(ARBITRARY_PEN_COLOR_VALUE));
}
use of com.ichi2.anki.model.WhiteboardPenColor in project Anki-Android by ankidroid.
the class MetaDB method getWhiteboardPenColor.
/**
* Returns the pen color of the whiteboard for the given deck.
*/
public static WhiteboardPenColor getWhiteboardPenColor(Context context, long did) {
openDBIfClosed(context);
try (Cursor cur = mMetaDb.rawQuery("SELECT lightpencolor, darkpencolor FROM whiteboardState WHERE did = ?", new String[] { Long.toString(did) })) {
cur.moveToFirst();
Integer light = DatabaseUtil.getInteger(cur, 0);
Integer dark = DatabaseUtil.getInteger(cur, 1);
return new WhiteboardPenColor(light, dark);
} catch (Exception e) {
Timber.e(e, "Error retrieving whiteboard pen color from MetaDB ");
return WhiteboardPenColor.getDefault();
}
}
use of com.ichi2.anki.model.WhiteboardPenColor in project Anki-Android by ankidroid.
the class ReviewerNoParamTest method whiteboardPenColorChangeChangesDatabaseDark.
@Test
public void whiteboardPenColorChangeChangesDatabaseDark() {
enableDarkMode();
Whiteboard whiteboard = startReviewerForWhiteboard();
whiteboard.setPenColor(ARBITRARY_PEN_COLOR_VALUE);
WhiteboardPenColor penColor = getPenColor();
assertThat("Dark pen color is changed", penColor.getDarkPenColor(), is(ARBITRARY_PEN_COLOR_VALUE));
}
Aggregations