Added German translation

This commit is contained in:
denizk0461
2023-04-14 13:21:24 +02:00
parent f07c41079a
commit 2117535f63
9 changed files with 67 additions and 93 deletions
+6
View File
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintTypos" enabled="true" level="TYPO" enabled_by_default="true" />
</profile>
</component>
@@ -1,15 +1,11 @@
package com.denizk0461.studip.activity package com.denizk0461.studip.activity
import android.os.Bundle import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat import androidx.core.view.WindowCompat
import androidx.navigation.findNavController import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp import androidx.navigation.ui.navigateUp
import android.view.Menu
import android.view.MenuItem
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import androidx.lifecycle.Lifecycle import androidx.lifecycle.Lifecycle
import com.denizk0461.studip.R import com.denizk0461.studip.R
@@ -86,21 +82,21 @@ class MainActivity : AppCompatActivity() {
return true return true
} }
override fun onCreateOptionsMenu(menu: Menu): Boolean { // override fun onCreateOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this adds items to the action bar if it is present. // // Inflate the menu; this adds items to the action bar if it is present.
menuInflater.inflate(R.menu.menu_main, menu) // menuInflater.inflate(R.menu.menu_main, menu)
return true // return true
} // }
override fun onOptionsItemSelected(item: MenuItem): Boolean { // override fun onOptionsItemSelected(item: MenuItem): Boolean {
// Handle action bar item clicks here. The action bar will // // Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long // // automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml. // // as you specify a parent activity in AndroidManifest.xml.
return when (item.itemId) { // return when (item.itemId) {
R.id.action_settings -> true // R.id.action_settings -> true
else -> super.onOptionsItemSelected(item) // else -> super.onOptionsItemSelected(item)
} // }
} // }
override fun onSupportNavigateUp(): Boolean { override fun onSupportNavigateUp(): Boolean {
val navController = findNavController(R.id.nav_host_fragment_content_main) val navController = findNavController(R.id.nav_host_fragment_content_main)
@@ -108,14 +104,14 @@ class MainActivity : AppCompatActivity() {
|| super.onSupportNavigateUp() || super.onSupportNavigateUp()
} }
private fun getFragmentByType(type: FragmentType): Fragment { // private fun getFragmentByType(type: FragmentType): Fragment {
// Log.d("AAA!", "help") //// Log.d("AAA!", "help")
return when (type) { // return when (type) {
FragmentType.SCHEDULE -> EventFragment() // FragmentType.SCHEDULE -> EventFragment()
FragmentType.FOOD -> FoodFragment() // TODO once this fragment has been implemented // FragmentType.FOOD -> FoodFragment()
FragmentType.SETTINGS -> SettingsFragment() // FragmentType.SETTINGS -> SettingsFragment()
} // }
} // }
private fun bottomIdToType(id: Int): FragmentType = when (id) { private fun bottomIdToType(id: Int): FragmentType = when (id) {
R.id.food -> FragmentType.FOOD R.id.food -> FragmentType.FOOD
@@ -1,11 +1,7 @@
package com.denizk0461.studip.adapter package com.denizk0461.studip.adapter
import android.content.res.ColorStateList
import android.util.AttributeSet
import android.util.Log
import android.util.TypedValue import android.util.TypedValue
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.denizk0461.studip.R import com.denizk0461.studip.R
@@ -49,20 +45,14 @@ class StudIPEventAdapter(
theme.resolveAttribute(R.attr.colorPrimary, colorPrimary, true) theme.resolveAttribute(R.attr.colorPrimary, colorPrimary, true)
theme.resolveAttribute(R.attr.colorTextHintLighter, colorTextHint, true) theme.resolveAttribute(R.attr.colorTextHintLighter, colorTextHint, true)
// Log.d("eek!", holder.binding.cardBackground.strokeWidth.toString())
if (!isAnyCourseHighlighted && currentItem.isCurrentCourse(currentCalendar)) { // highlight if (!isAnyCourseHighlighted && currentItem.isCurrentCourse(currentCalendar)) { // highlight
isAnyCourseHighlighted = true isAnyCourseHighlighted = true
// holder.binding.textTitle.setTextColor(colorHighlight.data)
holder.binding.cardBackground.strokeColor = colorPrimary.data holder.binding.cardBackground.strokeColor = colorPrimary.data
holder.binding.cardBackground.strokeWidth = 6 holder.binding.cardBackground.strokeWidth = 6
// holder.binding.cardBackground.cardForegroundColor = holder.binding.root.context.getColorStateList(
// R.color.list_card_selected) // R.color.list_card_selected)
} else { // un-highlight } else { // un-highlight
// holder.binding.textTitle.setTextColor(colorUnhighlight.data)
holder.binding.cardBackground.strokeColor = colorTextHint.data holder.binding.cardBackground.strokeColor = colorTextHint.data
holder.binding.cardBackground.strokeWidth = 3 holder.binding.cardBackground.strokeWidth = 3
// holder.binding.cardBackground.cardForegroundColor = Color.TRANSPARENT
} }
holder.binding.cardBackground.setOnClickListener { holder.binding.cardBackground.setOnClickListener {
@@ -77,15 +67,9 @@ class StudIPEventAdapter(
} }
private fun StudIPEvent.isCurrentCourse(calendar: Calendar): Boolean { private fun StudIPEvent.isCurrentCourse(calendar: Calendar): Boolean =
// if (calendar.get(Calendar.DAY_OF_WEEK) == this.day.toCalendarDay()) { (calendar.get(Calendar.DAY_OF_WEEK) == this.day.toCalendarDay()) &&
if (Calendar.THURSDAY == this.day.toCalendarDay()) { ((calendar.get(Calendar.MINUTE) + calendar.get(Calendar.HOUR_OF_DAY) * 60) < this.timeslotEnd.parseToMinutes())
if ((calendar.get(Calendar.MINUTE) + calendar.get(Calendar.HOUR_OF_DAY) * 60) < this.timeslotEnd.parseToMinutes()) {
return true
}
}
return false
}
// Converts day as defined in StudIPEvent.kt to day from Calendar // Converts day as defined in StudIPEvent.kt to day from Calendar
private fun Int.toCalendarDay(): Int = when (this) { private fun Int.toCalendarDay(): Int = when (this) {
+1 -2
View File
@@ -37,8 +37,7 @@
app:layout_constraintBottom_toTopOf="@+id/nav_view" app:layout_constraintBottom_toTopOf="@+id/nav_view"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" app:layout_constraintTop_toBottomOf="@+id/toolbar"/>
app:navGraph="@navigation/nav_graph"/>
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view" android:id="@+id/nav_view"
@@ -153,7 +153,8 @@
android:text="@string/with_love" android:text="@string/with_love"
android:textSize="10sp" android:textSize="10sp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:textAlignment="center"/> android:textAlignment="center"
tools:ignore="SmallSp" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
-10
View File
@@ -1,10 +0,0 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.denizk0461.studip.activity.MainActivity">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never" />
</menu>
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/FirstFragment">
<fragment
android:id="@+id/FirstFragment"
android:name="com.denizk0461.studip.fragment.EventFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_event">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment" />
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="com.denizk0461.studip.fragment.ParserFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_parser">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
</fragment>
</navigation>
+32
View File
@@ -0,0 +1,32 @@
<resources>
<string name="app_name">Stud.IP Timetable</string>
<string name="monday">MONTAG</string>
<string name="tuesday">DIENSTAG</string>
<string name="wednesday">MITTWOCH</string>
<string name="thursday">DONNERSTAG</string>
<string name="friday">FREITAG</string>
<string name="title_schedule">Dein Stundenplan</string>
<string name="title_food">Mensen-Angebote</string>
<string name="title_settings">App-Einstellungen</string>
<string name="nav_schedule">Stundenplan</string>
<string name="nav_food">esn</string>
<string name="nav_settings">Einstellungen</string>
<string name="toast_fetch_finished">Dein Stundenplan wurde aktualisiert!</string>
<string name="settings_general">Allgemein</string>
<string name="settings_misc">Sonstiges</string>
<string name="refresh_schedule_title">Aktualisiere deinen Stud.IP-Stundenplan</string>
<string name="refresh_schedule_subtitle">Dies wird alle Anpassungen löschen!</string>
<string name="settings_quarter_title">Nutze akademisches Viertel</string>
<string name="settings_quarter_subtitle">Wo es passt</string>
<string name="settings_app_version">App-Verison</string>
<string name="with_love">mit ♡️ aus Bremen-Osterholz\von denizk0461 \\__*</string>
<string name="de4thSpirit">In our hearts, she lives forevermore</string>
</resources>
+1 -7
View File
@@ -1,11 +1,5 @@
<resources> <resources>
<string name="app_name">Stud.IP Timetable</string> <string name="app_name">Stud.IP Timetable</string>
<string name="action_settings">Settings</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="monday">MONDAY</string> <string name="monday">MONDAY</string>
<string name="tuesday">TUESDAY</string> <string name="tuesday">TUESDAY</string>
@@ -28,7 +22,7 @@
<string name="refresh_schedule_title">Refresh your Stud.IP schedule</string> <string name="refresh_schedule_title">Refresh your Stud.IP schedule</string>
<string name="refresh_schedule_subtitle">This will clear any customisations!</string> <string name="refresh_schedule_subtitle">This will clear any customisations!</string>
<string name="settings_quarter_title">Show academic quarter</string> <string name="settings_quarter_title">Use academic quarter</string>
<string name="settings_quarter_subtitle">Where applicable</string> <string name="settings_quarter_subtitle">Where applicable</string>
<string name="settings_app_version">App Version</string> <string name="settings_app_version">App Version</string>