Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

35 readd deep linking #144

Open
wants to merge 50 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
450fdc4
ui(course): update topic list style
JonasWanke Aug 15, 2018
e33bb4d
ui: use primary color for warnings
JonasWanke Aug 15, 2018
41460bf
Merge branch '28-new-design' into 31-unify-design
JonasWanke Aug 15, 2018
88f1be0
ui(main): add bg color to selected nav item
JonasWanke Aug 15, 2018
60ec565
ui(dashboard): tweak card style
JonasWanke Aug 16, 2018
4a48358
refactor: use Navigation.createNavigateOnClickListener
JonasWanke Aug 16, 2018
78c14f5
fix: use brand color for due date
JonasWanke Aug 16, 2018
4673882
refactor: use binding adapters
JonasWanke Aug 16, 2018
a2906b5
feat: add ContentTextView
JonasWanke Aug 16, 2018
da5898a
refactor: cleanup
JonasWanke Aug 16, 2018
2c96271
feat(news): add news detail fragment
JonasWanke Aug 16, 2018
439e592
fix(homework): fix url; ui: modify item header
JonasWanke Aug 16, 2018
e36efa5
feat(homework): add link to course
JonasWanke Aug 16, 2018
8d6a37e
docs(architecture): include ContentTextView
JonasWanke Aug 16, 2018
21a2bda
fix: fix material text color values
JonasWanke Aug 20, 2018
21b634d
refactor(file): rename ItemFileCourse to ItemFileCourse
JonasWanke Aug 20, 2018
d2fc5e9
feat(main): allow toolbar recoloring
JonasWanke Aug 20, 2018
826d392
feat(main): also color status bar
JonasWanke Aug 20, 2018
5806c09
fix: enable multidex
JonasWanke Aug 20, 2018
a30acc8
ui(homework): show course in list as chip
JonasWanke Aug 20, 2018
c64b008
refactor(main): provide config as LiveData directly
JonasWanke Aug 20, 2018
cfdcf6d
ui(homework): show course as subtitle
JonasWanke Aug 20, 2018
6310431
fix(main): use light popup menu
JonasWanke Aug 20, 2018
0a01922
feat(file): link to course
JonasWanke Aug 20, 2018
dc6c923
feat(file): add breadcrumbs
JonasWanke Aug 20, 2018
8d75ff4
fix(main): color toolbar items correctly
JonasWanke Aug 20, 2018
f502241
feat(topic): show course as subtitle
JonasWanke Aug 20, 2018
ad1a0a7
ui(file): show headers for directories and files
JonasWanke Aug 20, 2018
b824409
ui(topic): add dividers between items
JonasWanke Aug 20, 2018
16b6a1c
fix: use correct width for DividerItemDecoration
JonasWanke Aug 21, 2018
acc811a
fix(dashboard): show correct title
JonasWanke Aug 23, 2018
9954328
refactor: remove unused resources, PassiveWebView; fix some lint errors
JonasWanke Aug 23, 2018
835f6ff
ui(dashboard): decrease header size
JonasWanke Aug 23, 2018
ea79611
fix(file): remove last breadcrumb divider; only reload when same fold…
JonasWanke Aug 23, 2018
e281c56
Merge branch '28-new-design' into 31-unify-design
JonasWanke Aug 23, 2018
11091bf
fix: fix detail view refreshing
JonasWanke Aug 23, 2018
c2bac68
fix: remove not-null assertions from onOptionsItemSelected
JonasWanke Aug 23, 2018
2534d6a
ui(login): redesign login screen
JonasWanke Aug 23, 2018
18e02f1
refactor: rename some icons
JonasWanke Aug 23, 2018
d3d4a07
ui(login): show logo instead of name
JonasWanke Aug 23, 2018
0fca5fd
refactor(homework): use plurals for hours
JonasWanke Aug 23, 2018
bc9ff20
ui(homework): hide description, course if not applicable
JonasWanke Aug 23, 2018
c0706fb
fix(main): rename tasks in drawer
JonasWanke Aug 23, 2018
65e6ce9
refactor: fix lint errors
JonasWanke Aug 23, 2018
c3655a1
fix: fix typo fixing lint error
JonasWanke Aug 23, 2018
dae1d76
feat(main): add onboarding for new navigation
JonasWanke Aug 23, 2018
6805cab
feat(homework): extract CourseChip
JonasWanke Aug 23, 2018
5a29d2a
feat(files): support link sharing
JonasWanke Aug 23, 2018
65e135d
feat: support deep linking
JonasWanke Aug 30, 2018
753aee0
Merge branch 'dev' into 35-readd-deep-linking
JonasWanke Sep 5, 2018
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
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
android:name=".controllers.main.MainActivity"
android:label="@string/brand_name"
android:launchMode="singleTop"
android:theme="@style/AppTheme.TranslucentStatus" />
android:theme="@style/AppTheme.TranslucentStatus">
<nav-graph android:value="@navigation/main" />
</activity>

