[android] update custom layer example with invalidation example
This commit is contained in:
committed by
Ivo van Dongen
parent
ee073f6b96
commit
505bf7db7a
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user