// Path: app/src/main/java/com/demo/amazing/util/LogUtil.java
// public class LogUtil {
// 
//     public static void e(String msg) {
//         Log.e("free", msg);
//     }
// 
//     public static void d(String tag, String msg) {
//         Log.e("free", msg);
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.graphics.SurfaceTexture;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.media.projection.MediaProjection;
import android.media.projection.MediaProjectionManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Surface;
import android.view.TextureView;
import android.view.View;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.Toast;
import com.demo.amazing.R;
import com.demo.amazing.util.LogUtil;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
		chronometer = (Chronometer) findViewById(R.id.update);
	}

	private void initViewsListener() {
		record.setOnClickListener(this);
		play.setOnClickListener(this);
		textureView.setSurfaceTextureListener(this);
	}

	@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
	private void init() {
		metrics = this.getResources().getDisplayMetrics();
		width = 720;
		height = 1280;
		//printInfo();
		manager = (MediaProjectionManager) getSystemService(MEDIA_PROJECTION_SERVICE);
	}

	@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
	private void printInfo() {
		MediaCodecList list = new MediaCodecList(MediaCodecList.ALL_CODECS);
		MediaCodecInfo[] codecInfos = list.getCodecInfos();
		for (MediaCodecInfo info : codecInfos) {
			if (info.isEncoder()) {
				StringBuilder sb = new StringBuilder();
				sb.append(info.getName() + " types=");
				String[] supportedTypes = info.getSupportedTypes();
				for (String string : supportedTypes) {
					sb.append(" " + string);
				}
// Path: app/src/main/java/com/demo/amazing/util/LogUtil.java
// public class LogUtil {
// 
//     public static void e(String msg) {
//         Log.e("free", msg);
//     }
// 
//     public static void d(String tag, String msg) {
//         Log.e("free", msg);
//     }
// }


// Path: app/src/main/java/com/demo/amazing/activity/ScreenRecordActivity.java
import android.content.Context;
import android.content.Intent;
import android.graphics.SurfaceTexture;
import android.hardware.display.DisplayManager;
import android.hardware.display.VirtualDisplay;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.media.projection.MediaProjection;
import android.media.projection.MediaProjectionManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Surface;
import android.view.TextureView;
import android.view.View;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.Toast;
import com.demo.amazing.R;
import com.demo.amazing.util.LogUtil;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

		chronometer = (Chronometer) findViewById(R.id.update);
	}

	private void initViewsListener() {
		record.setOnClickListener(this);
		play.setOnClickListener(this);
		textureView.setSurfaceTextureListener(this);
	}

	@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
	private void init() {
		metrics = this.getResources().getDisplayMetrics();
		width = 720;
		height = 1280;
		//printInfo();
		manager = (MediaProjectionManager) getSystemService(MEDIA_PROJECTION_SERVICE);
	}

	@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
	private void printInfo() {
		MediaCodecList list = new MediaCodecList(MediaCodecList.ALL_CODECS);
		MediaCodecInfo[] codecInfos = list.getCodecInfos();
		for (MediaCodecInfo info : codecInfos) {
			if (info.isEncoder()) {
				StringBuilder sb = new StringBuilder();
				sb.append(info.getName() + " types=");
				String[] supportedTypes = info.getSupportedTypes();
				for (String string : supportedTypes) {
					sb.append(" " + string);
				}
				LogUtil.e(sb.toString());