Update: subcategory enhancement #1154 solved

This commit is contained in:
ScottieKim 2021-06-17 21:46:41 +09:00
parent 2a2ed1839b
commit 77ddc77df5
2 changed files with 6 additions and 1 deletions

View file

@ -350,7 +350,7 @@ public class MainViewModel extends AndroidViewModel {
lastSecondaryCategory.icon = NavigationAdapter.ICON_SUB_MULTIPLE; lastSecondaryCategory.icon = NavigationAdapter.ICON_SUB_MULTIPLE;
} else if (belongsToLastPrimaryCategory) { } else if (belongsToLastPrimaryCategory) {
if (isCategoryOpen) { if (isCategoryOpen) {
item.label = currentPrimaryCategory + "/" + currentSecondaryCategory; item.label = currentSecondaryCategory;
item.id = "category:" + item.label; item.id = "category:" + item.label;
item.icon = NavigationAdapter.ICON_SUB_FOLDER; item.icon = NavigationAdapter.ICON_SUB_FOLDER;
items.add(item); items.add(item);

View file

@ -1,6 +1,7 @@
package it.niedermann.owncloud.notes.main.navigation; package it.niedermann.owncloud.notes.main.navigation;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
@ -59,5 +60,9 @@ class NavigationViewHolder extends RecyclerView.ViewHolder {
icon.setColorFilter(isSelected ? textColor : 0); icon.setColorFilter(isSelected ? textColor : 0);
view.setSelected(isSelected); view.setSelected(isSelected);
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
params.leftMargin = item.icon == NavigationAdapter.ICON_SUB_FOLDER ? 70 : 0;
view.requestLayout();
} }
} }