-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a BottomNavigationView and the UpdateChecker
- Loading branch information
1 parent
3b1a729
commit 58473e6
Showing
22 changed files
with
333 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/src/main/java/net/theluckycoder/stundenplan/extensions/ContextExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package net.theluckycoder.stundenplan.extensions | ||
|
||
import android.content.ActivityNotFoundException | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.net.Uri | ||
|
||
fun Context.browseUrl(url: String): Boolean { | ||
return try { | ||
val intent = Intent(Intent.ACTION_VIEW).apply { | ||
data = Uri.parse(url) | ||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
} | ||
|
||
startActivity(intent) | ||
true | ||
} catch (e: ActivityNotFoundException) { | ||
e.printStackTrace() | ||
false | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/net/theluckycoder/stundenplan/extensions/Extensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package net.theluckycoder.stundenplan.extensions | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import android.net.ConnectivityManager | ||
import android.net.NetworkCapabilities | ||
import android.os.Build | ||
import android.view.View | ||
import android.widget.ProgressBar | ||
import androidx.core.content.getSystemService | ||
import androidx.lifecycle.AndroidViewModel | ||
import androidx.lifecycle.ViewModel | ||
|
||
val AndroidViewModel.app: Application | ||
get() = getApplication() |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/net/theluckycoder/stundenplan/model/Timetable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package net.theluckycoder.stundenplan.model | ||
|
||
data class Timetable( | ||
val type: TimetableType, | ||
val url: String, | ||
) |
2 changes: 1 addition & 1 deletion
2
...heluckycoder/stundenplan/TimetableType.kt → ...ycoder/stundenplan/model/TimetableType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.