Skip to content

Commit

Permalink
Added Hide Task Button, Hide Status Bar Separators and small Taskbar …
Browse files Browse the repository at this point in the history
…Fixes options.
  • Loading branch information
root committed Sep 14, 2020
1 parent b3f03a8 commit 10ec1c6
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 22 deletions.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# XposedDex
# XposedDex One UI 2.1
Samsung Dex modifications through Xposed

1. Immersive Apps,
Will enable the possibility to define which apps to run in Immersive mode so they remove the titlebar when maximized.

2. Hide Dex Logo,
Removes the Dex logo from the taskbar to have more space (that menu wasn't anyway that useful). (change requires restart)
Removes the Dex logo from the taskbar to have more space (that menu wasn't anyway that useful).

3. Hide NoSIM Icon,
Removes the NoSIM icon from statusbar. (change requires restart)
3. Hide NoSIM Icon,
Removes the NoSIM icon from statusbar.

4. Hide App Overflow Buttons,
Removes left and right arrows when to many apps are open. (change requires restart)
4. Hide App Overflow Buttons,
Removes left and right arrows when to many apps are open.

5. Fix Keyboard,
Enables floating mode for non qwerty keyboard layouts too and fixes dark mode having a white border around the keyboard. (change requires restart)
Enables floating mode for non qwerty keyboard layouts too and fixes dark mode having a white border around the keyboard.

6. Fix Samsung Browser,
Enables secret mode (as it's disabled if Magisk installed) and disable always visible scroll bar (looks ugly under dark mode). (change requires restart)
Enables secret mode (as it's disabled if Magisk installed) and disable always visible scroll bar (looks ugly under dark mode).

7. Fix Weather,
Keep displaying weather icon in the statusbar. (change requires restart)
Keep displaying weather icon in the statusbar.

8. Hide Task Button,
Remove the tasks button on the taskbar.

9. Hide Status Bar Separators,
Makes statusbar more compact and hides empty spaces.

10. Taskbar Fixes
Don't make it fully black (buttons on the taskbar) when window maximized.

NOTE: All changes require a restart.

IMPORTANT: Requires Magisk and edXposed installed on your tablet.
Only tested with One UI 2.1, Android 10, Build T865XXU2BTC7 so latest release for Tab S6
Binary file modified bin/com.pijulius.xposeddex.apk
Binary file not shown.
8 changes: 6 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
<string name="settings_fix_sbrowser_sum">Enables secret mode and disable always visible scroll bar.</string>
<string name="settings_fix_weather">Fix Weather</string>
<string name="settings_fix_weather_sum">Keep displaying weather icon in the statusbar.</string>
<string name="settings_fix_squid">Fix Squid</string>
<string name="settings_fix_squid_sum">Make it Premium and some small fixes.</string>

<string name="settings_samsung_dex_taskbar">Dex Taskbar</string>
<string name="settings_fix_taskbar">Fix Taskbar</string>
<string name="settings_fix_taskbar_sum">Disable setting black backgrounds for statusbar and taskbar buttons on maximized applications.</string>
<string name="settings_hide_dex_logo">Hide Dex Logo</string>
<string name="settings_hide_dex_logo_sum">Removes the Dex logo from the taskbar.</string>
<string name="settings_hide_tasks_button">Hide Tasks Button</string>
<string name="settings_hide_tasks_button_sum">Removes the Tasks button from the taskbar.</string>
<string name="settings_hide_nosim_icon">Hide NoSIM Icon</string>
<string name="settings_hide_nosim_icon_sum">Removes the NoSIM icon from statusbar.</string>
<string name="settings_hide_statusbar_separators">Hide StatusBar Separators</string>
<string name="settings_hide_statusbar_separators_sum">Removes empty gaps from statusbar to make it more compact.</string>
<string name="settings_hide_app_overflow_buttons">Hide App Overflow Buttons</string>
<string name="settings_hide_app_overflow_buttons_sum">Removes left and right arrows when to many apps are open.</string>

Expand Down
28 changes: 21 additions & 7 deletions res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,32 @@
android:title="@string/settings_fix_weather"
android:key="fixWeather" />

<CheckBoxPreference
android:name="@string/settings_fix_squid"
android:summary="@string/settings_fix_squid_sum"
android:defaultValue="true"
android:title="@string/settings_fix_squid"
android:key="fixSquid" />

</PreferenceCategory>

<PreferenceCategory
android:title="@string/settings_samsung_dex_taskbar">

<CheckBoxPreference
android:name="@string/settings_fix_taskbar"
android:summary="@string/settings_fix_taskbar_sum"
android:defaultValue="true"
android:title="@string/settings_fix_taskbar"
android:key="fixTaskbar" />

<CheckBoxPreference
android:name="@string/settings_hide_dex_logo"
android:summary="@string/settings_hide_dex_logo_sum"
android:defaultValue="true"
android:title="@string/settings_hide_dex_logo"
android:key="hideDexLogo" />

<CheckBoxPreference
android:name="@string/settings_hide_tasks_button"
android:summary="@string/settings_hide_tasks_button_sum"
android:defaultValue="false"
android:title="@string/settings_hide_tasks_button"
android:key="hideTasksButton" />

<CheckBoxPreference
android:name="@string/settings_hide_nosim_icon"
android:summary="@string/settings_hide_nosim_icon_sum"
Expand All @@ -66,6 +73,13 @@
android:title="@string/settings_hide_app_overflow_buttons"
android:key="hideAppOverflowButtons" />

<CheckBoxPreference
android:name="@string/settings_hide_statusbar_separators"
android:summary="@string/settings_hide_statusbar_separators_sum"
android:defaultValue="false"
android:title="@string/settings_hide_statusbar_separators"
android:key="hideStatusBarSeparators" />

</PreferenceCategory>

</PreferenceScreen>
136 changes: 132 additions & 4 deletions src/com/pijulius/xposeddex/XposedDex.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {

immersiveApps(lpparam);

if (settings.getBoolean("fixTaskbar", true))
taskbarFixes(lpparam);

if (settings.getBoolean("fixKeyboard", true))
keyboardFixes(lpparam);

Expand Down Expand Up @@ -102,14 +105,44 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
});
}

public void taskbarFixes(LoadPackageParam lpparam) {
// Taskbar fixes, disable setting the black backgrounds when an app is maximized
if (!lpparam.packageName.equals("com.samsung.desktopsystemui"))
return;

Class<?> hookClass = null;

hookClass = findClass("com.samsung.desktopsystemui.statusbar.phone.taskbar.views.TaskBarView",
lpparam.classLoader);

XposedBridge.hookAllMethods(hookClass, "setDarkBackground", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
param.setResult(false);
}
});

hookClass = findClass("com.samsung.desktopsystemui.statusbar.phone.taskbar.desk.DeskStatusBarView",
lpparam.classLoader);

XposedBridge.hookAllMethods(hookClass, "setDarkBackground", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
param.setResult(false);
}
});
}

