mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update layout of servoshell android app (#33294)
* Update layout of servoshell android app Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove gap after loop/idle text Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
961fcfc46d
commit
a976db3ec0
8 changed files with 109 additions and 78 deletions
|
@ -12,7 +12,8 @@
|
|||
<application android:label="Servo" android:icon="@mipmap/servo">
|
||||
<activity android:name=".MainActivity"
|
||||
android:configChanges="density|keyboardHidden|navigation|orientation|screenSize|uiMode"
|
||||
android:exported="true">
|
||||
android:exported="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<meta-data android:name="android.app.lib_name" android:value="servo" />
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
|
|
@ -19,6 +19,7 @@ import android.view.inputmethod.EditorInfo;
|
|||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -32,10 +33,10 @@ public class MainActivity extends Activity implements Servo.Client {
|
|||
private static final String LOGTAG = "MainActivity";
|
||||
|
||||
ServoView mServoView;
|
||||
Button mBackButton;
|
||||
Button mFwdButton;
|
||||
Button mReloadButton;
|
||||
Button mStopButton;
|
||||
ImageButton mBackButton;
|
||||
ImageButton mFwdButton;
|
||||
ImageButton mReloadButton;
|
||||
ImageButton mStopButton;
|
||||
EditText mUrlField;
|
||||
ProgressBar mProgressBar;
|
||||
TextView mIdleText;
|
||||
|
@ -60,6 +61,9 @@ public class MainActivity extends Activity implements Servo.Client {
|
|||
mBackButton.setEnabled(false);
|
||||
mFwdButton.setEnabled(false);
|
||||
|
||||
// Avoid reload/stop icons doubling up on launch
|
||||
mReloadButton.setVisibility(View.GONE);
|
||||
|
||||
mServoView.setClient(this);
|
||||
mServoView.requestFocus();
|
||||
|
||||
|
|
BIN
support/android/apk/servoapp/src/main/res/drawable/cancel.png
Normal file
BIN
support/android/apk/servoapp/src/main/res/drawable/cancel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
support/android/apk/servoapp/src/main/res/drawable/refresh.png
Normal file
BIN
support/android/apk/servoapp/src/main/res/drawable/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -16,31 +16,20 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/my_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/backbutton"
|
||||
style="@android:style/Widget.Material.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:onClick="onBackClicked"
|
||||
android:text="Back"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/forwardbutton"
|
||||
style="@android:style/Widget.Material.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:onClick="onForwardClicked"
|
||||
android:text="Fwd"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/urlfield"
|
||||
style="@android:style/Widget.Material.EditText"
|
||||
|
@ -60,46 +49,84 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:indeterminate="true" />
|
||||
android:indeterminate="true"
|
||||
android:gravity="center" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/stopbutton"
|
||||
style="@android:style/Widget.Material.Button"
|
||||
style="@android:style/Widget.Material.ImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="centerInside"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="onStopClicked"
|
||||
android:text="Stop"
|
||||
android:textSize="10sp" />
|
||||
android:src="@drawable/cancel"
|
||||
android:gravity="center" />
|
||||
|
||||
<Button
|
||||
<ImageButton
|
||||
android:id="@+id/reloadbutton"
|
||||
style="@android:style/Widget.Material.Button"
|
||||
style="@android:style/Widget.Material.ImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="centerInside"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="onReloadClicked"
|
||||
android:text="Rld"
|
||||
android:textSize="10sp" />
|
||||
android:src="@drawable/refresh"
|
||||
android:gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/redrawing"
|
||||
android:layout_width="70dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:fontFamily="monospace"
|
||||
android:text="idle"
|
||||
android:textAlignment="center"
|
||||
android:textSize="10sp"
|
||||
android:visibility="visible" />
|
||||
android:visibility="visible"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<org.servo.servoview.ServoView
|
||||
android:id="@+id/servoview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:focusable="true"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/backbutton"
|
||||
style="@android:style/Widget.Material.ImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="centerInside"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="onBackClicked"
|
||||
android:src="@drawable/history_back" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/forwardbutton"
|
||||
style="@android:style/Widget.Material.ImageButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="centerInside"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="onForwardClicked"
|
||||
android:src="@drawable/history_forward" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
|
||||
<item name="android:statusBarColor">#212121</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue