Skip to content

Commit

Permalink
Update tray UI
Browse files Browse the repository at this point in the history
Signed-off-by: Songlin Jiang <[email protected]>
  • Loading branch information
HollowMan6 committed Aug 6, 2023
1 parent d89ff00 commit 195a6c4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/tray_background_left_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:topLeftRadius="10dp"/>
<solid android:color="@color/asphalt"/>
</shape>
</item>
</selector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/tray_background_right_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:topRightRadius="10dp" android:bottomRightRadius="10dp" />
<solid android:color="@color/asphalt"/>
</shape>
</item>
</selector>
36 changes: 21 additions & 15 deletions app/src/main/res/layout/tray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:layout_height="20dp"
android:layout_alignStart="@+id/tray_buttons"
android:layout_alignEnd="@+id/tray_buttons"
android:background="@drawable/tray_background_top"
android:background="@drawable/tray_background_left_round"
android:paddingStart="10dp"
android:paddingEnd="10dp">
<LinearLayout
Expand Down Expand Up @@ -171,17 +171,6 @@
app:regularModeBackground="@{traymodel.isMaxWindows ? @drawable/tray_background_unchecked_start : @drawable/tray_background_unchecked_middle}"
app:privateModeBackground="@{traymodel.isMaxWindows ? @drawable/tray_background_start_private : @drawable/tray_background_middle_private}"
app:activeModeBackground="@{traymodel.isMaxWindows ? @drawable/tray_background_checked_start : @drawable/tray_background_checked_middle}"/>

<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/privateButton"
style="@style/trayButtonMiddleTheme"
android:tooltipText="@{viewmodel.isPrivateSession? @string/private_browsing_exit_tooltip : @string/private_browsing_enter_tooltip}"
app:tooltipDensity="@dimen/tray_tooltip_density"
app:tooltipPosition="bottom"
app:tooltipLayout="@layout/tooltip_tray"
android:src="@{viewmodel.isPrivateSession ? @drawable/ic_icon_tray_private_browsing_on_v2 : @drawable/ic_icon_tray_private_browsing_v2}"
app:privateMode="@{viewmodel.isPrivateSession}"/>

<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/libraryButton"
style="@style/trayButtonMiddleTheme"
Expand Down Expand Up @@ -226,6 +215,16 @@
visibleGone="@{traymodel.downloadsNumber > 0}"/>
</RelativeLayout>

<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/privateButton"
style="@style/trayButtonMiddleTheme"
android:tooltipText="@{viewmodel.isPrivateSession? @string/private_browsing_exit_tooltip : @string/private_browsing_enter_tooltip}"
app:tooltipDensity="@dimen/tray_tooltip_density"
app:tooltipPosition="bottom"
app:tooltipLayout="@layout/tooltip_tray"
android:src="@{viewmodel.isPrivateSession ? @drawable/ic_icon_tray_private_browsing_on_v2 : @drawable/ic_icon_tray_private_browsing_v2}"
app:privateMode="@{viewmodel.isPrivateSession}"/>

<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/settingsButton"
style="@style/trayButtonMiddleTheme"
Expand All @@ -234,10 +233,17 @@
app:tooltipPosition="bottom"
app:tooltipLayout="@layout/tooltip_tray"
android:src="@drawable/ic_icon_tray_settings_v3"/>

</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/status_bar"
android:gravity="center_vertical"
android:background="@drawable/tray_background_right_round"
android:orientation="horizontal">
<View
android:layout_width="1dp"
android:layout_height="20dp"
android:layout_height="@dimen/tray_height"
android:layout_gravity="center_vertical"
android:background="@android:color/darker_gray"/>

Expand Down Expand Up @@ -275,7 +281,7 @@

<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/webAppsButton"
style="@style/trayButtonEndTheme"
style="@style/trayButtonMiddleTheme"
android:tooltipText="@{viewmodel.isWebAppsVisible ? @string/close_webapps_tooltip : @string/open_webapps_tooltip}"
app:tooltipDensity="@dimen/tray_tooltip_density"
app:tooltipPosition="bottom"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/dimen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<item name="tray_world_z" format="float" type="dimen">-2.5</item>
<item name="tray_world_width" format="float" type="dimen">1.2</item>
<dimen name="tray_width">408dp</dimen>
<dimen name="tray_height">66dp</dimen>
<dimen name="tray_height">62dp</dimen>
<item name="tray_tooltip_density" format="float" type="dimen">3.0</item>
<dimen name="tray_tooltip_padding_h">20dp</dimen>
<dimen name="tray_tooltip_padding_v">10dp</dimen>
Expand Down

0 comments on commit 195a6c4

Please sign in to comment.