Skip to content

Commit

Permalink
Closes #610, Closes #607, Closes #597, Closes #592
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantcheese committed Feb 10, 2020
1 parent ee913b6 commit 0916860
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Kuroba/app/src/main/res/layout/toolbar_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:paddingTop="29dp"
android:singleLine="true"
android:textColor="?text_color_secondary"
android:textSize="14dp" />
android:textSize="12dp" />
</FrameLayout>

<!-- menu inserted here
Expand Down

0 comments on commit 0916860

Please sign in to comment.