Skip to content

Commit

Permalink
Bumped to 2.0-draft19 (1467) - Merge pull request #27 from ZoeMeow102…
Browse files Browse the repository at this point in the history
…7/draft

- [Rework] Account Training Subject Result screen.
- [Improve] Update dependencies to latest. This will resolve crash app when sv.dut.udn.vn is not reachable.
- [Fixed] Account Training Result score isn't readable when in dark mode.
- [Removed] NewsGlobalGroupByDate, NewsSubjectGroupByDate.
  • Loading branch information
ZoeMeow1027 authored Jun 24, 2024
2 parents 64122d6 + 2a25ff3 commit eb895a0
Show file tree
Hide file tree
Showing 19 changed files with 224 additions and 292 deletions.
62 changes: 34 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,46 @@
## Known issues
- `Your current wallpaper` option in app background settings will be disabled on Android 14 and later. You can check why in `Issue` tab in repository.

## 2.0-draft19 (1467)
- [Rework] Account Training Subject Result screen.
- [Improve] Update dependencies to latest.
- This will resolve crash app when sv.dut.udn.vn is not reachable.
- [Fixed] Account Training Result score isn't readable when in dark mode.
- [Removed] ~~NewsGlobalGroupByDate~~, ~~NewsSubjectGroupByDate~~.

## 2.0-draft18 (1448)
### Changes and fixes
- Update dependencies to latest
- Gradle to 8.8
- AGP to 8.5.0
- This will resolve login issue when server rebooted
- When you're failed when logging in but done it before, this will show a option for you to re-login instead
- SchoolYearChooser will choose between two arrows instead of ComboBox
- Improve Vietnamese strings
- Account
- Account Information: Show a tooltip about editing contents
- Account Subject Fee: Show total price and credits about this school year / semester
- Account Training Status: Redesign UI
- Main Screen (tab mode)
- Remove SnackbarState in Notifications (fixes duplicate SnackbarState)
- [Improve] Update dependencies to latest
- Gradle to 8.8
- AGP to 8.5.0
- This will resolve login issue when server rebooted
- [Improve] When you're failed when logging in but done it before, this will show a option for you to re-login instead.
- [Improve] Improve Vietnamese strings
- [Changes] SchoolYearChooser will choose between two arrows instead of ComboBox
- [Changes] Account
- Account Information: Show a tooltip about editing contents
- Account Subject Fee: Show total price and credits about this school year / semester
- Account Training Status: Redesign UI
- [Changes] Main Screen (tab mode)
- Remove SnackbarState in Notifications (fixes duplicate SnackbarState)

## 2.0-draft17 (1404)
### What's new
- News notification settings: Change your preferences about news notifications.
- Changed UI for Subject Fee (not final yet).
- [New] News notification settings: Change your preferences about news notifications.
- [Rework] Subject Fee (not final yet).

