From 091686012545f2c09d275a1377bdf32a6b6713e9 Mon Sep 17 00:00:00 2001 From: Adamantcheese Date: Sun, 9 Feb 2020 21:52:48 -0800 Subject: [PATCH] Closes #610, Closes #607, Closes #597, Closes #592 --- .../chan/ui/controller/BrowseController.java | 11 ++++++++--- .../chan/ui/toolbar/ToolbarContainer.java | 12 +++++++----- Kuroba/app/src/main/res/layout/toolbar_menu.xml | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/BrowseController.java b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/BrowseController.java index efa573f06f..52d3ed5541 100644 --- a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/BrowseController.java +++ b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/controller/BrowseController.java @@ -123,6 +123,11 @@ private void initNavigation() { // Toolbar menu navigation.hasBack = false; + // this controller is used for catalog views; displaying things on two rows for them middle menu is how we want it done + // these need to be setup before the view is rendered, otherwise the subtitle view is removed + navigation.title = "App Setup"; + navigation.subtitle = "Tap for site/board setup"; + NavigationItem.MenuOverflowBuilder overflowBuilder = navigation.buildMenu() .withItem(R.drawable.ic_search_white_24dp, this::searchClicked) .withItem(R.drawable.ic_refresh_white_24dp, this::reloadClicked) @@ -376,9 +381,9 @@ public void onFloatingMenuDismissed(FloatingMenu menu) { @Override public void loadBoard(Loadable loadable) { - String name = BoardHelper.getName(loadable.board); - loadable.title = name; - navigation.title = name; + loadable.title = BoardHelper.getName(loadable.board); + navigation.title = "/" + loadable.board.code + "/"; + navigation.subtitle = loadable.board.name; ThreadPresenter presenter = threadLayout.getPresenter(); presenter.unbindLoadable(); diff --git a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/toolbar/ToolbarContainer.java b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/toolbar/ToolbarContainer.java index a637d09209..80ef463d71 100644 --- a/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/toolbar/ToolbarContainer.java +++ b/Kuroba/app/src/main/java/com/github/adamantcheese/chan/ui/toolbar/ToolbarContainer.java @@ -32,6 +32,7 @@ import android.view.animation.DecelerateInterpolator; import android.view.animation.LinearInterpolator; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; @@ -458,12 +459,13 @@ private LinearLayout createNavigationLayout(NavigationItem item, Theme theme) { int arrowPressedColor = getAttrColor(getContext(), R.attr.dropdown_light_pressed_color); final Drawable arrowDrawable = new DropdownArrowDrawable(dp(12), dp(12), true, arrowColor, arrowPressedColor); - titleView.setCompoundDrawablesWithIntrinsicBounds(null, null, arrowDrawable, null); + arrowDrawable.setBounds(0, 0, arrowDrawable.getIntrinsicWidth(), arrowDrawable.getIntrinsicHeight()); + ImageView dropdown = new ImageView(getContext()); + dropdown.setImageDrawable(arrowDrawable); + titleContainer.addView(dropdown, + new LayoutParams(WRAP_CONTENT, WRAP_CONTENT, Gravity.CENTER_VERTICAL | Gravity.RIGHT) + ); titleContainer.setOnClickListener(v -> item.middleMenu.show(titleView)); - //Default stuff for nothing there - if (item.title.isEmpty()) { - titleView.setText("App Setup"); - } } // Possible subtitle. diff --git a/Kuroba/app/src/main/res/layout/toolbar_menu.xml b/Kuroba/app/src/main/res/layout/toolbar_menu.xml index 7df2d1d9cb..7b1afb5391 100644 --- a/Kuroba/app/src/main/res/layout/toolbar_menu.xml +++ b/Kuroba/app/src/main/res/layout/toolbar_menu.xml @@ -55,7 +55,7 @@ along with this program. If not, see . android:paddingTop="29dp" android:singleLine="true" android:textColor="?text_color_secondary" - android:textSize="14dp" /> + android:textSize="12dp" />