Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog.
R.id.navigationDrawerItem_files -> {
ApiPrefs.user?.let { handleRoute(FileListFragment.makeRoute(it)) }
}
R.id.navigationDrawerItem_gauge, R.id.navigationDrawerItem_studio, R.id.navigationDrawerItem_mastery -> {
R.id.navigationDrawerItem_gauge, R.id.navigationDrawerItem_studio, R.id.navigationDrawerItem_mastery, R.id.navigationDrawerItem_portfolio -> {
val launchDefinition = v.tag as? LaunchDefinition ?: return@weave
launchLti(launchDefinition)
}
Expand Down Expand Up @@ -648,6 +648,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog.
navigationDrawerItemGauge.onClickWithRequireNetwork(mNavigationDrawerItemClickListener)
navigationDrawerItemStudio.onClickWithRequireNetwork(mNavigationDrawerItemClickListener)
navigationDrawerItemMastery.onClickWithRequireNetwork(mNavigationDrawerItemClickListener)
navigationDrawerItemPortfolio.onClickWithRequireNetwork(mNavigationDrawerItemClickListener)
navigationDrawerItemBookmarks.onClickWithRequireNetwork(mNavigationDrawerItemClickListener)
navigationDrawerItemChangeUser.setOnClickListener(mNavigationDrawerItemClickListener)
navigationDrawerItemHelp.onClickWithRequireNetwork(mNavigationDrawerItemClickListener)
Expand All @@ -661,6 +662,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog.
navigationDrawerItemGauge,
navigationDrawerItemStudio,
navigationDrawerItemMastery,
navigationDrawerItemPortfolio,
navigationDrawerItemBookmarks,
navigationDrawerItemChangeUser,
navigationDrawerItemHelp,
Expand Down Expand Up @@ -775,6 +777,8 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog.
navigationDrawerOfflineIndicator.setVisible(isOffline)
navigationDrawerItemStudio.alpha = if (isOffline) 0.5f else 1f
navigationDrawerItemGauge.alpha = if (isOffline) 0.5f else 1f
navigationDrawerItemMastery.alpha = if (isOffline) 0.5f else 1f
navigationDrawerItemPortfolio.alpha = if (isOffline) 0.5f else 1f
navigationDrawerItemHelp.alpha = if (isOffline) 0.5f else 1f
navigationDrawerItemBookmarks.alpha = if (isOffline) 0.5f else 1f
navigationDrawerItemFiles.alpha = if (isOffline) 0.5f else 1f
Expand Down Expand Up @@ -1269,6 +1273,7 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog.
val studioLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.STUDIO_DOMAIN }
val gaugeLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.GAUGE_DOMAIN }
val masteryLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.MASTERY_DOMAIN }
val portfolioLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.PORTFOLIO_DOMAIN }

val studio = findViewById<View>(R.id.navigationDrawerItem_studio)
studio.visibility = if (studioLaunchDefinition != null) View.VISIBLE else View.GONE
Expand All @@ -1281,6 +1286,10 @@ class NavigationActivity : BaseRouterActivity(), Navigation, MasqueradingDialog.
val mastery = findViewById<View>(R.id.navigationDrawerItem_mastery)
mastery.visibility = if (masteryLaunchDefinition != null) View.VISIBLE else View.GONE
mastery.tag = masteryLaunchDefinition

val portfolio = findViewById<View>(R.id.navigationDrawerItem_portfolio)
portfolio.visibility = if (portfolioLaunchDefinition != null) View.VISIBLE else View.GONE
portfolio.tag = portfolioLaunchDefinition
}