### Changes and fixes
- Fixed [#24](https://github.com/ZoeMeow1027/DutSchedule/issues/24).
- Add a option to get current school year from Internet.
- To access that, please go to `Settings` -> `Experiment Settings` -> `Current School Year`.
- Some settings won't load after update. You might need to reconfig them in settings. I'm sorry about that.
- Login screen will let you relogin if previous attempt was failed.
- You can clear previous login to attempt with another account.
- Now you can turn off notifications about news global and news subject.
- In news subject notifications, you can choose about "All", "Match your filter" and "Off".
- News filter settings will now only shown when enabled (this mean it will hidden at default).
- Update Vietnamese strings for most screens, but not done yet.
- Optimized codes and updated dependencies to latest.
- Updated dependencies to latest to fix issues about Account feature.
- [New] Add a option to get current school year from Internet.
- To access that, please go to `Settings` -> `Experiment Settings` -> `Current School Year`.
- [Improve] Login screen will let you relogin if previous attempt was failed.
- You can clear previous login to attempt with another account.
- [Improve] Now you can turn off notifications about news global and news subject.
- In news subject notifications, you can choose about "All", "Match your filter" and "Off".
- News filter settings will now only shown when enabled (this mean it will hidden at default).
- [Improve] Update Vietnamese strings for most screens, but not done yet.
- [Improve] Optimized codes and updated dependencies to latest.
- Updated dependencies to latest to fix issues about Account feature.
- [Fixed] [#24](https://github.com/ZoeMeow1027/DutSchedule/issues/24).
- [Known Issue] Some settings won't load after update. You might need to reconfig them in settings. I'm sorry about that.

## 2.0-draft16 (1063)
- AccountActivity:
Expand Down
9 changes: 5 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'

id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
// https://stackoverflow.com/questions/70550883/warning-the-following-options-were-not-recognized-by-any-processor-dagger-f
id 'kotlin-kapt'
}

android {
Expand All @@ -14,8 +15,8 @@ android {
applicationId "io.zoemeow.dutschedule"
minSdk 21
targetSdkVersion 34
versionCode 1448
versionName "2.0-draft18"
versionCode 1467
versionName "2.0-draft19"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -121,7 +122,7 @@ dependencies {

implementation 'org.jetbrains.kotlinx:kotlinx-datetime:0.5.0'

implementation 'com.github.dutwrapper:dutwrapper-java:e32e1b8170'
implementation 'com.github.dutwrapper:dutwrapper-java:v1.10.1'

implementation 'com.google.android.material:material:1.12.0'

Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/io/zoemeow/dutschedule/GlobalVariables.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package io.zoemeow.dutschedule

import androidx.compose.ui.unit.dp

class GlobalVariables {
companion object {
const val REQUEST_EXPIRED_DURATION = 1000 * 60 * 5

const val LINK_FORGOT_PASSWORD = "https://www.facebook.com/ctsvdhbkdhdn/posts/pfbid02G5sza1p8x7tEJ7S1Cac6a66EW3exgxLNmR9L26RZ8sX8xjhbEnguoeAXms31i7oxl"
const val LINK_REPOSITORY = "https://github.com/ZoeMeow1027/DutSchedule"
const val LINK_REPOSITORY_RELEASE = "${LINK_REPOSITORY}/releases"
const val LINK_CHANGELOG = "https://github.com/ZoeMeow1027/DutSchedule/blob/stable/CHANGELOG.md"
const val LINK_CHANGELOG = "${LINK_REPOSITORY}/blob/stable/CHANGELOG.md"

const val REQUEST_EXPIRED_DURATION = 1000 * 60 * 5
val ROUNDED_CORNER_SHAPE_SIZE = 7.dp
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ class PermissionsActivity : BaseActivity() {

@OptIn(ExperimentalMaterial3Api::class)
@Composable
// TODO: Using of context.
private fun MainView(
context: Context,
@Suppress("UNUSED_PARAMETER") context: Context,
snackBarHostState: SnackbarHostState,
containerColor: Color,
contentColor: Color,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import io.dutwrapper.dutwrapper.model.accounts.SubjectScheduleItem
import io.dutwrapper.dutwrapper.model.accounts.trainingresult.AccountTrainingStatus
import io.dutwrapper.dutwrapper.model.enums.NewsSearchType
import io.dutwrapper.dutwrapper.model.news.NewsGlobalItem
import io.dutwrapper.dutwrapper.model.news.NewsGroupByDate
import io.dutwrapper.dutwrapper.model.news.NewsSubjectItem
import io.zoemeow.dutschedule.model.account.AccountSession
import io.zoemeow.dutschedule.model.account.SchoolYearItem
Expand Down Expand Up @@ -43,46 +42,6 @@ class DutRequestRepository {
}
}

fun getNewsGlobalGroupByDate(
page: Int = 1,
searchType: NewsSearchType? = null,
searchQuery: String? = null
): ArrayList<NewsGroupByDate<NewsGlobalItem>> {
return try {
News.getNewsGlobalGroupByDate(page, searchType, searchQuery)
} catch (ex: Exception) {
ex.printStackTrace()
arrayListOf()
}
}

fun getNewsSubjectGroupByDate(
page: Int = 1,
searchType: NewsSearchType? = null,
searchQuery: String? = null
): ArrayList<NewsGroupByDate<NewsSubjectItem>> {
return try {
News.getNewsSubjectGroupByDate(page, searchType, searchQuery)
} catch (ex: Exception) {
ex.printStackTrace()
arrayListOf()
}
}

/**
* Detect if a account existed in account session.
*
* @param accountSession Your account information.
* @return true if exist, otherwise false.
*/
fun hasSavedLogin(accountSession: AccountSession): Boolean {
return (
accountSession.accountAuth.username != null &&
accountSession.accountAuth.password != null &&
accountSession.accountAuth.rememberLogin
)
}

/**
* Login your account on sv.dut.udn.vn.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import io.zoemeow.dutschedule.GlobalVariables
import io.zoemeow.dutschedule.R
import io.zoemeow.dutschedule.utils.capitalized

Expand All @@ -43,7 +44,7 @@ fun AccountInfoBanner(
Surface(
modifier = Modifier
.padding(padding)
.clip(RoundedCornerShape(7.dp)),
.clip(RoundedCornerShape(GlobalVariables.ROUNDED_CORNER_SHAPE_SIZE)),
color = MaterialTheme.colorScheme.secondaryContainer.copy(alpha = opacity),
content = {
Column(
Expand Down Expand Up @@ -86,7 +87,7 @@ fun AccountInfoBanner(
if (isFailed) {
Surface(
modifier = Modifier.padding(top = 5.dp, bottom = 10.dp),
shape = RoundedCornerShape(7.dp),
shape = RoundedCornerShape(GlobalVariables.ROUNDED_CORNER_SHAPE_SIZE),
color = MaterialTheme.colorScheme.surface.copy(alpha = when {
opacity + 0.15f >= 1f -> 1f
else -> opacity + 0.1f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import io.dutwrapper.dutwrapper.model.accounts.SubjectFeeItem
import io.zoemeow.dutschedule.GlobalVariables
import io.zoemeow.dutschedule.R
import io.zoemeow.dutschedule.ui.component.base.Tag

Expand All @@ -37,7 +38,7 @@ fun AccountSubjectFeeInformation(
Surface(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(10.dp))
.clip(RoundedCornerShape(GlobalVariables.ROUNDED_CORNER_SHAPE_SIZE))
.clickable {
onClick?.let { it() }
},
Expand All @@ -56,7 +57,7 @@ fun AccountSubjectFeeInformation(
text = item.name,
style = MaterialTheme.typography.titleLarge,
)
Spacer(modifier = Modifier.size(7.dp))
Spacer(modifier = Modifier.size(5.dp))
if (item.debt) {
Tag(
text = context.getString(R.string.account_subjectfee_status_notdoneyet),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import io.dutwrapper.dutwrapper.model.accounts.SubjectScheduleItem
import io.zoemeow.dutschedule.GlobalVariables
import io.zoemeow.dutschedule.R
import io.zoemeow.dutschedule.utils.CustomDateUtil

Expand All @@ -28,7 +29,7 @@ fun SubjectInformation(
Surface(
modifier = modifier
.fillMaxWidth()
.clip(RoundedCornerShape(10.dp))
.clip(RoundedCornerShape(GlobalVariables.ROUNDED_CORNER_SHAPE_SIZE))
.clickable {
onClick?.let { it() }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import io.dutwrapper.dutwrapper.model.accounts.SubjectScheduleItem
import io.zoemeow.dutschedule.GlobalVariables
import io.zoemeow.dutschedule.R
import io.zoemeow.dutschedule.model.settings.SubjectCode
import io.zoemeow.dutschedule.ui.component.base.DialogBase
Expand Down Expand Up @@ -156,7 +156,7 @@ private fun ContentInBoxWithBorder(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight(),
shape = RoundedCornerShape(10.dp),
shape = RoundedCornerShape(GlobalVariables.ROUNDED_CORNER_SHAPE_SIZE),
) {
Column(
modifier = Modifier
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import io.zoemeow.dutschedule.GlobalVariables
import io.zoemeow.dutschedule.R

@Composable
Expand Down Expand Up @@ -200,7 +201,7 @@ fun LoginBox(
Surface(
modifier = Modifier.padding(top = 10.dp),
color = MaterialTheme.colorScheme.secondaryContainer.copy(alpha = opacity),
shape = RoundedCornerShape(5.dp),
shape = RoundedCornerShape(GlobalVariables.ROUNDED_CORNER_SHAPE_SIZE),
content = {
Row(
modifier = Modifier
Expand Down
Loading

0 comments on commit eb895a0

Please sign in to comment.