박정현

테스트 버튼 추가

No preview for this file type
......@@ -34,6 +34,9 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.telephony.SmsManager;
import org.w3c.dom.Text;
import java.util.Date;
public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {
......@@ -62,6 +65,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
private Button button3;
private Button button4;
private Button button5;
private Button button6;
public TextView deviceview;
private TextView editText;
......@@ -110,6 +114,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
this.button3 = (Button) findViewById(R.id.button3);
this.button4 = (Button) findViewById(R.id.button4);
this.button5 = (Button) findViewById(R.id.button5);
this.button6 = (Button) findViewById(R.id.button6);
this.spinner = (Spinner) findViewById(R.id.spinner);
spinner.setSelection(2);
this.spinner2 = (Spinner) findViewById(R.id.spinner2);
......@@ -166,6 +171,13 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
}
});
this.button6.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
String test = "테스트입니다. 목소리 톤과 속도를 알맞게 조정해 주세요.";
TextToSpeech(test);
}
});
//TTS 속도조정
this.spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
......@@ -265,6 +277,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
private void initializeKakaoReceiver() {
this.kakaoReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
......
......@@ -50,7 +50,7 @@
<Button
android:id="@+id/button3"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_height="50dp"
android:layout_gravity="right|center_vertical|center_horizontal|center"
android:layout_marginRight="10dp"
android:background="@drawable/on"
......@@ -88,7 +88,7 @@
<Button
android:id="@+id/button5"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_height="50dp"
android:layout_gravity="right|center_vertical|center_horizontal|center"
android:layout_marginRight="10dp"
android:background="@drawable/on"
......@@ -125,6 +125,20 @@
<TextView android:textSize="20sp" android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView42" android:background="#FFFFFF" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="60dp" android:text="톤 설정"/>
<Spinner android:entries="@array/톤" android:layout_gravity="right|center_vertical|center_horizontal|center" android:id="@+id/spinner3" android:layout_width="200dp" android:layout_height="match_parent"/>
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
<TextView android:textSize="20sp" android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView43" android:background="#FFFFFF" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="60dp" android:text="음성 테스트"/>
<Button
android:id="@+id/button6"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="right|center_vertical|center_horizontal|center"
android:layout_marginRight="80dp"
android:background="@drawable/play"
app:layout_constraintHorizontal_bias="0.95"
app:layout_constraintVertical_bias="0.289" />
</FrameLayout>
<TextView
android:id="@+id/textView5"
......