Skip to content

Commit

Permalink
Fix issue #28
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed Jan 26, 2018
1 parent 3a0f548 commit 03b3069
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
8 changes: 5 additions & 3 deletions app/src/main/java/cn/nekocode/camerafilter/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.view.MotionEvent;
import android.view.TextureView;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.Toast;

import java.io.File;
Expand All @@ -43,14 +44,15 @@
*/
public class MainActivity extends AppCompatActivity {
private static final int REQUEST_CAMERA_PERMISSION = 101;
private FrameLayout container;
private CameraRenderer renderer;
private TextureView textureView;
private int filterId = R.id.filter0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
setContentView(container = new FrameLayout(this));
setTitle("Original");

if (ContextCompat.checkSelfPermission(this,
Expand Down Expand Up @@ -84,8 +86,8 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in

void setupCameraPreviewView() {
renderer = new CameraRenderer(this);
textureView = (TextureView) findViewById(R.id.textureView);
assert textureView != null;
textureView = new TextureView(this);
container.addView(textureView);
textureView.setSurfaceTextureListener(renderer);

// Show original frame when touch the view
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/res/layout/main.xml

This file was deleted.

0 comments on commit 03b3069

Please sign in to comment.