Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
org.skia.viewer.ViewerActivity Class Reference
Inheritance diagram for org.skia.viewer.ViewerActivity:

Public Member Functions

boolean onCreateOptionsMenu (Menu menu)
 
boolean onOptionsItemSelected (MenuItem item)
 
void onConfigurationChanged (Configuration newConfig)
 
void surfaceCreated (SurfaceHolder holder)
 
void surfaceChanged (SurfaceHolder holder, int format, int width, int height)
 
void surfaceDestroyed (SurfaceHolder holder)
 
boolean onTouch (View v, MotionEvent event)
 
void setState (String stateJson)
 
void onStateChanged (String stateName, String stateValue)
 

Protected Member Functions

void onCreate (Bundle savedInstanceState)
 
void onPostCreate (Bundle savedInstanceState)
 
void onDestroy ()
 

Detailed Description

Definition at line 26 of file ViewerActivity.java.

Member Function Documentation

◆ onConfigurationChanged()

void org.skia.viewer.ViewerActivity.onConfigurationChanged ( Configuration  newConfig)
inline

Definition at line 106 of file ViewerActivity.java.

106 {
107 super.onConfigurationChanged(newConfig);
108 if (mDrawerToggle != null) {
109 mDrawerToggle.onConfigurationChanged(newConfig);
110 }
111 }

◆ onCreate()

void org.skia.viewer.ViewerActivity.onCreate ( Bundle  savedInstanceState)
inlineprotected

Definition at line 72 of file ViewerActivity.java.

72 {
73 super.onCreate(savedInstanceState);
74 setContentView(R.layout.activity_main);
75
76 SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
77 surfaceView.getHolder().addCallback(this);
78 surfaceView.setOnTouchListener(this);
79
80 mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
81 if (mDrawerLayout != null) { // xlarge-land has no drawer layout (drawer is always open)
82 mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
83 R.string.drawer_open, R.string.drawer_close);
84 mDrawerLayout.addDrawerListener(mDrawerToggle);
85 getActionBar().setDisplayHomeAsUpEnabled(true);
86 getActionBar().setHomeButtonEnabled(true);
87 }
88
89 mDrawerList = (ListView) findViewById(R.id.leftDrawer);
90 mStateAdapter = new StateAdapter(this);
91 mDrawerList.setAdapter(mStateAdapter);
92
93 mApplication = (ViewerApplication) getApplication();
94 mApplication.setViewerActivity(this);
95 }
void setViewerActivity(ViewerActivity viewerActivity)
#define R(r)

◆ onCreateOptionsMenu()

boolean org.skia.viewer.ViewerActivity.onCreateOptionsMenu ( Menu  menu)
inline

Definition at line 45 of file ViewerActivity.java.

45 {
46 MenuInflater inflater = getMenuInflater();
47 inflater.inflate(R.menu.title, menu);
48 return true;
49 }

◆ onDestroy()

void org.skia.viewer.ViewerActivity.onDestroy ( )
inlineprotected

Definition at line 114 of file ViewerActivity.java.

114 {
115 mApplication.setViewerActivity(null);
116 super.onDestroy();
117 }

◆ onOptionsItemSelected()

boolean org.skia.viewer.ViewerActivity.onOptionsItemSelected ( MenuItem  item)
inline

Definition at line 52 of file ViewerActivity.java.

52 {
53 // Pass the event to ActionBarDrawerToggle, if it returns
54 // true, then it has handled the app icon touch event
55 if (mDrawerToggle != null && mDrawerToggle.onOptionsItemSelected(item)) {
56 return true;
57 }
58
59 switch (item.getItemId()) {
60 case R.id.action_left:
61 onKeyPressed(mApplication.getNativeHandle(), KeyEvent.KEYCODE_SOFT_LEFT);
62 return true;
63 case R.id.action_right:
64 onKeyPressed(mApplication.getNativeHandle(), KeyEvent.KEYCODE_SOFT_RIGHT);
65 return true;
66 default:
67 return super.onOptionsItemSelected(item);
68 }
69 }

◆ onPostCreate()

void org.skia.viewer.ViewerActivity.onPostCreate ( Bundle  savedInstanceState)
inlineprotected

Definition at line 98 of file ViewerActivity.java.

98 {
99 super.onPostCreate(savedInstanceState);
100 if (mDrawerToggle != null) {
101 mDrawerToggle.syncState();
102 }
103 }

◆ onStateChanged()

void org.skia.viewer.ViewerActivity.onStateChanged ( String  stateName,
String  stateValue 
)
inline

Definition at line 157 of file ViewerActivity.java.

157 {
158 onUIStateChanged(mApplication.getNativeHandle(), stateName, stateValue);
159 }

◆ onTouch()

boolean org.skia.viewer.ViewerActivity.onTouch ( View  v,
MotionEvent  event 
)
inline

Definition at line 141 of file ViewerActivity.java.

141 {
142 int count = event.getPointerCount();
143 for (int i = 0; i < count; i++) {
144 final float x = event.getX(i);
145 final float y = event.getY(i);
146 final int owner = event.getPointerId(i);
147 int action = event.getAction() & MotionEvent.ACTION_MASK;
148 onTouched(mApplication.getNativeHandle(), owner, action, x, y);
149 }
150 return true;
151 }
int count
Definition: FontMgrTest.cpp:50
double y
double x

◆ setState()

void org.skia.viewer.ViewerActivity.setState ( String  stateJson)
inline

Definition at line 153 of file ViewerActivity.java.

153 {
154 mStateAdapter.setState(stateJson);
155 }
void setState(String stateJson)

◆ surfaceChanged()

void org.skia.viewer.ViewerActivity.surfaceChanged ( SurfaceHolder  holder,
int  format,
int  width,
int  height 
)
inline

Definition at line 127 of file ViewerActivity.java.

127 {
128 if (mApplication.getNativeHandle() != 0) {
129 onSurfaceChanged(mApplication.getNativeHandle(), holder.getSurface());
130 }
131 }

◆ surfaceCreated()

void org.skia.viewer.ViewerActivity.surfaceCreated ( SurfaceHolder  holder)
inline

Definition at line 120 of file ViewerActivity.java.

120 {
121 if (mApplication.getNativeHandle() != 0) {
122 onSurfaceCreated(mApplication.getNativeHandle(), holder.getSurface());
123 }
124 }

◆ surfaceDestroyed()

void org.skia.viewer.ViewerActivity.surfaceDestroyed ( SurfaceHolder  holder)
inline

Definition at line 134 of file ViewerActivity.java.

134 {
135 if (mApplication.getNativeHandle() != 0) {
136 onSurfaceDestroyed(mApplication.getNativeHandle());
137 }
138 }

The documentation for this class was generated from the following file: