increace stablerefresh

This commit is contained in:
Alexey Kuznetsov 2016-03-26 18:40:16 +03:00
commit ab0c36dc0d
2 changed files with 13 additions and 4 deletions

View file

@ -532,6 +532,8 @@ public class RecordingActivity extends AppCompatActivity {
thread.interrupt();
}
pitch.record();
thread = new Thread(new Runnable() {
@Override
public void run() {
@ -640,8 +642,6 @@ public class RecordingActivity extends AppCompatActivity {
}, "RecordingThread");
thread.start();
pitch.record();
showNotificationAlarm(true);
}

View file

@ -479,6 +479,7 @@ public class PitchView extends ViewGroup {
draw = new Runnable() {
long start = System.currentTimeMillis();
int count = 0;
@Override
public void run() {
@ -493,7 +494,13 @@ public class PitchView extends ViewGroup {
start = cur;
stableRefresh = true;
synchronized (this) {
if (count > 10)
stableRefresh = true;
}
count += 1;
if (delay > 0)
handler.postDelayed(draw, delay);
else
@ -559,6 +566,8 @@ public class PitchView extends ViewGroup {
}
public boolean stableRefresh() {
return stableRefresh;
synchronized (this) {
return stableRefresh;
}
}
}