Search in sources :

Example 6 with MemberState

use of com.herewhite.sdk.domain.MemberState in project whiteboard-android by netless-io.

the class PptResourceCacheActivity method shape.

public void shape(MenuItem item) {
    logAction();
    MemberState memberState = new MemberState();
    memberState.setStrokeColor(new int[] { 200, 200, 200 });
    // defalut Shape Triangle
    // memberState.setCurrentApplianceName(Appliance.SHAPE);
    // memberState.setShapeType(ShapeType.Rhombus);
    memberState.setStrokeWidth(4);
    memberState.setTextSize(10);
    mRoom.setMemberState(memberState);
}
Also used : MemberState(com.herewhite.sdk.domain.MemberState)

Example 7 with MemberState

use of com.herewhite.sdk.domain.MemberState in project whiteboard-android by netless-io.

the class RoomActivityTest method testSetAndGet_MemberState.

@Test
public void testSetAndGet_MemberState() {
    onIdle();
    MemberState state = new MemberState();
    state.setStrokeColor(new int[] { 99, 99, 99 });
    state.setCurrentApplianceName(Appliance.TEXT);
    state.setStrokeWidth(10);
    state.setTextSize(10);
    mActivity.mRoom.setMemberState(state);
    mActivity.mRoom.getMemberState(new Promise<MemberState>() {

        @Override
        public void then(MemberState memberState) {
            assertEquals(state.getCurrentApplianceName(), memberState.getCurrentApplianceName());
            assertArrayEquals(state.getStrokeColor(), memberState.getStrokeColor());
            assertEquals(state.getStrokeWidth(), memberState.getStrokeWidth(), Constants.DOUBLE_DELTA);
            assertEquals(state.getTextSize(), memberState.getTextSize(), Constants.DOUBLE_DELTA);
        }

        @Override
        public void catchEx(SDKError t) {
        }
    });
}
Also used : MemberState(com.herewhite.sdk.domain.MemberState) SDKError(com.herewhite.sdk.domain.SDKError) Test(org.junit.Test)

Example 8 with MemberState

use of com.herewhite.sdk.domain.MemberState in project whiteboard-android by netless-io.

the class RoomActivityTest method testDrawLineNet.

@Test
@Ignore
public void testDrawLineNet() {
    onView(withId(R.id.white)).check(matches(isDisplayed()));
    MemberState memberState = mActivity.mRoom.getMemberState();
    memberState.setStrokeColor(new int[] { 0xEF, 0x3A, 0x48 });
    mActivity.mRoom.setMemberState(memberState);
    drawVLines();
    drawHLines();
}
Also used : MemberState(com.herewhite.sdk.domain.MemberState) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 9 with MemberState

use of com.herewhite.sdk.domain.MemberState in project whiteboard-android by netless-io.

the class PptResourceCacheActivity method rectangle.

public void rectangle(MenuItem item) {
    logAction();
    MemberState memberState = new MemberState();
    memberState.setStrokeColor(new int[] { 99, 99, 99 });
    memberState.setCurrentApplianceName(Appliance.RECTANGLE);
    memberState.setStrokeWidth(10);
    memberState.setTextSize(10);
    mRoom.setMemberState(memberState);
}
Also used : MemberState(com.herewhite.sdk.domain.MemberState)

Example 10 with MemberState

use of com.herewhite.sdk.domain.MemberState in project whiteboard-android by netless-io.

the class PptResourceCacheActivity method color.

public void color(MenuItem item) {
    logAction();
    MemberState memberState = new MemberState();
    memberState.setStrokeColor(new int[] { 200, 200, 200 });
    memberState.setCurrentApplianceName(Appliance.PENCIL);
    memberState.setStrokeWidth(4);
    memberState.setTextSize(10);
    mRoom.setMemberState(memberState);
}
Also used : MemberState(com.herewhite.sdk.domain.MemberState)

Aggregations

MemberState (com.herewhite.sdk.domain.MemberState)15 Test (org.junit.Test)2 SDKError (com.herewhite.sdk.domain.SDKError)1 Ignore (org.junit.Ignore)1