public void taskbarResourceFixes(InitPackageResourcesParam resparam) {
if (!resparam.packageName.equals("com.samsung.desktopsystemui"))
return;

final boolean hideDexLogo = settings.getBoolean("hideDexLogo", true);
final boolean hideTasksButton = settings.getBoolean("hideTasksButton", true);
final boolean hideAppOverflowButtons = settings.getBoolean("hideAppOverflowButtons", true);
final boolean hideStatusBarSeparators = settings.getBoolean("hideStatusBarSeparators", true);

if (hideDexLogo || hideAppOverflowButtons) {
if (hideDexLogo || hideTasksButton || hideAppOverflowButtons || hideStatusBarSeparators) {
resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "taskbar", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
Expand All @@ -133,6 +166,18 @@ public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam)
marginParams.setMarginEnd(0);
}

if (hideTasksButton) {
view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"recent_apps", "id", "com.samsung.desktopsystemui"));

view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;

MarginLayoutParams marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(0);
marginParams.setMarginEnd(0);
}

if (hideAppOverflowButtons) {
view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"button_scroll_left", "id", "com.samsung.desktopsystemui"));
Expand All @@ -146,8 +191,89 @@ public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam)
view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;
}

if (hideStatusBarSeparators) {
view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"size_control", "id", "com.samsung.desktopsystemui"));

MarginLayoutParams marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(0);
marginParams.setMarginEnd(0);

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"desk_status_bar_container", "id", "com.samsung.desktopsystemui"));

marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(0);
marginParams.setMarginEnd(0);

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"taskbar_divider", "id", "com.samsung.desktopsystemui"));

view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;
view.setPadding(0, 0, 0, 0);

marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(0);
marginParams.setMarginEnd(0);

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"global_function", "id", "com.samsung.desktopsystemui"));

view.setPadding(0, view.getPaddingTop(), view.getPaddingRight(), view.getPaddingBottom());
}
}
});

if (hideStatusBarSeparators) {
resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "desk_status_bar", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
View view = null;

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"notification_icon_area", "id", "com.samsung.desktopsystemui"));

view.setPadding(0, view.getPaddingTop(), 0, view.getPaddingBottom());

MarginLayoutParams marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(0);
marginParams.setMarginEnd(0);

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"system_icon_area_outer", "id", "com.samsung.desktopsystemui"));

view.setPadding(0, view.getPaddingTop(), 0, view.getPaddingBottom());
}
});

resparam.res.setReplacement(
"com.samsung.desktopsystemui", "drawable", "desk_panel_view_bg", new XResources.DrawableLoader() {
@Override
public Drawable newDrawable(XResources res, int id) throws Throwable {
return new ColorDrawable(Color.TRANSPARENT);
}
});

resparam.res.setReplacement(
"com.samsung.desktopsystemui", "drawable", "quick_connect_hidden_icon", new XResources.DrawableLoader() {
@SuppressWarnings("deprecation")
@Override
public Drawable newDrawable(XResources res, int id) throws Throwable {
return res.getDrawable(android.R.drawable.arrow_up_float);
}
});

resparam.res.setReplacement(
"com.samsung.desktopsystemui", "drawable", "stat_notify_more_for_desk", new XResources.DrawableLoader() {
@SuppressWarnings("deprecation")
@Override
public Drawable newDrawable(XResources res, int id) throws Throwable {
return res.getDrawable(android.R.drawable.arrow_up_float);
}
});
}
}

if (settings.getBoolean("hideNoSIMIcon", true)) {
Expand Down Expand Up @@ -260,12 +386,14 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
}
});

hookClass = findClass("com.sec.android.daemonapp.app.notification.WeatherNotificationManager",
//hookClass = findClass("com.samsung.android.weather.infrastructure.system.android.DesktopModeManager",
//hookClass = findClass("com.samsung.android.weather.infrastructure.system.sdl.DesktopModeManager",
hookClass = findClass("com.samsung.android.weather.infrastructure.system.sep.DesktopModeManager",
lpparam.classLoader);

XposedBridge.hookAllMethods(hookClass, "stopPanelOnGoingNoti", new XC_MethodHook() {
XposedBridge.hookAllMethods(hookClass, "isDesktopMode", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
param.setResult(false);
}
});
Expand Down

0 comments on commit 10ec1c6

Please sign in to comment.