|
|
|
@ -4,6 +4,8 @@ import static com.xypower.mppreview.HdrUtil.generateTimestamp;
|
|
|
|
|
import static java.lang.System.loadLibrary;
|
|
|
|
|
|
|
|
|
|
import android.Manifest;
|
|
|
|
|
import android.animation.Animator;
|
|
|
|
|
import android.animation.AnimatorInflater;
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
@ -51,7 +53,11 @@ import android.view.Surface;
|
|
|
|
|
import android.view.TextureView;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
import android.view.animation.Animation;
|
|
|
|
|
import android.view.animation.AnimationUtils;
|
|
|
|
|
import android.view.animation.LinearInterpolator;
|
|
|
|
|
import android.widget.Button;
|
|
|
|
|
import android.widget.ImageView;
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
import com.xypower.mppreview.bean.Contants;
|
|
|
|
@ -127,6 +133,8 @@ public class Camera2RawFragment extends Fragment {
|
|
|
|
|
|
|
|
|
|
private OrientationEventListener mOrientationListener;
|
|
|
|
|
private ExecutorService executorService;
|
|
|
|
|
private Button takepic;
|
|
|
|
|
private ImageView rorpic;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static native boolean makeHdr(long exposureTime1, String path1, long exposureTime2, String path2, String outputPath);
|
|
|
|
@ -533,10 +541,16 @@ public class Camera2RawFragment extends Fragment {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
Button takepic = view.findViewById(R.id.takepic);
|
|
|
|
|
takepic = view.findViewById(R.id.takepic);
|
|
|
|
|
rorpic = view.findViewById(R.id.rorpic);
|
|
|
|
|
takepic.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
takepic.setVisibility(View.INVISIBLE);
|
|
|
|
|
rorpic.setVisibility(View.VISIBLE);
|
|
|
|
|
Animation animation = AnimationUtils.loadAnimation(getContext(), R.anim.r);
|
|
|
|
|
animation.setInterpolator(new LinearInterpolator());
|
|
|
|
|
rorpic.startAnimation(animation);
|
|
|
|
|
takePicture();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -1129,7 +1143,18 @@ public class Camera2RawFragment extends Fragment {
|
|
|
|
|
images.clear();
|
|
|
|
|
Log.d("结束Hdr处理", "end");
|
|
|
|
|
if (b) {
|
|
|
|
|
showToast("HDR拍摄成功");
|
|
|
|
|
getActivity().runOnUiThread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
// 在主线程中执行UI更新
|
|
|
|
|
// ...
|
|
|
|
|
takepic.setVisibility(View.VISIBLE);
|
|
|
|
|
rorpic.clearAnimation();
|
|
|
|
|
rorpic.setVisibility(View.GONE);
|
|
|
|
|
showToast("HDR拍摄成功");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|