박정현

디자인 및 코드 수정

......@@ -10,13 +10,13 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:label="TalkTalkSpeak!"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.example.talktalkspeak.MainActivity">
<intent-filter>
<activity android:name="com.example.talktalkspeak.MainActivity"/>
<activity android:name="com.example.talktalkspeak.Intro">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
......
package com.example.talktalkspeak;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class Intro extends Activity {
Handler handler = new Handler();
Runnable r = new Runnable() {
public void run() {
Intro.this.startActivity(new Intent(Intro.this.getApplicationContext(), MainActivity.class));
Intro.this.finish();
}
};
/* access modifiers changed from: protected */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.intro);
}
/* access modifiers changed from: protected */
public void onResume() {
super.onResume();
this.handler.postDelayed(this.r, 4000);
}
/* access modifiers changed from: protected */
public void onPause() {
super.onPause();
this.handler.removeCallbacks(this.r);
}
}
\ No newline at end of file
package com.example.talktalkspeak;
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
......@@ -32,6 +33,8 @@ import java.util.Locale;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import android.telephony.SmsManager;
import java.util.Date;
public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {
private static final String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS";
......@@ -63,6 +66,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
ArrayList<String> engineList;
ArrayList<String> engineSpinnerList;
private int isTTSReady = -2;
private BroadcastReceiver kakaoReceiver;
long now = System.currentTimeMillis();
......@@ -92,7 +96,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
setContentView((int) R.layout.activity_main);
this.tts = new TextToSpeech(this, this, this.ttsengine);
//this.editText = (TextView) findViewById(R.id.SMSText);
// this.editText = (TextView) findViewById(R.id.SMSText);
this.deviceview = (TextView) findViewById(R.id.textView32);
this.button1 = (Button) findViewById(R.id.button1);
this.button2 = (Button) findViewById(R.id.button2);
......@@ -116,7 +120,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
this.button3.setBackgroundResource(R.drawable.on);
} else {
Toast.makeText(this, "메시지 수신 권한 없음.", 1).show();
// ActivityCompat.requestPermissions(this, new String[]{"android.permission.RECEIVE_SMS"}, 1);
ActivityCompat.requestPermissions(this, new String[]{"android.permission.RECEIVE_SMS"}, 1);
if (ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.RECEIVE_SMS")) {
Toast.makeText(this, "메시지 권한 설명 필요함.", 1).show();
} else {
......@@ -157,13 +161,15 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
int selectedItemPosition = parent.getSelectedItemPosition();
if (selectedItemPosition == 0) {
double unused = MainActivity.this.speed = 0.5d;
double unused = MainActivity.this.speed = 0.7d;
} else if (selectedItemPosition == 1) {
double unused2 = MainActivity.this.speed = 1.0d;
} else if (selectedItemPosition == 2) {
double unused3 = MainActivity.this.speed = 1.5d;
double unused3 = MainActivity.this.speed = 1.2d;
} else if (selectedItemPosition == 3) {
double unused4 = MainActivity.this.speed = 2.0d;
double unused4 = MainActivity.this.speed = 1.5d;
} else if (selectedItemPosition == 4) {
double unused5 = MainActivity.this.speed = 2.0d;
}
Log.d("spinner", "speed : " + MainActivity.this.speed);
......@@ -208,24 +214,29 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
}
public void processIntent(Intent intent) {
if (intent != null) {
String sender = intent.getStringExtra("sender");
String contents = intent.getStringExtra("contents");
/*
if (sender == null || contents == null) {
this.editText.setText((CharSequence) " ");
} else {
TextView textView = this.editText;
textView.setText(sender + 10 + contents + 10);
// this.editText.setText((CharSequence) null);
}
else {
// TextView textView = this.editText;
// textView.setText(sender + 10 + contents);
moveTaskToBack(true);
}
if (!this.button1.getBackground().getConstantState().equals(getResources().getDrawable(R.drawable.stop).getConstantState())) {
return;
}
*/
TextToSpeech(sender + contents);
}
}
......@@ -350,7 +361,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
this.tts.setPitch(1.0f);
this.tts.setSpeechRate((float) this.speed);
if (Build.VERSION.SDK_INT >= 21) {
this.tts.addEarcon("[alarm]", BuildConfig.APPLICATION_ID, R.raw.alarm);
this.tts.addEarcon("[alarm]", BuildConfig.APPLICATION_ID, R.raw.alram);
this.tts.playEarcon("[alarm]", 1, (Bundle) null, "utteranceId");
this.tts.speak(str, 1, (Bundle) null, "utteranceId");
if (this.tts.isSpeaking()) {
......

7.83 KB | W: | H:

41.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.75 KB | W: | H:

17.6 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.95 KB | W: | H:

16.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -14,9 +15,24 @@
android:background="@drawable/start"
app:srcCompat="@drawable/start" />
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"/>
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
<TextView android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView2" android:background="#F7FE2E" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="40dp" android:text="알림 안내 권한" app:layout_constraintHorizontal_bias="0.313" app:layout_constraintVertical_bias="0.253"/>
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#fae100"
android:gravity="left|center_vertical|center_horizontal|center"
android:paddingLeft="10dp"
android:text="알림 안내 권한"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintHorizontal_bias="0.313"
app:layout_constraintVertical_bias="0.253" />
<Button
android:id="@+id/button2"
......@@ -42,7 +58,19 @@
app:layout_constraintVertical_bias="0.188" />
</FrameLayout>
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
<TextView android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView3" android:background="#F7FE2E" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="40dp" android:text="블루투스 연결상태" app:layout_constraintHorizontal_bias="0.313" app:layout_constraintVertical_bias="0.352"/>
<TextView
android:id="@+id/textView3"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#fae100"
android:gravity="left|center_vertical|center_horizontal|center"
android:paddingLeft="10dp"
android:text="블루투스 연결상태"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintHorizontal_bias="0.313"
app:layout_constraintVertical_bias="0.352" />
<Button
android:id="@+id/button4"
......@@ -71,7 +99,19 @@
<TextView android:textSize="20sp" android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView31" android:background="#FFFFFF" android:paddingLeft="10dp" android:layout_width="0dp" android:layout_height="60dp" android:text="연결된 기기" android:layout_weight="1"/>
<TextView android:textSize="20sp" android:textColor="@android:color/black" android:gravity="right|center_vertical|center_horizontal|center" android:id="@+id/textView32" android:background="#FFFFFF" android:paddingRight="10dp" android:layout_width="0dp" android:layout_height="60dp" android:text="" android:layout_weight="1"/>
</LinearLayout>
<TextView android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView4" android:background="#F7FE2E" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="40dp" android:text="사운드 설정" app:layout_constraintHorizontal_bias="0.313" app:layout_constraintVertical_bias="0.448"/>
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#fae100"
android:gravity="left|center_vertical|center_horizontal|center"
android:paddingLeft="10dp"
android:text="사운드 설정"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintHorizontal_bias="0.313"
app:layout_constraintVertical_bias="0.448" />
<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/textView40" android:background="#FFFFFF" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="60dp" android:text="볼륨"/>
<SeekBar android:layout_gravity="right|center_vertical|center_horizontal|center" android:id="@+id/volumeBar" android:layout_width="300dp" android:layout_height="60dp"/>
......@@ -80,7 +120,19 @@
<TextView android:textSize="20sp" android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView41" 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/spinner" android:layout_width="200dp" android:layout_height="match_parent"/>
</FrameLayout>
<TextView android:textStyle="bold" android:textColor="@android:color/black" android:gravity="left|center_vertical|center_horizontal|center" android:id="@+id/textView5" android:background="#F7FE2E" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="40dp" android:text="읽기 설정" app:layout_constraintHorizontal_bias="0.313" app:layout_constraintVertical_bias="0.546"/>
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#fae100"
android:gravity="left|center_vertical|center_horizontal|center"
android:paddingLeft="10dp"
android:text="읽기 설정"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintHorizontal_bias="0.313"
app:layout_constraintVertical_bias="0.546" />
<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/textView50" android:background="#FFFFFF" android:paddingLeft="10dp" android:layout_width="match_parent" android:layout_height="60dp" android:text="TTS 엔진 설정"/>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
<ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/intro" android:scaleType="fitXY"/>
</LinearLayout>
\ No newline at end of file

3.51 KB | W: | H:

4.65 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

2.57 KB | W: | H:

2.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

4.81 KB | W: | H:

6.16 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

7.72 KB | W: | H:

11.7 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

10.4 KB | W: | H:

15.9 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="읽기속도">
<item>느림(0.5배속)</item>
<item>느림(0.7배속)</item>
<item>보통(1배속)</item>
<item>약간빠름(1.5배속)</item>
<item>빠름(2배속)</item>
<item>약간빠름(1.2배속)</item>
<item>좀더빠름(1.5배속)</item>
<item>매우빠름(2배속)</item>
</array>
</resources>
\ No newline at end of file
......