Browse Source

some minor gui fixes

* why was minifyEnabled = false ??????????
pull/20/head
Jannik 3 years ago
parent
commit
15f1386b6e
  1. 22
      app/build.gradle
  2. 4
      app/src/main/java/org/mosad/seil0/projectlaogai/MainActivity.kt
  3. 14
      app/src/main/java/org/mosad/seil0/projectlaogai/fragments/SettingsFragment.kt
  4. 3
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/LessonTextView.kt
  5. 3
      app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/MensaDayCardView.kt
  6. 6
      app/src/main/res/layout/fragment_settings.xml
  7. 2
      app/src/main/res/layout/nav_header_main.xml
  8. 2
      app/src/main/res/values-de-rDE/strings.xml
  9. 17
      app/src/main/res/values/colors.xml
  10. 10
      app/src/main/res/values/strings.xml

22
app/build.gradle

@ -14,12 +14,17 @@ android {
targetSdkVersion 28
versionCode 11
versionName "0.3.96"
versionNameSuffix "-beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue "string", "build_time", buildTime()
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
versionNameSuffix "-release"
}
}
compileOptions {
@ -29,17 +34,22 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'org.jetbrains.anko:anko-commons:0.10.8'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'org.jetbrains.anko:anko-commons:0.10.8'
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
implementation 'com.afollestad.material-dialogs:core:2.0.3'
implementation 'com.afollestad.material-dialogs:color:2.0.3'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.afollestad:aesthetic:1.0.0-beta05'
implementation 'com.afollestad.material-dialogs:core:2.2.0'
implementation 'com.afollestad.material-dialogs:color:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
static def buildTime() {
return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}

4
app/src/main/java/org/mosad/seil0/projectlaogai/MainActivity.kt

@ -35,14 +35,14 @@ import com.afollestad.aesthetic.Aesthetic
import com.google.android.material.navigation.NavigationView
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.app_bar_main.*
import org.mosad.seil0.projectlaogai.controller.CacheController
import org.mosad.seil0.projectlaogai.controller.PreferencesController
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cColorAccent
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cColorPrimary
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cCourse
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.coursesCacheTime
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.mensaCacheTime
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.timetableCacheTime
import org.mosad.seil0.projectlaogai.controller.CacheController
import org.mosad.seil0.projectlaogai.controller.PreferencesController
import org.mosad.seil0.projectlaogai.controller.TCoRAPIController
import org.mosad.seil0.projectlaogai.fragments.*
import java.sql.Date

14
app/src/main/java/org/mosad/seil0/projectlaogai/fragments/SettingsFragment.kt

@ -38,6 +38,7 @@ import com.afollestad.materialdialogs.list.listItems
import kotlinx.android.synthetic.main.fragment_settings.*
import org.jetbrains.anko.doAsync
import org.jetbrains.anko.uiThread
import org.mosad.seil0.projectlaogai.BuildConfig
import org.mosad.seil0.projectlaogai.controller.PreferencesController
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cColorAccent
import org.mosad.seil0.projectlaogai.controller.PreferencesController.Companion.cColorPrimary
@ -58,7 +59,7 @@ class SettingsFragment : Fragment() {
private lateinit var linLayoutUser: LinearLayout
private lateinit var linLayoutCourse: LinearLayout
private lateinit var linLayoutInfo: LinearLayout
private lateinit var linLayoutAbout: LinearLayout
private lateinit var linLayoutPrimaryColor: LinearLayout
private lateinit var linLayoutAccentColor: LinearLayout
private lateinit var switchBuffet: Switch
@ -69,7 +70,7 @@ class SettingsFragment : Fragment() {
linLayoutUser = view.findViewById(R.id.linLayout_User)
linLayoutCourse = view.findViewById(R.id.linLayout_Course)
linLayoutInfo = view.findViewById(R.id.linLayout_Info)
linLayoutAbout = view.findViewById(R.id.linLayout_About)
linLayoutPrimaryColor = view.findViewById(R.id.linLayout_PrimaryColor)
linLayoutAccentColor = view.findViewById(R.id.linLayout_AccentColor)
switchBuffet = view.findViewById(R.id.switch_buffet)
@ -84,6 +85,7 @@ class SettingsFragment : Fragment() {
super.onViewCreated(view, savedInstanceState)
txtView_Course.text = cCourse.courseName
txtView_AboutDesc.text = resources.getString(R.string.about_version, BuildConfig.VERSION_NAME, getString(R.string.build_time))
switch_buffet.isChecked = cShowBuffet // init switch
}
@ -100,11 +102,11 @@ class SettingsFragment : Fragment() {
txtView_Course.text = cCourse.courseName // update txtView
}
linLayoutInfo.setOnClickListener {
linLayoutAbout.setOnClickListener {
// open a new info dialog
MaterialDialog(context!!)
.title(R.string.about)
.message(R.string.about_text)
.title(R.string.about_dialog_heading)
.message(R.string.about_dialog_text)
.show()
}
@ -162,7 +164,7 @@ class SettingsFragment : Fragment() {
// open a new dialog
MaterialDialog(context)
.title(R.string.select_course)
.listItems(items = courseNameList) { _, index, text ->
.listItems(items = courseNameList) { _, index, _ ->
val dialog = MaterialDialog(context).cancelable(false)
.cancelOnTouchOutside(false)

3
app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/LessonTextView.kt

@ -4,6 +4,7 @@ import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.widget.TextView
import org.mosad.seil0.projectlaogai.R
import org.mosad.seil0.projectlaogai.hsoparser.Lesson
class LessonTextView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : TextView(context, attrs) {
@ -15,7 +16,7 @@ class LessonTextView @JvmOverloads constructor(context: Context, attrs: Attribut
}
fun setLesson(lesson: Lesson) {
this.text = resources.getString(org.mosad.seil0.projectlaogai.R.string.string_new_line, lesson.lessonSubject)
this.text = resources.getString(R.string.string_new_line, lesson.lessonSubject)
this.append(lesson.lessonTeacher + "\n")
this.append(lesson.lessonRoom)
}

3
app/src/main/java/org/mosad/seil0/projectlaogai/uicomponents/MensaDayCardView.kt

@ -23,6 +23,7 @@
package org.mosad.seil0.projectlaogai.uicomponents
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.widget.LinearLayout
import android.widget.TextView
@ -40,7 +41,7 @@ class MensaDayCardView @JvmOverloads constructor(context: Context, attrs: Attrib
txtViewDayHeading = findViewById(R.id.txtView_DayHeading)
// workaround to prevent a white border
//this.setBackgroundColor(Color.TRANSPARENT)
this.setBackgroundColor(Color.TRANSPARENT)
}
fun getLinLayoutMensaDay(): LinearLayout {

6
app/src/main/res/layout/fragment_settings.xml

@ -78,7 +78,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_margin="7dp"
android:id="@+id/linLayout_Info">
android:id="@+id/linLayout_About">
<TextView
android:text="@string/about_txtView"
android:layout_width="match_parent"
@ -86,9 +86,9 @@
android:textStyle="bold" android:textSize="16sp"
android:textColor="@android:color/primary_text_light"/>
<TextView
android:text="@string/version"
android:text="@string/about_version"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="@+id/txtView_Version"/>
android:layout_height="wrap_content" android:id="@+id/txtView_AboutDesc"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>

2
app/src/main/res/layout/nav_header_main.xml

@ -27,7 +27,7 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/nav_header_vertical_spacing"
android:text="@string/nav_header_title"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:id="@+id/txtView_nav_header_title"/>
<TextView
android:layout_width="wrap_content"

2
app/src/main/res/values-de-rDE/strings.xml

@ -24,7 +24,7 @@
<string name="accent_color">Akzentfarbe</string>
<string name="accent_color_desc">Die Akzentfarbe, Standard ist indigo</string>
<string name="select">auswählen</string>
<string name="about">über</string>
<string name="about_dialog_heading">Über</string>
<string name="loading_timetable">lade Stundenplan …</string>
<string name="navigation_drawer_close">Navigationsleiste schließen</string>
<string name="navigation_drawer_open">Navigationsleiste öffnen</string>

17
app/src/main/res/values/colors.xml

@ -5,4 +5,21 @@
<color name="colorAccent">#3F51B5</color>
<color name="colorMensaDay">#ebe8e9</color>
<color name="ic_launcher_background">#FFFFFF</color>
<!--theme color section, not the working colors-->
<color name="textPrimaryDark">#FFFFFF</color>
<color name="textSecondaryDark">#F5F5F5</color>
<color name="textPrimaryLight">#000000</color>
<color name="textSecondaryLight">#818181</color>
<color name="themePrimaryDark">#000000</color>
<color name="themeSecondaryDark">#202020</color>
<color name="themeTertiaryDark">#424242</color>
<color name="themePrimaryLight">#FFFFFF</color>
<color name="themeSecondaryLight">#202020</color>
<color name="themeTertiaryLight">#424242</color>
<color name="test">#424242</color>
</resources>

10
app/src/main/res/values/strings.xml

@ -2,7 +2,7 @@
<string name="app_name" translatable="false">Project Laogai</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title" translatable="false">hso App 0.3.96</string>
<string name="nav_header_title" translatable="false">Project Laogai</string>
<string name="nav_header_subtitle" translatable="false">seil0@mosad.xyz</string>
<string name="nav_header_desc" translatable="false">Project Laogai</string>
@ -34,16 +34,17 @@
<string name="info">Info</string>
<string name="user">User</string>
<string name="course_desc">Tap to change course</string>
<string name="select_course">Select your course</string>
<string name="primary_color">primary color</string>
<string name="primary_color_desc">The primary color, default is black.</string>
<string name="accent_color">accent color</string>
<string name="accent_color_desc">The accent color, default is indigo.</string>
<string name="show_buffet">always show buffet</string>
<string name="select">select</string>
<string name="version" translatable="false">version 0.3.96</string>
<string name="about">about</string>
<string name="about_txtView" translatable="false">hso App by @Seil0</string>
<string name="about_text" translatable="false">"This software is made by @Seil0 and is published under the terms and conditions of GPL 3. For further information visit \ngit.mosad.xyz/Seil0/ProjectLaogai \n\n© 2018-2019 seil0@mosad.xyz "</string>
<string name="about_version" translatable="false">version %1$s (%2$s)</string>
<string name="about_dialog_heading">About</string>
<string name="about_dialog_text" translatable="false">"This software is made by @Seil0 and is published under the terms and conditions of GPL 3. For further information visit \ngit.mosad.xyz/Seil0/ProjectLaogai \n\n© 2018-2019 seil0@mosad.xyz "</string>
<string name="loading_timetable">loading timetable …</string>
<string name="string_new_line" translatable="false">%1$s\n</string>
@ -56,6 +57,5 @@
<string name="save_key_coursesCacheTime" translatable="false">org.mosad.seil0.projectlaogai.coursesCacheTime</string>
<string name="save_key_mensaCacheTime" translatable="false">org.mosad.seil0.projectlaogai.mensaCacheTime</string>
<string name="save_key_timetableCacheTime" translatable="false">org.mosad.seil0.projectlaogai.timetableCacheTime</string>
<string name="select_course">Select your course</string>
</resources>

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close