mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
Show animation status
This commit is contained in:
parent
296b76070c
commit
6aa653a46d
4 changed files with 37 additions and 0 deletions
|
@ -18,6 +18,7 @@ import android.webkit.URLUtil;
|
|||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mozilla.servoview.ServoView;
|
||||
import com.mozilla.servoview.Servo;
|
||||
|
@ -35,6 +36,7 @@ public class MainActivity extends Activity implements Servo.Client {
|
|||
Button mStopButton;
|
||||
EditText mUrlField;
|
||||
ProgressBar mProgressBar;
|
||||
TextView mIdleText;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -49,6 +51,7 @@ public class MainActivity extends Activity implements Servo.Client {
|
|||
mStopButton = findViewById(R.id.stopbutton);
|
||||
mUrlField = findViewById(R.id.urlfield);
|
||||
mProgressBar = findViewById(R.id.progressbar);
|
||||
mIdleText = findViewById(R.id.redrawing);
|
||||
|
||||
mBackButton.setEnabled(false);
|
||||
mFwdButton.setEnabled(false);
|
||||
|
@ -151,6 +154,14 @@ public class MainActivity extends Activity implements Servo.Client {
|
|||
mFwdButton.setEnabled(canGoForward);
|
||||
}
|
||||
|
||||
public void onRedrawing(boolean redrawing) {
|
||||
if (redrawing) {
|
||||
mIdleText.setText("LOOP");
|
||||
} else {
|
||||
mIdleText.setText("IDLE");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
mServoView.onPause();
|
||||
|
|
|
@ -82,6 +82,17 @@
|
|||
android:text="Rld"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/redrawing"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:fontFamily="monospace"
|
||||
android:text="idle"
|
||||
android:textAlignment="center"
|
||||
android:textSize="10sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.mozilla.servoview.ServoView
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue