// Path: app/src/main/java/io/rapidpro/surveyor/Logger.java
// public class Logger {
// 
//     private static final String TAG = "Surveyor";
// 
//     public static void e(String message, Throwable t) {
//         Log.e(TAG, message, t);
//     }
// 
//     public static void w(String message) {
//         Log.w(TAG, message);
//     }
// 
//     public static void d(String message) {
//         Log.d(TAG, message);
//     }
// }
// 
// Path: app/src/main/java/io/rapidpro/surveyor/SurveyorIntent.java
// public interface SurveyorIntent {
//     String EXTRA_ORG_UUID = "surveyor.extra.org_uuid";
//     String EXTRA_FLOW_UUID = "surveyor.extra.flow_uuid";
// 
//     String EXTRA_SUBMISSION_FILE = "surveyor.extra.submission_file";
// 
//     // where media files are to be stored
//     String EXTRA_MEDIA_FILE = "surveyor.extra.media_file";
// 
//     String EXTRA_ERROR = "surveyor.extra.error";
//     String EXTRA_CAMERA_DIRECTION = "surveyor.extra.camera_direction";
// }
// 
// Path: app/src/main/java/io/rapidpro/surveyor/ui/IconTextView.java
// public class IconTextView extends TextView {
//     public IconTextView(Context context, AttributeSet attrs) {
//         super(context, attrs);
//         setTypeface(Typefaces.get(getContext(), "material.ttf"));
//     }
// 
//     public void setIconColor(int color) {
//         setTextColor(getResources().getColor(color));
//     }
// }


import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import io.rapidpro.surveyor.Logger;
import io.rapidpro.surveyor.R;
import io.rapidpro.surveyor.SurveyorIntent;
import io.rapidpro.surveyor.ui.IconTextView;
package io.rapidpro.surveyor.activity;



/**
 * Activity for capturing an audio recording
 */
public class CaptureAudioActivity extends BaseActivity {

    private boolean isRecording = false;
    private MediaRecorder mediaRecorder;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_capture_audio);
    }

    @Override
    public boolean requireLogin() {
        return false;
    }

    public void recordAudio() {
        isRecording = true;

        String output = getIntent().getStringExtra(SurveyorIntent.EXTRA_MEDIA_FILE);

// Path: app/src/main/java/io/rapidpro/surveyor/Logger.java
// public class Logger {
// 
//     private static final String TAG = "Surveyor";
// 
//     public static void e(String message, Throwable t) {
//         Log.e(TAG, message, t);
//     }
// 
//     public static void w(String message) {
//         Log.w(TAG, message);
//     }
// 
//     public static void d(String message) {
//         Log.d(TAG, message);
//     }
// }
// 
// Path: app/src/main/java/io/rapidpro/surveyor/SurveyorIntent.java
// public interface SurveyorIntent {
//     String EXTRA_ORG_UUID = "surveyor.extra.org_uuid";
//     String EXTRA_FLOW_UUID = "surveyor.extra.flow_uuid";
// 
//     String EXTRA_SUBMISSION_FILE = "surveyor.extra.submission_file";
// 
//     // where media files are to be stored
//     String EXTRA_MEDIA_FILE = "surveyor.extra.media_file";
// 
//     String EXTRA_ERROR = "surveyor.extra.error";
//     String EXTRA_CAMERA_DIRECTION = "surveyor.extra.camera_direction";
// }
// 
// Path: app/src/main/java/io/rapidpro/surveyor/ui/IconTextView.java
// public class IconTextView extends TextView {
//     public IconTextView(Context context, AttributeSet attrs) {
//         super(context, attrs);
//         setTypeface(Typefaces.get(getContext(), "material.ttf"));
//     }
// 
//     public void setIconColor(int color) {
//         setTextColor(getResources().getColor(color));
//     }
// }


// Path: app/src/main/java/io/rapidpro/surveyor/activity/CaptureAudioActivity.java
import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import io.rapidpro.surveyor.Logger;
import io.rapidpro.surveyor.R;
import io.rapidpro.surveyor.SurveyorIntent;
import io.rapidpro.surveyor.ui.IconTextView;

package io.rapidpro.surveyor.activity;



/**
 * Activity for capturing an audio recording
 */
public class CaptureAudioActivity extends BaseActivity {

    private boolean isRecording = false;
    private MediaRecorder mediaRecorder;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_capture_audio);
    }

    @Override
    public boolean requireLogin() {
        return false;
    }

    public void recordAudio() {
        isRecording = true;

        String output = getIntent().getStringExtra(SurveyorIntent.EXTRA_MEDIA_FILE);

        Logger.d("Recording audio to " + output + "...");