[android] update custom layer example with invalidation example

This commit is contained in:
Ivo van Dongen
2016-11-03 15:22:21 +02:00
committed by Ivo van Dongen
parent ee073f6b96
commit 505bf7db7a
4 changed files with 52 additions and 4 deletions

View File

@@ -146,6 +146,15 @@ public class CustomLayerActivity extends AppCompatActivity {
case R.id.action_update_layer:
updateLayer();
return true;
case R.id.action_set_color_red:
ExampleCustomLayer.setColor(1, 0, 0, 1);
return true;
case R.id.action_set_color_green:
ExampleCustomLayer.setColor(0, 1, 0, 1);
return true;
case R.id.action_set_color_blue:
ExampleCustomLayer.setColor(0, 0, 1, 1);
return true;
default:
return super.onOptionsItemSelected(item);
}

View File

@@ -6,6 +6,9 @@ public class ExampleCustomLayer {
}
public native static long createContext();
public native static void setColor(float red, float green, float blue, float alpha);
public static long InitializeFunction;
public static long RenderFunction;
public static long DeinitializeFunction;

View File

@@ -5,4 +5,13 @@
<item
android:id="@+id/action_update_layer"
android:title="Update layer (invalidate)" />
<item
android:id="@+id/action_set_color_red"
android:title="Red" />
<item
android:id="@+id/action_set_color_green"
android:title="Green" />
<item
android:id="@+id/action_set_color_blue"
android:title="Blue" />
</menu>