SharedPreferences pref2 = U.getSharedPreferences(getActivity());
if(pref2.getBoolean(PREF_AUTO_HIDE_NAVBAR_DESKTOP_MODE, false) && isOnHomeScreen)
- U.showHideNavigationBar(getActivity(), displayID, false, 250);
+ U.showHideNavigationBar(U.getDisplayContext(getActivity()), displayID, false, 250);
} catch (Exception e) {
U.showToast(getActivity(), R.string.tb_unable_to_apply_density_change);
}
--- /dev/null
+/* Copyright 2020 Braden Farmer
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.farmerbb.taskbar.util;
+
+interface Lazy<T> {
+ T get();
+}
return;
}
- int value = show ? 0 : getSystemDimen(context, "navigation_bar_height") * -1;
+ Lazy<Integer> value = () -> show ? 0 : getSystemDimen(context, "navigation_bar_height") * -1;
if(hasWriteSecureSettingsPermission(context)) {
Runnable runnable = () -> {
try {
- setOverscan(displayID, value);
+ setOverscan(displayID, value.get());
} catch (Exception e) { /* Gracefully fail */ }
};
intent.setPackage(BuildConfig.SUPPORT_APPLICATION_ID);
intent.putExtra("display_id", displayID);
- intent.putExtra("value", value);
+ intent.putExtra("value", value.get());
context.sendBroadcast(intent);
return;