override fun addBookmark() {
Expand Down
20 changes: 20 additions & 0 deletions apps/student/src/main/res/layout/navigation_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,26 @@

</LinearLayout>

<LinearLayout
android:id="@+id/navigationDrawerItem_portfolio"
style="@style/NavigationDrawerItem"
android:visibility="gone"
tools:ignore="UseCompoundDrawables"
tools:visibility="visible">

<androidx.appcompat.widget.AppCompatImageView
style="@style/NavigationDrawerIcon"
app:srcCompat="@drawable/ic_navigation_portfolio" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/portfolio"
android:textSize="16sp"
android:textColor="@color/textDarkest"/>

</LinearLayout>

<LinearLayout
android:id="@+id/navigationDrawerSettings"
style="@style/NavigationDrawerItem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class InitActivity : BasePresenterActivity<InitActivityPresenter, InitActivityVi
R.id.navigationDrawerItem_files -> {
RouteMatcher.route(this@InitActivity, Route(FileListFragment::class.java, ApiPrefs.user))
}
R.id.navigationDrawerItem_gauge, R.id.navigationDrawerItem_arc, R.id.navigationDrawerItem_mastery -> {
R.id.navigationDrawerItem_gauge, R.id.navigationDrawerItem_arc, R.id.navigationDrawerItem_mastery, R.id.navigationDrawerItem_portfolio -> {
val launchDefinition = v.tag as? LaunchDefinition ?: return@weave
launchLti(launchDefinition)
}
Expand Down Expand Up @@ -422,6 +422,7 @@ class InitActivity : BasePresenterActivity<InitActivityPresenter, InitActivityVi
navigationDrawerItemGauge.setOnClickListener(navDrawerOnClick)
navigationDrawerItemArc.setOnClickListener(navDrawerOnClick)
navigationDrawerItemMastery.setOnClickListener(navDrawerOnClick)
navigationDrawerItemPortfolio.setOnClickListener(navDrawerOnClick)
navigationDrawerItemChangeUser.setOnClickListener(navDrawerOnClick)
navigationDrawerItemLogout.setOnClickListener(navDrawerOnClick)
navigationDrawerSettings.setOnClickListener(navDrawerOnClick)
Expand All @@ -434,6 +435,7 @@ class InitActivity : BasePresenterActivity<InitActivityPresenter, InitActivityVi
navigationDrawerItemGauge,
navigationDrawerItemArc,
navigationDrawerItemMastery,
navigationDrawerItemPortfolio,
navigationDrawerItemChangeUser,
navigationDrawerItemHelp,
navigationDrawerItemLogout,
Expand Down Expand Up @@ -493,6 +495,7 @@ class InitActivity : BasePresenterActivity<InitActivityPresenter, InitActivityVi
val arcLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.STUDIO_DOMAIN }
val gaugeLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.GAUGE_DOMAIN }
val masteryLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.MASTERY_DOMAIN }
val portfolioLaunchDefinition = launchDefinitions?.firstOrNull { it.domain == LaunchDefinition.PORTFOLIO_DOMAIN }

navigationDrawerItemArc.setVisible(arcLaunchDefinition != null)
navigationDrawerItemArc.tag = arcLaunchDefinition
Expand All @@ -502,6 +505,9 @@ class InitActivity : BasePresenterActivity<InitActivityPresenter, InitActivityVi

navigationDrawerItemMastery.setVisible(masteryLaunchDefinition != null)
navigationDrawerItemMastery.tag = masteryLaunchDefinition

navigationDrawerItemPortfolio.setVisible(portfolioLaunchDefinition != null)
navigationDrawerItemPortfolio.tag = portfolioLaunchDefinition
}

override fun onStartMasquerading(domain: String, userId: Long) {
Expand Down
20 changes: 20 additions & 0 deletions apps/teacher/src/main/res/layout/navigation_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@

</LinearLayout>

<LinearLayout
android:id="@+id/navigationDrawerItem_portfolio"
style="@style/NavigationDrawerItem"
android:visibility="gone"
tools:ignore="UseCompoundDrawables"
tools:visibility="visible">

<androidx.appcompat.widget.AppCompatImageView
style="@style/NavigationDrawerIcon"
app:srcCompat="@drawable/ic_navigation_portfolio" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/portfolio"
android:textColor="@color/textDarkest"
android:textSize="16sp" />

</LinearLayout>

<LinearLayout
android:id="@+id/navigationDrawerSettings"
style="@style/NavigationDrawerItem"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ data class LaunchDefinition(
const val GAUGE_DOMAIN = "gauge.instructure.com"
const val STUDIO_DOMAIN = "arc.instructure.com" // NOTE: The subdomain hasn't changed to reflect the rebranding of Arc -> Studio yet
const val MASTERY_DOMAIN = "app.masteryconnect.com"
const val PORTFOLIO_DOMAIN = "iad.portfolio.instructure.com"
}
}
10 changes: 10 additions & 0 deletions libs/pandares/src/main/res/drawable/ic_navigation_portfolio.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M20.667,21.334H3.333C2.231,21.334 1.333,20.437 1.333,19.334V12.001H8V14.667H16V12.001H22.667V19.334C22.667,20.437 21.769,21.334 20.667,21.334V21.334ZM9.333,13.334H14.667V10.667H9.333V13.334ZM3.333,6.667H8H16H20.667C21.769,6.667 22.667,7.565 22.667,8.667V10.667H16V9.334H8V10.667H1.333V8.667C1.333,7.565 2.231,6.667 3.333,6.667V6.667ZM9.333,3.334C9.333,2.966 9.632,2.667 10,2.667H14C14.368,2.667 14.667,2.966 14.667,3.334V5.334H9.333V3.334ZM20.667,5.334H16V3.334C16,2.231 15.103,1.334 14,1.334H10C8.897,1.334 8,2.231 8,3.334V5.334H3.333C1.496,5.334 0,6.83 0,8.667V19.334C0,21.171 1.496,22.667 3.333,22.667H20.667C22.504,22.667 24,21.171 24,19.334V8.667C24,6.83 22.504,5.334 20.667,5.334V5.334Z"
android:fillColor="#273540"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<string name = "canvasNetwork" translatable="false">Canvas Network</string>
<string name="studio" translatable="false">Studio</string>
<string name="masteryConnect" translatable="false">Mastery</string>
<string name="portfolio" translatable="false">Portfolio</string>
<string name="unsupportedContentMessage" translatable="false">This isn\'t right, you shouldn\'t be here.</string>
</resources>
Loading