Skip to content

Commit

Permalink
Adjust tray layout
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeerias committed Nov 13, 2023
1 parent feec65c commit 6bb7f9f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
56 changes: 34 additions & 22 deletions app/src/main/res/layout/tray.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
</data>

<RelativeLayout
android:layout_width="@dimen/tray_width"
android:layout_height="@dimen/tray_height"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="top|center_horizontal">

<RelativeLayout
android:id="@+id/status_bar"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_height="28dp"
android:layout_alignStart="@+id/tray_buttons"
android:layout_alignEnd="@+id/tray_buttons"
android:background="@drawable/tray_background_left_round"
Expand Down Expand Up @@ -58,22 +58,23 @@
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_toEndOf="@+id/time"
android:layout_marginStart="6dp"
android:layout_centerVertical="true">
<ImageView
android:id="@+id/wifi_icon_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@{traymodel.wifiConnected ? @drawable/ic_icon_statusbar_wifi_list : @drawable/ic_icon_statusbar_nowifi}"
android:tint="@color/iron"
android:scaleType="fitCenter"/>
android:scaleType="fitCenter"
app:tint="@color/iron" />
<ImageView
android:id="@+id/wifi_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ic_icon_statusbar_wifi_list"
android:tint="@color/concrete"
android:scaleType="fitCenter"
app:visibleGone="@{traymodel.wifiConnected}"/>
app:tint="@color/concrete"
app:visibleGone="@{traymodel.wifiConnected}" />
</FrameLayout>
<LinearLayout
android:id="@+id/left_controller"
Expand All @@ -88,8 +89,8 @@
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@{traymodel.leftControllerIcon}"
android:tint="@color/concrete"
android:scaleType="fitCenter"/>
android:scaleType="fitCenter"
app:tint="@color/concrete" />
<ImageView
android:id="@+id/left_controller_battery_indicator"
android:layout_width="5dp"
Expand All @@ -110,8 +111,8 @@
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@{traymodel.rightControllerIcon}"
android:tint="@color/concrete"
android:scaleType="fitCenter"/>
android:scaleType="fitCenter"
app:tint="@color/concrete" />
<ImageView
android:id="@+id/right_controller_battery_indicator"
android:layout_width="5dp"
Expand All @@ -131,8 +132,8 @@
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@{traymodel.headsetIcon}"
android:tint="@color/concrete"
android:scaleType="fitCenter"/>
android:scaleType="fitCenter"
app:tint="@color/concrete" />
<ImageView
android:id="@+id/headset_battery_indicator"
android:layout_width="5dp"
Expand Down Expand Up @@ -233,26 +234,36 @@
app:tooltipDensity="@dimen/tray_tooltip_density"
app:tooltipPosition="bottom"
app:tooltipLayout="@layout/tooltip_tray"
android:src="@drawable/ic_icon_tray_settings_v3"/>
android:src="@drawable/ic_icon_tray_settings_v3" />
</LinearLayout>

<View
android:layout_width="1dp"
android:layout_height="0dp"
android:layout_alignTop="@id/status_bar"
android:layout_alignBottom="@id/tray_buttons"
android:layout_gravity="center_vertical"
android:layout_toLeftOf="@id/trayAppsButtonContainer"
android:background="@android:color/darker_gray" />

<LinearLayout
android:id="@+id/trayAppsButtonContainer"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@id/status_bar"
android:layout_toRightOf="@id/status_bar"
android:gravity="center_vertical"
android:layout_alignBottom="@id/tray_buttons"
android:layout_marginTop="-2px"
android:gravity="top"
android:background="@drawable/tray_background_right_round"
android:orientation="horizontal">
<View
android:layout_width="1dp"
android:layout_height="@dimen/tray_height"
android:layout_gravity="center_vertical"
android:background="@android:color/darker_gray"/>

<LinearLayout
android:id="@+id/trayAppsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/tray_background_bottom"
android:layout_gravity="start|bottom"
android:orientation="horizontal">

<com.igalia.wolvic.ui.views.UIButton
Expand Down Expand Up @@ -282,11 +293,12 @@

<com.igalia.wolvic.ui.views.UIButton
android:id="@+id/webAppsButton"
style="@style/trayButtonMiddleTheme"
style="@style/trayButtonEndTheme"
android:tooltipText="@{viewmodel.isWebAppsVisible ? @string/close_webapps_tooltip : @string/open_webapps_tooltip}"
app:tooltipDensity="@dimen/tray_tooltip_density"
app:tooltipPosition="bottom"
app:tooltipLayout="@layout/tooltip_tray"
android:layout_gravity="start|bottom"
android:src="@drawable/ic_icon_webapps"
app:clipDrawable="@drawable/ic_icon_webapps_clip"
app:activeMode="@{viewmodel.isWebAppsVisible}"/>
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 @@ -130,7 +130,7 @@
<dimen name="tray_width">408dp</dimen>
<dimen name="tray_height">66dp</dimen>
<!-- The density of the tray tooltips is the default one. -->
<item name="tray_tooltip_density" format="float" type="dimen">3.0</item>
<item name="tray_tooltip_density" format="float" type="dimen">1.0</item>
<dimen name="tray_tooltip_padding_h">20dp</dimen>
<dimen name="tray_tooltip_padding_v">10dp</dimen>
<dimen name="tray_tooltip_text_size">22sp</dimen>
Expand Down

0 comments on commit 6bb7f9f

Please sign in to comment.