Still in the need to Frankenstein the add menu

This commit is contained in:
LucasGGamerM 2023-02-20 13:33:04 -03:00
parent b5844a5f8c
commit 1ada4c9f46
2 changed files with 12 additions and 2 deletions

View File

@ -130,6 +130,10 @@ public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefiniti
optionsMenu.performIdentifierAction(R.id.menu_add_timeline, 0); optionsMenu.performIdentifierAction(R.id.menu_add_timeline, 0);
return true; return true;
} }
if (item.getItemId() == R.id.menu_add_local_timelines) {
addNewLocalTimeline();
return true;
}
TimelineDefinition tl = timelineByMenuItem.get(item); TimelineDefinition tl = timelineByMenuItem.get(item);
if (tl != null) { if (tl != null) {
data.add(tl.copy()); data.add(tl.copy());
@ -140,6 +144,10 @@ public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefiniti
return true; return true;
} }
private void addNewLocalTimeline() {
}
private void addTimelineToOptions(TimelineDefinition tl, Menu menu) { private void addTimelineToOptions(TimelineDefinition tl, Menu menu) {
if (data.contains(tl)) return; if (data.contains(tl)) return;
MenuItem item = menu.add(0, View.generateViewId(), Menu.NONE, tl.getTitle(getContext())); MenuItem item = menu.add(0, View.generateViewId(), Menu.NONE, tl.getTitle(getContext()));
@ -162,8 +170,9 @@ public class EditTimelinesFragment extends BaseRecyclerFragment<TimelineDefiniti
listsMenu.getItem().setIcon(R.drawable.ic_fluent_people_24_regular); listsMenu.getItem().setIcon(R.drawable.ic_fluent_people_24_regular);
SubMenu hashtagsMenu = menu.addSubMenu(R.string.sk_hashtag); SubMenu hashtagsMenu = menu.addSubMenu(R.string.sk_hashtag);
hashtagsMenu.getItem().setIcon(R.drawable.ic_fluent_number_symbol_24_regular); hashtagsMenu.getItem().setIcon(R.drawable.ic_fluent_number_symbol_24_regular);
// SubMenu hashtagsMenu = menu.addSubMenu(R.string.sk_hashtag);
// hashtagsMenu.getItem().setIcon(R.drawable.ic_fluent_number_symbol_24_regular); MenuItem addLocalTimelines = menu.add(0, R.id.menu_add_local_timelines, NONE, R.string.local_timeline);
addLocalTimelines.setIcon(R.drawable.ic_fluent_people_community_24_regular);
makeBackItem(timelinesMenu); makeBackItem(timelinesMenu);
makeBackItem(listsMenu); makeBackItem(listsMenu);

View File

@ -22,4 +22,5 @@
<item name="menu_add_timeline" type="id" /> <item name="menu_add_timeline" type="id" />
<item name="menu_back" type="id" /> <item name="menu_back" type="id" />
<item name="menu_add_local_timelines" type="id" />
</resources> </resources>