Added TimeScreen

This commit is contained in:
2022-08-11 14:56:10 +08:00
parent 440fe444c5
commit 46f86b8cca
33 changed files with 631 additions and 158 deletions

View File

@@ -1,8 +1,11 @@
package com.fatapp.oxygentoolbox;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.*;
import com.fatapp.oxygentoolbox.util.VariableChangeListener;
import com.fatapp.oxygentoolbox.util.VariableChangeSupport;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
@@ -14,4 +17,21 @@ public class ExampleUnitTest {
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
@Test
public void variableChangeTest() {
VariableChangeSupport<String> stringVariableChangeSupport = new VariableChangeSupport<>("Hello", new VariableChangeListener() {
@Override
public <T> void onChange(T newValue, T oldValue) {
System.out.println("newValue = " + newValue);
System.out.println("oldValue = " + oldValue);
}
});
stringVariableChangeSupport.setValue("Hello");
stringVariableChangeSupport.setValue("Hi");
stringVariableChangeSupport.setValue("Hi");
stringVariableChangeSupport.setValue("HI");
stringVariableChangeSupport.setValue("HI");
}
}