<activity android:name=".controllers.login.LoginActivity" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HomeworkFragment : MainFragment() {


override var url: String? = null
get() = "homework/${viewModel.homework.value?.id}"
get() = "/homework/${viewModel.homework.value?.id}"

override fun provideConfig() = viewModel.homework
.map { homework ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NewsFragment : MainFragment() {


override var url: String? = null
get() = "news/${viewModel.news.value?.id}"
get() = "/news/${viewModel.news.value?.id}"

override fun provideConfig() = viewModel.news
.map { news ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object ApiService {
fun getInstance(): ApiServiceInterface {

val loggingInterceptor = HttpLoggingInterceptor()
loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY
loggingInterceptor.level = HttpLoggingInterceptor.Level.BASIC

val client = OkHttpClient.Builder()
.addInterceptor { chain ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package org.schulcloud.mobile.viewmodels

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import org.schulcloud.mobile.utils.trimTrailingSlash

class IdViewModelFactory(private val id: String) : ViewModelProvider.NewInstanceFactory() {

@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
// Deep linking also matches a trailing slash
val id = id.trimTrailingSlash()

return when (modelClass) {
NewsViewModel::class.java -> NewsViewModel(id) as T
CourseViewModel::class.java -> CourseViewModel(id) as T
Expand Down
68 changes: 63 additions & 5 deletions app/src/main/res/navigation/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
app:startDestination="@id/fragment_dashboard">
app:startDestination="@id/fragment_dashboard"
tools:ignore="UnusedAttribute">

<fragment
android:id="@+id/fragment_dashboard"
Expand All @@ -25,30 +26,59 @@
<action
android:id="@+id/action_dashboardFragment_to_fileOverviewFragment"
app:destination="@id/fragment_fileOverview" />

<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/dashboard" />
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/dashboard/" />
</fragment>


<!-- News -->
<fragment
android:id="@+id/fragment_newsList"
android:name="org.schulcloud.mobile.controllers.news.NewsListFragment"
tools:layout="@layout/fragment_news_list" />
tools:layout="@layout/fragment_news_list">
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/news" />
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/news/" />
</fragment>

<fragment
android:id="@+id/fragment_news"
android:name="org.schulcloud.mobile.controllers.news.NewsFragment"
tools:layout="@layout/fragment_news">
<argument
android:name="id"
app:argType="string" />

<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/news/{id}" />
</fragment>
<action
android:id="@+id/action_global_fragment_news"
app:destination="@id/fragment_news" />


<!-- Course -->
<fragment
android:id="@+id/fragment_courseList"
android:name="org.schulcloud.mobile.controllers.course.CourseListFragment"
tools:layout="@layout/fragment_course_list" />
tools:layout="@layout/fragment_course_list">
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/courses" />
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/courses/" />
</fragment>

<fragment
android:id="@+id/fragment_course"
android:name="org.schulcloud.mobile.controllers.course.CourseFragment"
Expand All @@ -60,36 +90,56 @@
<action
android:id="@+id/action_global_fragment_course"
app:destination="@id/fragment_course" />

<fragment
android:id="@+id/fragment_topic"
android:name="org.schulcloud.mobile.controllers.topic.TopicFragment"
tools:layout="@layout/fragment_topic">
<argument
android:name="id"
app:argType="string" />

<!-- Disabled because some types of content are not supported yet. That way, you can still open it externally. -->
<!--<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/courses/{courseId}/topics/{id}" />-->
</fragment>
<action
android:id="@+id/action_global_fragment_topic"
app:destination="@id/fragment_topic" />


<!-- Calendar -->
<!--<fragment
android:id="@+id/fragment_calendar"
android:name="org.schulcloud.mobile.controllers.main.CalendarFragment"
tools:layout="@layout/fragment_calendar" />-->


<!-- Task -->
<fragment
android:id="@+id/fragment_homeworkList"
android:name="org.schulcloud.mobile.controllers.homework.HomeworkListFragment"
tools:layout="@layout/fragment_homework_list" />
tools:layout="@layout/fragment_homework_list">
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/homework" />
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/homework/" />
</fragment>

<fragment
android:id="@+id/fragment_homework"
android:name="org.schulcloud.mobile.controllers.homework.HomeworkFragment"
tools:layout="@layout/fragment_homework">
<argument
android:name="id"
app:argType="string" />

<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/homework/{id}" />
</fragment>
<action
android:id="@+id/action_global_fragment_homework"
Expand All @@ -99,7 +149,15 @@
<fragment
android:id="@+id/fragment_fileOverview"
android:name="org.schulcloud.mobile.controllers.file.FileOverviewFragment"
tools:layout="@layout/fragment_file_overview" />
tools:layout="@layout/fragment_file_overview">
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/files" />
<deepLink
android:autoVerify="true"
app:uri="schul-cloud.org/files/" />
</fragment>

<fragment
android:id="@+id/fragment_file"
android:name="org.schulcloud.mobile.controllers.file.FileFragment"
Expand Down
18 changes: 18 additions & 0 deletions supported-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Schemes: `http`, `https`
Host: `schul-cloud.org`


| Name | Path | Comments |
| ------------- | -------------- | --------------------------------------------- |
| Dashboard | /dashboard | |
| News list | /news | |
| News | /news/{id} | |
| Course list | /courses | |
| Course | | Not supported<sup>1</sup> |
| Topic | | Disabled as some content is not supported yet |
| Homework list | /homework | |
| Homework | /homework/{id} | |
| File overview | /files | |
| Folder | | Not supported (shared not implemented) |

*<sup>1</sup> Note: Lazy matching is not supported! Hence `/courses/{courseId}/topics/{id}` is matched by `/courses/{id}`.*