박정현

디자인 및 코드 수정

...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
10 <application 10 <application
11 android:allowBackup="true" 11 android:allowBackup="true"
12 android:icon="@mipmap/ic_launcher" 12 android:icon="@mipmap/ic_launcher"
13 - android:label="@string/app_name" 13 + android:label="TalkTalkSpeak!"
14 android:roundIcon="@mipmap/ic_launcher_round" 14 android:roundIcon="@mipmap/ic_launcher_round"
15 android:supportsRtl="true" 15 android:supportsRtl="true"
16 android:theme="@style/AppTheme"> 16 android:theme="@style/AppTheme">
17 - 17 + <activity android:name="com.example.talktalkspeak.MainActivity"/>
18 - <activity android:name="com.example.talktalkspeak.MainActivity"> 18 + <activity android:name="com.example.talktalkspeak.Intro">
19 - <intent-filter> 19 + <intent-filter>
20 <action android:name="android.intent.action.MAIN"/> 20 <action android:name="android.intent.action.MAIN"/>
21 <category android:name="android.intent.category.LAUNCHER"/> 21 <category android:name="android.intent.category.LAUNCHER"/>
22 </intent-filter> 22 </intent-filter>
......
1 +package com.example.talktalkspeak;
2 +
3 +import android.app.Activity;
4 +import android.content.Intent;
5 +import android.os.Bundle;
6 +import android.os.Handler;
7 +
8 +public class Intro extends Activity {
9 + Handler handler = new Handler();
10 + Runnable r = new Runnable() {
11 + public void run() {
12 + Intro.this.startActivity(new Intent(Intro.this.getApplicationContext(), MainActivity.class));
13 + Intro.this.finish();
14 + }
15 + };
16 +
17 + /* access modifiers changed from: protected */
18 + public void onCreate(Bundle savedInstanceState) {
19 + super.onCreate(savedInstanceState);
20 + setContentView(R.layout.intro);
21 + }
22 +
23 + /* access modifiers changed from: protected */
24 + public void onResume() {
25 + super.onResume();
26 + this.handler.postDelayed(this.r, 4000);
27 + }
28 +
29 + /* access modifiers changed from: protected */
30 + public void onPause() {
31 + super.onPause();
32 + this.handler.removeCallbacks(this.r);
33 + }
34 +}
...\ No newline at end of file ...\ No newline at end of file
1 package com.example.talktalkspeak; 1 package com.example.talktalkspeak;
2 2
3 +import android.annotation.SuppressLint;
3 import android.bluetooth.BluetoothAdapter; 4 import android.bluetooth.BluetoothAdapter;
4 import android.bluetooth.BluetoothDevice; 5 import android.bluetooth.BluetoothDevice;
5 import android.content.BroadcastReceiver; 6 import android.content.BroadcastReceiver;
...@@ -32,6 +33,8 @@ import java.util.Locale; ...@@ -32,6 +33,8 @@ import java.util.Locale;
32 import java.util.Set; 33 import java.util.Set;
33 import java.util.regex.Matcher; 34 import java.util.regex.Matcher;
34 import java.util.regex.Pattern; 35 import java.util.regex.Pattern;
36 +import android.telephony.SmsManager;
37 +import java.util.Date;
35 38
36 public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener { 39 public class MainActivity extends AppCompatActivity implements TextToSpeech.OnInitListener {
37 private static final String ACTION_NOTIFICATION_LISTENER_SETTINGS = "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"; 40 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 ...@@ -63,6 +66,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
63 ArrayList<String> engineList; 66 ArrayList<String> engineList;
64 ArrayList<String> engineSpinnerList; 67 ArrayList<String> engineSpinnerList;
65 68
69 +
66 private int isTTSReady = -2; 70 private int isTTSReady = -2;
67 private BroadcastReceiver kakaoReceiver; 71 private BroadcastReceiver kakaoReceiver;
68 long now = System.currentTimeMillis(); 72 long now = System.currentTimeMillis();
...@@ -92,7 +96,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn ...@@ -92,7 +96,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
92 setContentView((int) R.layout.activity_main); 96 setContentView((int) R.layout.activity_main);
93 this.tts = new TextToSpeech(this, this, this.ttsengine); 97 this.tts = new TextToSpeech(this, this, this.ttsengine);
94 98
95 - //this.editText = (TextView) findViewById(R.id.SMSText); 99 + // this.editText = (TextView) findViewById(R.id.SMSText);
96 this.deviceview = (TextView) findViewById(R.id.textView32); 100 this.deviceview = (TextView) findViewById(R.id.textView32);
97 this.button1 = (Button) findViewById(R.id.button1); 101 this.button1 = (Button) findViewById(R.id.button1);
98 this.button2 = (Button) findViewById(R.id.button2); 102 this.button2 = (Button) findViewById(R.id.button2);
...@@ -116,7 +120,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn ...@@ -116,7 +120,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
116 this.button3.setBackgroundResource(R.drawable.on); 120 this.button3.setBackgroundResource(R.drawable.on);
117 } else { 121 } else {
118 Toast.makeText(this, "메시지 수신 권한 없음.", 1).show(); 122 Toast.makeText(this, "메시지 수신 권한 없음.", 1).show();
119 - // ActivityCompat.requestPermissions(this, new String[]{"android.permission.RECEIVE_SMS"}, 1); 123 + ActivityCompat.requestPermissions(this, new String[]{"android.permission.RECEIVE_SMS"}, 1);
120 if (ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.RECEIVE_SMS")) { 124 if (ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.RECEIVE_SMS")) {
121 Toast.makeText(this, "메시지 권한 설명 필요함.", 1).show(); 125 Toast.makeText(this, "메시지 권한 설명 필요함.", 1).show();
122 } else { 126 } else {
...@@ -157,13 +161,15 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn ...@@ -157,13 +161,15 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
157 public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { 161 public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
158 int selectedItemPosition = parent.getSelectedItemPosition(); 162 int selectedItemPosition = parent.getSelectedItemPosition();
159 if (selectedItemPosition == 0) { 163 if (selectedItemPosition == 0) {
160 - double unused = MainActivity.this.speed = 0.5d; 164 + double unused = MainActivity.this.speed = 0.7d;
161 } else if (selectedItemPosition == 1) { 165 } else if (selectedItemPosition == 1) {
162 double unused2 = MainActivity.this.speed = 1.0d; 166 double unused2 = MainActivity.this.speed = 1.0d;
163 } else if (selectedItemPosition == 2) { 167 } else if (selectedItemPosition == 2) {
164 - double unused3 = MainActivity.this.speed = 1.5d; 168 + double unused3 = MainActivity.this.speed = 1.2d;
165 } else if (selectedItemPosition == 3) { 169 } else if (selectedItemPosition == 3) {
166 - double unused4 = MainActivity.this.speed = 2.0d; 170 + double unused4 = MainActivity.this.speed = 1.5d;
171 + } else if (selectedItemPosition == 4) {
172 + double unused5 = MainActivity.this.speed = 2.0d;
167 } 173 }
168 174
169 Log.d("spinner", "speed : " + MainActivity.this.speed); 175 Log.d("spinner", "speed : " + MainActivity.this.speed);
...@@ -208,24 +214,29 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn ...@@ -208,24 +214,29 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
208 } 214 }
209 215
210 216
217 +
211 public void processIntent(Intent intent) { 218 public void processIntent(Intent intent) {
212 if (intent != null) { 219 if (intent != null) {
213 String sender = intent.getStringExtra("sender"); 220 String sender = intent.getStringExtra("sender");
214 String contents = intent.getStringExtra("contents"); 221 String contents = intent.getStringExtra("contents");
215 222
216 -/* 223 +
217 if (sender == null || contents == null) { 224 if (sender == null || contents == null) {
218 - this.editText.setText((CharSequence) " "); 225 + // this.editText.setText((CharSequence) null);
219 - } else { 226 + }
220 - TextView textView = this.editText; 227 + else {
221 - textView.setText(sender + 10 + contents + 10); 228 + // TextView textView = this.editText;
229 + // textView.setText(sender + 10 + contents);
222 moveTaskToBack(true); 230 moveTaskToBack(true);
223 } 231 }
232 +
224 if (!this.button1.getBackground().getConstantState().equals(getResources().getDrawable(R.drawable.stop).getConstantState())) { 233 if (!this.button1.getBackground().getConstantState().equals(getResources().getDrawable(R.drawable.stop).getConstantState())) {
225 return; 234 return;
226 } 235 }
227 -*/ 236 + TextToSpeech(sender + contents);
228 } 237 }
238 +
239 +
229 } 240 }
230 241
231 242
...@@ -350,7 +361,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn ...@@ -350,7 +361,7 @@ public class MainActivity extends AppCompatActivity implements TextToSpeech.OnIn
350 this.tts.setPitch(1.0f); 361 this.tts.setPitch(1.0f);
351 this.tts.setSpeechRate((float) this.speed); 362 this.tts.setSpeechRate((float) this.speed);
352 if (Build.VERSION.SDK_INT >= 21) { 363 if (Build.VERSION.SDK_INT >= 21) {
353 - this.tts.addEarcon("[alarm]", BuildConfig.APPLICATION_ID, R.raw.alarm); 364 + this.tts.addEarcon("[alarm]", BuildConfig.APPLICATION_ID, R.raw.alram);
354 this.tts.playEarcon("[alarm]", 1, (Bundle) null, "utteranceId"); 365 this.tts.playEarcon("[alarm]", 1, (Bundle) null, "utteranceId");
355 this.tts.speak(str, 1, (Bundle) null, "utteranceId"); 366 this.tts.speak(str, 1, (Bundle) null, "utteranceId");
356 if (this.tts.isSpeaking()) { 367 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
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <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"> 2 <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">
3 +
3 <LinearLayout 4 <LinearLayout
4 android:layout_width="match_parent" 5 android:layout_width="match_parent"
5 android:layout_height="match_parent" 6 android:layout_height="match_parent"
...@@ -14,9 +15,24 @@ ...@@ -14,9 +15,24 @@
14 android:background="@drawable/start" 15 android:background="@drawable/start"
15 app:srcCompat="@drawable/start" /> 16 app:srcCompat="@drawable/start" />
16 17
18 +
19 +
17 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"/> 20 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"/>
21 +
18 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> 22 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
19 - <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"/> 23 +
24 + <TextView
25 + android:id="@+id/textView2"
26 + android:layout_width="match_parent"
27 + android:layout_height="40dp"
28 + android:background="#fae100"
29 + android:gravity="left|center_vertical|center_horizontal|center"
30 + android:paddingLeft="10dp"
31 + android:text="알림 안내 권한"
32 + android:textColor="@android:color/black"
33 + android:textStyle="bold"
34 + app:layout_constraintHorizontal_bias="0.313"
35 + app:layout_constraintVertical_bias="0.253" />
20 36
21 <Button 37 <Button
22 android:id="@+id/button2" 38 android:id="@+id/button2"
...@@ -42,7 +58,19 @@ ...@@ -42,7 +58,19 @@
42 app:layout_constraintVertical_bias="0.188" /> 58 app:layout_constraintVertical_bias="0.188" />
43 </FrameLayout> 59 </FrameLayout>
44 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> 60 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
45 - <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"/> 61 +
62 + <TextView
63 + android:id="@+id/textView3"
64 + android:layout_width="match_parent"
65 + android:layout_height="40dp"
66 + android:background="#fae100"
67 + android:gravity="left|center_vertical|center_horizontal|center"
68 + android:paddingLeft="10dp"
69 + android:text="블루투스 연결상태"
70 + android:textColor="@android:color/black"
71 + android:textStyle="bold"
72 + app:layout_constraintHorizontal_bias="0.313"
73 + app:layout_constraintVertical_bias="0.352" />
46 74
47 <Button 75 <Button
48 android:id="@+id/button4" 76 android:id="@+id/button4"
...@@ -71,7 +99,19 @@ ...@@ -71,7 +99,19 @@
71 <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"/> 99 <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"/>
72 <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"/> 100 <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"/>
73 </LinearLayout> 101 </LinearLayout>
74 - <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"/> 102 +
103 + <TextView
104 + android:id="@+id/textView4"
105 + android:layout_width="match_parent"
106 + android:layout_height="40dp"
107 + android:background="#fae100"
108 + android:gravity="left|center_vertical|center_horizontal|center"
109 + android:paddingLeft="10dp"
110 + android:text="사운드 설정"
111 + android:textColor="@android:color/black"
112 + android:textStyle="bold"
113 + app:layout_constraintHorizontal_bias="0.313"
114 + app:layout_constraintVertical_bias="0.448" />
75 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> 115 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
76 <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="볼륨"/> 116 <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="볼륨"/>
77 <SeekBar android:layout_gravity="right|center_vertical|center_horizontal|center" android:id="@+id/volumeBar" android:layout_width="300dp" android:layout_height="60dp"/> 117 <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 @@ ...@@ -80,7 +120,19 @@
80 <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="읽기 속도"/> 120 <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="읽기 속도"/>
81 <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"/> 121 <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"/>
82 </FrameLayout> 122 </FrameLayout>
83 - <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"/> 123 +
124 + <TextView
125 + android:id="@+id/textView5"
126 + android:layout_width="match_parent"
127 + android:layout_height="40dp"
128 + android:background="#fae100"
129 + android:gravity="left|center_vertical|center_horizontal|center"
130 + android:paddingLeft="10dp"
131 + android:text="읽기 설정"
132 + android:textColor="@android:color/black"
133 + android:textStyle="bold"
134 + app:layout_constraintHorizontal_bias="0.313"
135 + app:layout_constraintVertical_bias="0.546" />
84 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> 136 <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent">
85 <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 엔진 설정"/> 137 <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 엔진 설정"/>
86 138
......
1 +<?xml version="1.0" encoding="utf-8"?>
2 +<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">
3 + <ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/intro" android:scaleType="fitXY"/>
4 +</LinearLayout>
...\ No newline at end of file ...\ 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
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <resources> 2 <resources>
3 <array name="읽기속도"> 3 <array name="읽기속도">
4 - <item>느림(0.5배속)</item> 4 + <item>느림(0.7배속)</item>
5 <item>보통(1배속)</item> 5 <item>보통(1배속)</item>
6 - <item>약간빠름(1.5배속)</item> 6 + <item>약간빠름(1.2배속)</item>
7 - <item>빠름(2배속)</item> 7 + <item>좀더빠름(1.5배속)</item>
8 + <item>매우빠름(2배속)</item>
8 </array> 9 </array>
9 </resources> 10 </resources>
...\ No newline at end of file ...\ No newline at end of file
......