Skip to content

Commit

Permalink
Merge pull request #477 from rwth-acis/SOD/feature/correct-order-task…
Browse files Browse the repository at this point in the history
…-cards

Correct placment of task cards in view list
  • Loading branch information
pfnud11 authored Jul 7, 2022
2 parents ce01f6f + 7319e3e commit f55a477
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ MonoBehaviour:
m_EditorClassIdentifier:
selectionButton: {fileID: 2663867199647269224}
listWindow: {fileID: 5947539256864693986}
issueViewLists:
- {fileID: 6298378491440120801}
- {fileID: 694334264082076324}
- {fileID: 8809587157714221230}
horizontalIssueViewListSize: 2
emptyMessage: {fileID: 5597265832235983525}
upButton: {fileID: 2881172534398247575}
downButton: {fileID: 2045038253619093151}
Expand Down Expand Up @@ -827,7 +832,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 405686585439463411}
- component: {fileID: 7390341489764887978}
m_Layer: 0
m_Name: Issue List Window
m_TagString: Untagged
Expand Down Expand Up @@ -856,24 +860,6 @@ Transform:
m_Father: {fileID: 7754013898551322284}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7390341489764887978
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5947539256864693986}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5c97ab1e111495d42b415b644ef38351, type: 3}
m_Name:
m_EditorClassIdentifier:
items: []
numberOfItemsPerListView: 2
issueListViews:
- {fileID: 8809587157714221230}
- {fileID: 694334264082076324}
- {fileID: 6298378491440120801}
--- !u!1 &5975541155422657780
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1419,18 +1405,18 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a565e6c3bee3c4b49a6b762cfd4504f6, type: 3}
--- !u!4 &2931766233379170828 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3178011426364783460, guid: a565e6c3bee3c4b49a6b762cfd4504f6,
type: 3}
m_PrefabInstance: {fileID: 339222799930757480}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2881172534398247575 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2544202224179704831, guid: a565e6c3bee3c4b49a6b762cfd4504f6,
type: 3}
m_PrefabInstance: {fileID: 339222799930757480}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2931766233379170828 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3178011426364783460, guid: a565e6c3bee3c4b49a6b762cfd4504f6,
type: 3}
m_PrefabInstance: {fileID: 339222799930757480}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1901710768412322045
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1890,18 +1876,6 @@ PrefabInstance:
objectReference: {fileID: 4145217981444261754}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 642505be91342ba4288e6f3edb57a478, type: 3}
--- !u!1 &6804370218211835808 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7178285771126497045, guid: 642505be91342ba4288e6f3edb57a478,
type: 3}
m_PrefabInstance: {fileID: 4464085696268673205}
m_PrefabAsset: {fileID: 0}
--- !u!4 &7754013898551322284 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6226319698958009881, guid: 642505be91342ba4288e6f3edb57a478,
type: 3}
m_PrefabInstance: {fileID: 4464085696268673205}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6549793300165385213 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 7428146643283245896, guid: 642505be91342ba4288e6f3edb57a478,
Expand All @@ -1914,6 +1888,18 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1410eac1ae94b4d4492a09cc368e152c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &7754013898551322284 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6226319698958009881, guid: 642505be91342ba4288e6f3edb57a478,
type: 3}
m_PrefabInstance: {fileID: 4464085696268673205}
m_PrefabAsset: {fileID: 0}
--- !u!1 &6804370218211835808 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7178285771126497045, guid: 642505be91342ba4288e6f3edb57a478,
type: 3}
m_PrefabInstance: {fileID: 4464085696268673205}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &4553065579949354336
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using i5.VIAProMa.DataModel.API;
using i5.VIAProMa.UI.ListView.Issues;
using i5.VIAProMa.UI.MultiListView.Core;
using i5.VIAProMa.Utilities;
using Microsoft.MixedReality.Toolkit.UI;
Expand All @@ -12,16 +14,16 @@ public class ConfigurationIssueListUI : MonoBehaviour, IUiFragment
{
[SerializeField] private Interactable selectionButton;
[SerializeField] private GameObject listWindow;
[SerializeField] private List<IssueListView> issueViewLists;
[SerializeField] private int horizontalIssueViewListSize;
[SerializeField] private GameObject emptyMessage;
[SerializeField] private GameObject upButton;
[SerializeField] private GameObject downButton;

private bool uiEnabled = true;
private Visualization visualization;
private int currentPage = 0;
private IssuesMultiListView issueViewList;
private int currentPage;
private int numberOfIssuesPerPage;
private const int NumberOfListViews = 3;
private Interactable upButtonInteractable;
private Interactable downButtonInteractable;

Expand Down Expand Up @@ -49,11 +51,7 @@ private void Awake()
else
{
listWindow.SetActive(false);
issueViewList = listWindow.GetComponent(typeof(IssuesMultiListView)) as IssuesMultiListView;
if (issueViewList)
{
numberOfIssuesPerPage = NumberOfListViews * issueViewList.numberOfItemsPerListView;
}
numberOfIssuesPerPage = issueViewLists.Count * horizontalIssueViewListSize;

if (upButton)
{
Expand Down Expand Up @@ -97,7 +95,7 @@ private void ReloadIssueList()
{
var issues = visualization.ContentProvider.Issues;
var issuesCount = issues.Count;
if (issueViewList)
if (issueViewLists.Any())
{
if (issuesCount == 0)
{
Expand All @@ -114,16 +112,21 @@ private void ReloadIssueList()
currentPage = maxPage;
}

var issuesForThisPage = new List<Issue>();
var issuesStartingPoint = currentPage * numberOfIssuesPerPage;
for (var i = issuesStartingPoint;
i < issuesStartingPoint + numberOfIssuesPerPage && issuesCount > i;
i++)
for (var j = 0; j < issueViewLists.Count; j++)
{
issuesForThisPage.Add(issues[i]);
var start = issuesStartingPoint + j * horizontalIssueViewListSize;
var issuesForThisIssueView = new List<Issue>();
for (var i = start;
i < start + horizontalIssueViewListSize && issuesCount > i;
i++)
{
issuesForThisIssueView.Add(issues[i]);
}

issueViewLists[j].Items = issuesForThisIssueView;
}

issueViewList.Items = issuesForThisPage;
if (downButton)
{
downButtonInteractable.IsEnabled = currentPage != maxPage;
Expand All @@ -145,7 +148,7 @@ private void ReloadIssueList()
}
else
{
LogMissingField(nameof(listWindow));
LogMissingField(nameof(issueViewLists));
}
}

Expand Down

0 comments on commit f55a477

Please sign in to comment.