increace stablerefresh
This commit is contained in:
parent
f33522a699
commit
ab0c36dc0d
2 changed files with 13 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue