質問編集履歴
4
xmlの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -253,3 +253,51 @@
|
|
253
253
|
}
|
254
254
|
|
255
255
|
```
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
```xml
|
260
|
+
|
261
|
+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
262
|
+
|
263
|
+
android:layout_width="match_parent"
|
264
|
+
|
265
|
+
android:layout_height="match_parent">
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
<com.example.android.camera2basic.AutoFitTextureView
|
272
|
+
|
273
|
+
android:id="@+id/texture"
|
274
|
+
|
275
|
+
android:layout_width="match_parent"
|
276
|
+
|
277
|
+
android:layout_height="match_parent"
|
278
|
+
|
279
|
+
android:layout_alignParentStart="true"
|
280
|
+
|
281
|
+
android:layout_alignParentTop="true" />
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
<com.example.android.camera2basic.AnimationSurfaceView
|
288
|
+
|
289
|
+
android:id="@+id/surface"
|
290
|
+
|
291
|
+
android:layout_width="match_parent"
|
292
|
+
|
293
|
+
android:layout_height="match_parent"
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
/>
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
</FrameLayout>
|
302
|
+
|
303
|
+
```
|
3
説明のついか
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
surfaceViewのクラスです
|
2
|
+
|
1
3
|
```java
|
2
4
|
|
3
5
|
import static android.content.ContentValues.TAG;
|
@@ -200,7 +202,7 @@
|
|
200
202
|
|
201
203
|
```
|
202
204
|
|
203
|
-
|
205
|
+
Fragmentのクラスです。
|
204
206
|
|
205
207
|
```java
|
206
208
|
|
2
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -204,6 +204,20 @@
|
|
204
204
|
|
205
205
|
```java
|
206
206
|
|
207
|
+
|
208
|
+
|
209
|
+
@Override
|
210
|
+
|
211
|
+
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
212
|
+
|
213
|
+
Bundle savedInstanceState) {
|
214
|
+
|
215
|
+
return inflater.inflate(R.layout.fragment_camera2_basic, container, false);
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
|
220
|
+
|
207
221
|
@Override
|
208
222
|
|
209
223
|
public void onViewCreated(final View view, Bundle savedInstanceState) {
|
1
Viewのクラスの使用場所を追記した
test
CHANGED
File without changes
|
test
CHANGED
@@ -199,3 +199,41 @@
|
|
199
199
|
}
|
200
200
|
|
201
201
|
```
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
```java
|
206
|
+
|
207
|
+
@Override
|
208
|
+
|
209
|
+
public void onViewCreated(final View view, Bundle savedInstanceState) {
|
210
|
+
|
211
|
+
mTextureView = (AutoFitTextureView) view.findViewById(R.id.texture);
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
if(mTextureView==null){
|
216
|
+
|
217
|
+
Log.e(TAG,"mTextureVieがnull");
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
Log.e(TAG,"mSurfaceViewに値をセットした");
|
222
|
+
|
223
|
+
mSurfaceView = (AnimationSurfaceView) view.findViewById(R.id.surface);
|
224
|
+
|
225
|
+
Log.e(TAG,"mSurfaceViewに値をセットした");
|
226
|
+
|
227
|
+
mSurfaceView.setZOrderOnTop(true);
|
228
|
+
|
229
|
+
mSurfaceView = new AnimationSurfaceView(getActivity());
|
230
|
+
|
231
|
+
if(mSurfaceView==null){
|
232
|
+
|
233
|
+
Log.e(TAG,"mSurfaceViewがnull");
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
```
|