From 80072a8400a2112e286950e4694ffc4af74bb159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20=27Letharion=27=20Gyllensv=C3=A4rd?= Date: Wed, 7 Oct 2026 07:45:19 +0200 Subject: [PATCH 1/2] fix: use Material tabs on the activity details screen The detail tabs kept the old Holo tab indicator as a custom view inside the new TabLayout. TabLayout pads each tab, so the Holo underlines no longer met and the line under the tabs broke into segments, with TabLayout's own indicator drawn on top under the selected tab. Use plain text tabs as the start screen does, so both screens look the same. The map tab is now found through Tab.view rather than the custom view's parent. --- app/src/main/org/runnerup/view/DetailActivity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/org/runnerup/view/DetailActivity.java b/app/src/main/org/runnerup/view/DetailActivity.java index ebafdb5ed..5bc88496e 100644 --- a/app/src/main/org/runnerup/view/DetailActivity.java +++ b/app/src/main/org/runnerup/view/DetailActivity.java @@ -238,7 +238,7 @@ public int preSetValue(int newValue) throws IllegalArgumentException { if (BuildConfig.OSMDROID_ENABLED || BuildConfig.MAPBOX_ENABLED) { addDetailTab(org.runnerup.common.R.string.Map, R.id.tab_map); - mapTab = (View) detailTabs.getTabAt(2).getCustomView().getParent(); + mapTab = detailTabs.getTabAt(2).view; } addDetailTab(org.runnerup.common.R.string.Graph, R.id.tab_graph); @@ -378,9 +378,7 @@ private void updateViewForSport(int sportValue) { } private void addDetailTab(int titleId, int contentId) { - TabLayout.Tab tab = detailTabs.newTab(); - tab.setCustomView(WidgetUtil.createHoloTabIndicator(this, getString(titleId))); - detailTabs.addTab(tab); + detailTabs.addTab(detailTabs.newTab().setText(titleId)); tabContents.add(findViewById(contentId)); } From 5a3c27917302e5d8e8afda472330ab26170bfc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claes=20=27Letharion=27=20Gyllensv=C3=A4rd?= Date: Wed, 7 Oct 2026 07:45:51 +0200 Subject: [PATCH 2/2] refactor: remove the unused Holo tab indicator The activity details screen was the last user of WidgetUtil.createHoloTabIndicator. Remove it and its Holo tab drawables. --- .../tab_selected_focused_holo.9.png | Bin 126 -> 0 bytes app/res/drawable-mdpi/tab_selected_holo.9.png | Bin 120 -> 0 bytes .../tab_selected_pressed_holo.9.png | Bin 126 -> 0 bytes .../tab_unselected_focused_holo.9.png | Bin 129 -> 0 bytes .../drawable-mdpi/tab_unselected_holo.9.png | Bin 125 -> 0 bytes .../tab_unselected_pressed_holo.9.png | Bin 128 -> 0 bytes app/res/drawable/tab_indicator_holo.xml | 29 ------------------ .../main/org/runnerup/widget/WidgetUtil.java | 22 ------------- 8 files changed, 51 deletions(-) delete mode 100644 app/res/drawable-mdpi/tab_selected_focused_holo.9.png delete mode 100644 app/res/drawable-mdpi/tab_selected_holo.9.png delete mode 100644 app/res/drawable-mdpi/tab_selected_pressed_holo.9.png delete mode 100644 app/res/drawable-mdpi/tab_unselected_focused_holo.9.png delete mode 100644 app/res/drawable-mdpi/tab_unselected_holo.9.png delete mode 100644 app/res/drawable-mdpi/tab_unselected_pressed_holo.9.png delete mode 100644 app/res/drawable/tab_indicator_holo.xml diff --git a/app/res/drawable-mdpi/tab_selected_focused_holo.9.png b/app/res/drawable-mdpi/tab_selected_focused_holo.9.png deleted file mode 100644 index 0894bfb09f050a3a32022304e572629486dcbaf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b~!3HEJ|NhSh5=eLSb!1@J*w6hZkrl`{^>lFz z;gC&EXlVHFz||rd;n36Yb-$0p9Nxy9|1%wUQW$~`o;Y)aC5&&c@?TieY XPH}lDT~ikU8o=P`>gTe~DWM4fxCSIS diff --git a/app/res/drawable-mdpi/tab_selected_holo.9.png b/app/res/drawable-mdpi/tab_selected_holo.9.png deleted file mode 100644 index 7982f6837e222e6bbdb99f97f46b5970ef02f1ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b~!3HEJ|NhSh5=eLSb!1@J*w6hZkrl|-_jGX# z;gC&EXlVHFz}0e);T*%Kf5wii4@HzaME88;kGL9DFUH0rdPSfilD%AlLBooReeS-O QJV31sp00i_>zopr0HhWmHUIzs diff --git a/app/res/drawable-mdpi/tab_selected_pressed_holo.9.png b/app/res/drawable-mdpi/tab_selected_pressed_holo.9.png deleted file mode 100644 index df8c8ba6c4b22498d88b9ae2efc7d11d42551899..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b~!3HEJ|NhSh5=eLSb!1@J*w6hZkrl`{^>lFz z;gC&EXlVHFz||rd;lMNh>V0X)Il2qy{GaK-lfn>m@Wi=eTw#2Z4g@&zGS28NXlG=2 Y^qOnYEjRlGKm!;&UHx3vIVCg!0LG~$mjD0& diff --git a/app/res/drawable-mdpi/tab_unselected_focused_holo.9.png b/app/res/drawable-mdpi/tab_unselected_focused_holo.9.png deleted file mode 100644 index 08457312a4aab02985bb4fe876f4893b22787968..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^EI`c0!3HFsSlX9@1kxRS9T^xl_H+M9WCijqJY5_^ zIAoI(8XEpPaJ5KAIP^4p-S6Wthqp23|4av-6o#OKKYpM8Uo=C(qoJ|6cPFzN!{Uc+ aObowo^ST`SEK?6OgTd3)&t;ucLK6T++$c%_ diff --git a/app/res/drawable-mdpi/tab_unselected_holo.9.png b/app/res/drawable-mdpi/tab_unselected_holo.9.png deleted file mode 100644 index 24661d4e4a05eb18bb180f4892bc72b251a41e1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^EI`c0!3HFsSlX9@1kxRS9T^xl_H+M9WCij~JY5_^ zIAoI(8XEpPaJ3v{ILGkmpRptBLlN!?M_+7zm#*QF5-ecN?9tFTb!Me#hZ|dgGvl9L WE`cL`iL-$E89ZJ6T-G@yGywowZX@0R diff --git a/app/res/drawable-mdpi/tab_unselected_pressed_holo.9.png b/app/res/drawable-mdpi/tab_unselected_pressed_holo.9.png deleted file mode 100644 index da116b0f3caf86339a4c53d580e6d09bce2c10d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^EI`c0!3HFsSlX9@1kxRS9T^xl_H+M9WCilgJzX3_ zIAoI(8XEpPaJ5KAIPlEBdSBXcj_$%a|7SYzq%Z^>{L$W+De5Dja^S$(V=`RA4HpZX Z8TXyxo)h1A!xm@+gQu&X%Q~loCIHaNCGY?M diff --git a/app/res/drawable/tab_indicator_holo.xml b/app/res/drawable/tab_indicator_holo.xml deleted file mode 100644 index 77f372126..000000000 --- a/app/res/drawable/tab_indicator_holo.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/app/src/main/org/runnerup/widget/WidgetUtil.java b/app/src/main/org/runnerup/widget/WidgetUtil.java index fab23b33a..96675cf65 100644 --- a/app/src/main/org/runnerup/widget/WidgetUtil.java +++ b/app/src/main/org/runnerup/widget/WidgetUtil.java @@ -17,16 +17,9 @@ package org.runnerup.widget; -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.EditText; -import android.widget.TextView; -import androidx.appcompat.content.res.AppCompatResources; -import androidx.core.view.ViewCompat; -import org.runnerup.R; public class WidgetUtil { @@ -39,21 +32,6 @@ public static void setEditable(EditText editText, boolean onoff) { } } - public static View createHoloTabIndicator(Context ctx, String title) { - TextView txtTab = new TextView(ctx); - txtTab.setText(title); - // txtTab.setTextColor(Color.WHITE); - // txtTab.setGravity(Gravity.CENTER_HORIZONTAL); - Drawable drawable = AppCompatResources.getDrawable(ctx, R.drawable.tab_indicator_holo); - ViewCompat.setBackground(txtTab, drawable); - - int h = (25 * drawable.getIntrinsicHeight()) / 10; - txtTab.setPadding(0, h, 0, h); - // txtTab.setHeight(1 + 10 * drawable.getIntrinsicHeight()); - // txtTab.setLineSpacing(1 + 5 * drawable.getIntrinsicHeight(), 1); - return txtTab; - } - public static void addLegacyOverflowButton(Window window) { if (window.peekDecorView() == null) { return;