Skip to content

Commit

Permalink
Added a toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
sakusaku3939 committed Aug 3, 2024
1 parent cbd1e7c commit 7101c5d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
7 changes: 3 additions & 4 deletions app/src/main/assets/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ $('a').css('pointer-events', 'none');
$('*').css('-webkit-tap-highlight-color', 'rgba(0,0,0,.1)');

$('head').append(`<style>
[class*="LogoLink-module--translatorLink--"] ~ div,
[class^="ProductNavigation-module--container--"] + div,
[class^="SideMenuButton-module--menuButton--"],
header,
nav[class^="md"],
h2#translation-modes-heading + div > div:first-child,
div[data-testid="translator"] span:nth-child(3),
footer,
div[data-testid="chrome-extension-toast"],
div[data-testid="firefox-extension-toast"],
div[id^="cookieBanner"],
div[id="cookieBanner"],
aside {
display: none !important;
visibility: hidden;
Expand Down
42 changes: 39 additions & 3 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.4" />
android:orientation="vertical">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/toolbarBackground"
android:contentInsetStart="0dp"
android:contentInsetLeft="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:padding="0dp"
android:theme="?attr/actionBarTheme"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp">

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:paddingHorizontal="24dp"
android:paddingVertical="12dp"
android:scaleType="fitStart"
app:srcCompat="@drawable/deepl_logo" />

</androidx.appcompat.widget.Toolbar>

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.4" />

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<color name="colorAccent">#204060</color>
<color name="background">@color/background_material_light</color>
<color name="splashBackground">@color/background</color>
<color name="toolbarBackground">@color/background</color>

<color name="preferenceScreenAccent">@color/colorAccent</color>
</resources>

0 comments on commit 7101c5d

Please sign in to comment.