added a dark theme, see #15
* the app now needs sdkversion 23 now an min
This commit is contained in:
		| @ -10,10 +10,10 @@ android { | ||||
|     compileSdkVersion 28 | ||||
|     defaultConfig { | ||||
|         applicationId "org.mosad.seil0.projectlaogai" | ||||
|         minSdkVersion 21 | ||||
|         minSdkVersion 23 | ||||
|         targetSdkVersion 28 | ||||
|         versionCode 13 | ||||
|         versionName "0.4.90" | ||||
|         versionCode 14 | ||||
|         versionName "0.4.91" | ||||
|         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
|         resValue "string", "build_time", buildTime() | ||||
|         setProperty("archivesBaseName", "projectlaogai-$versionName") | ||||
| @ -37,7 +37,7 @@ dependencies { | ||||
|     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 'androidx.constraintlayout:constraintlayout:2.0.0-beta1' | ||||
|     implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2' | ||||
|     implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' | ||||
|     implementation 'com.google.android.material:material:1.0.0' | ||||
|     implementation 'com.google.code.gson:gson:2.8.5' | ||||
|  | ||||
| @ -61,26 +61,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte | ||||
|  | ||||
|         // load mensa, timetable and color | ||||
|         load() | ||||
|  | ||||
|         // If we haven't set any defaults, do that now | ||||
|         if (Aesthetic.isFirstTime) { | ||||
|             // this is executed on the first app start, use this to show tutorial etc. | ||||
|             Aesthetic.config { | ||||
|                 colorPrimary(Color.BLACK) | ||||
|                 colorPrimaryDark(Color.BLACK) | ||||
|                 colorAccent(Color.parseColor("#3F51B5")) | ||||
|                 apply() | ||||
|             } | ||||
|  | ||||
|             SettingsFragment().selectCourse(this) | ||||
|         } else { | ||||
|             Aesthetic.config { | ||||
|                 colorPrimary(cColorPrimary) | ||||
|                 colorPrimaryDark(cColorPrimary) | ||||
|                 colorAccent(cColorAccent) | ||||
|                 apply() | ||||
|             } | ||||
|         } | ||||
|         initAesthetic() | ||||
|  | ||||
|         //init home fragment | ||||
|         val fragmentTransaction: FragmentTransaction = supportFragmentManager.beginTransaction() | ||||
| @ -146,6 +127,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte | ||||
|         fragmentTransaction.commit() | ||||
|  | ||||
|         drawer_layout.closeDrawer(GravityCompat.START) | ||||
|  | ||||
|         return true | ||||
|     } | ||||
|  | ||||
| @ -208,4 +190,28 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte | ||||
|         println("startup completed in $startupTime ms") | ||||
|     } | ||||
|  | ||||
|     private fun initAesthetic() { | ||||
|         // If we haven't set any defaults, do that now | ||||
|         if (Aesthetic.isFirstTime) { | ||||
|             // this is executed on the first app start, use this to show tutorial etc. | ||||
|             Aesthetic.config { | ||||
|                 activityTheme(R.style.AppTheme) | ||||
|                 colorPrimary(Color.BLACK) | ||||
|                 colorPrimaryDark(Color.BLACK) | ||||
|                 colorAccent(Color.parseColor("#3f51b5")) | ||||
|                 apply() | ||||
|             } | ||||
|  | ||||
|             SettingsFragment().selectCourse(this) | ||||
|         } else { | ||||
|             Aesthetic.config { | ||||
| //                activityTheme(R.style.AppTheme_Light) | ||||
|                 colorPrimary(cColorPrimary) | ||||
|                 colorPrimaryDark(cColorPrimary) | ||||
|                 colorAccent(cColorAccent) | ||||
|                 apply() | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| @ -37,6 +37,10 @@ class CacheController(cont: Context) { | ||||
|  | ||||
|     private val context = cont | ||||
|  | ||||
|     init { | ||||
|         // TODO move cache check here | ||||
|     } | ||||
|  | ||||
|     companion object { | ||||
|         var coursesList = ArrayList<Course>() | ||||
|         var timetables = ArrayList<TimetableWeek>() | ||||
|  | ||||
| @ -60,7 +60,7 @@ class HomeFragment : Fragment() { | ||||
|         val view: View = inflater.inflate(R.layout.fragment_home, container, false) | ||||
|  | ||||
|         addMensaMenu().get() | ||||
|         addTimeTable() | ||||
|         addTimeTable().get() | ||||
|  | ||||
|         // Inflate the layout for this fragment | ||||
|         return view | ||||
| @ -75,42 +75,48 @@ class HomeFragment : Fragment() { | ||||
|         val cal = Calendar.getInstance() | ||||
|         val mensaCardView = DayCardView(context!!) | ||||
|  | ||||
|  | ||||
|  | ||||
|         uiThread { | ||||
|  | ||||
|             if (cal.get(Calendar.HOUR_OF_DAY) < 15) { | ||||
|                 dayMeals = mensaMenu.currentWeek.days[NotRetardedCalendar().getDayOfWeekIndex()].meals | ||||
|                 mensaCardView.setDayHeading(resources.getString(R.string.today_date, formatter.format(cal.time))) | ||||
|             } else { | ||||
|                 dayMeals = mensaMenu.currentWeek.days[NotRetardedCalendar().getTomorrowWeekIndex()].meals | ||||
|                 cal.add(Calendar.DATE, 1) | ||||
|                 mensaCardView.setDayHeading(resources.getString(R.string.tomorrow_date, formatter.format(cal.time))) | ||||
|             } | ||||
|  | ||||
|             if (dayMeals.size >= 2) { | ||||
|                 // get the index of the first meal, not a "Schneller Teller" | ||||
|                 loop@ for ((i, meal) in dayMeals.withIndex()) { | ||||
|                     if (meal.heading.contains("Essen")) { | ||||
|  | ||||
|                         val meal1Layout = MealLinearLayout(context) | ||||
|                         meal1Layout.setMeal(dayMeals[i]) | ||||
|                         mensaCardView.getLinLayoutDay().addView(meal1Layout) | ||||
|  | ||||
|                         val meal2Layout = MealLinearLayout(context) | ||||
|                         meal2Layout.setMeal(dayMeals[i + 1]) | ||||
|                         meal2Layout.disableDivider() | ||||
|                         mensaCardView.getLinLayoutDay().addView(meal2Layout) | ||||
|  | ||||
|                         break@loop | ||||
|                     } | ||||
|             if (isAdded) { | ||||
|                 if (cal.get(Calendar.HOUR_OF_DAY) < 15) { | ||||
|                     dayMeals = mensaMenu.currentWeek.days[NotRetardedCalendar().getDayOfWeekIndex()].meals | ||||
|                     mensaCardView.setDayHeading(activity!!.resources.getString(R.string.today_date, formatter.format(cal.time))) | ||||
|                 } else { | ||||
|                     dayMeals = mensaMenu.currentWeek.days[NotRetardedCalendar().getTomorrowWeekIndex()].meals | ||||
|                     cal.add(Calendar.DATE, 1) | ||||
|                     mensaCardView.setDayHeading(activity!!.resources.getString(R.string.tomorrow_date, formatter.format(cal.time))) | ||||
|                 } | ||||
|  | ||||
|             } else { | ||||
|                 mensaCardView.getLinLayoutDay().addView(getNoCard(resources.getString(R.string.mensa_closed))) | ||||
|                 if (dayMeals.size >= 2) { | ||||
|                     // get the index of the first meal, not a "Schneller Teller" | ||||
|                     loop@ for ((i, meal) in dayMeals.withIndex()) { | ||||
|                         if (meal.heading.contains("Essen")) { | ||||
|  | ||||
|                             val meal1Layout = MealLinearLayout(context) | ||||
|                             meal1Layout.setMeal(dayMeals[i]) | ||||
|                             mensaCardView.getLinLayoutDay().addView(meal1Layout) | ||||
|  | ||||
|                             val meal2Layout = MealLinearLayout(context) | ||||
|                             meal2Layout.setMeal(dayMeals[i + 1]) | ||||
|                             meal2Layout.disableDivider() | ||||
|                             mensaCardView.getLinLayoutDay().addView(meal2Layout) | ||||
|  | ||||
|                             break@loop | ||||
|                         } | ||||
|                     } | ||||
|  | ||||
|                 } else { | ||||
|                     mensaCardView.getLinLayoutDay().addView(getNoCard(resources.getString(R.string.mensa_closed))) | ||||
|                 } | ||||
|  | ||||
|                 linLayout_Home.addView(mensaCardView) | ||||
|             } | ||||
|  | ||||
|             linLayout_Home.addView(mensaCardView) | ||||
|         } | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @ -123,29 +129,30 @@ class HomeFragment : Fragment() { | ||||
|  | ||||
|         uiThread { | ||||
|  | ||||
|             if (timetables.isNotEmpty() && dayIndex < 6) { | ||||
|             if (isAdded) { | ||||
|                 if (timetables.isNotEmpty() && dayIndex < 6) { | ||||
|  | ||||
|                 // first check the current day | ||||
|                 dayCardView = addDayTimetable(timetables[0].days[dayIndex]) | ||||
|                 dayCardView.setDayHeading(resources.getString(R.string.today_date, formatter.format(cal.time))) | ||||
|                     // first check the current day | ||||
|                     dayCardView = addDayTimetable(timetables[0].days[dayIndex]) | ||||
|                     dayCardView.setDayHeading(resources.getString(R.string.today_date, formatter.format(cal.time))) | ||||
|  | ||||
|                 // if there are no lessons try to find the next day with a lesson | ||||
|                 if (dayCardView.getLinLayoutDay().childCount <= 1) | ||||
|                     dayCardView = findNextDay(0, dayIndex + 1) | ||||
|                     // if there are no lessons try to find the next day with a lesson | ||||
|                     if (dayCardView.getLinLayoutDay().childCount <= 1) | ||||
|                         dayCardView = findNextDay(0, dayIndex + 1) | ||||
|  | ||||
|                 linLayout_Home.addView(dayCardView) | ||||
|             } else if (dayIndex == 6) { | ||||
|                 // if that's the case it's sunday | ||||
|                 dayCardView = findNextDay(1, 0) | ||||
|                 linLayout_Home.addView(dayCardView) | ||||
|             } else { | ||||
|                 MaterialDialog(context!!) | ||||
|                     .title(R.string.error) | ||||
|                     .message(R.string.timetable_error) | ||||
|                     .show() | ||||
|                 // TODO log the error and send feedback | ||||
|                     linLayout_Home.addView(dayCardView) | ||||
|                 } else if (dayIndex == 6) { | ||||
|                     // if that's the case it's sunday | ||||
|                     dayCardView = findNextDay(1, 0) | ||||
|                     linLayout_Home.addView(dayCardView) | ||||
|                 } else { | ||||
|                     MaterialDialog(context!!) | ||||
|                         .title(R.string.error) | ||||
|                         .message(R.string.timetable_error) | ||||
|                         .show() | ||||
|                     // TODO log the error and send feedback | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
| @ -50,6 +50,7 @@ import org.mosad.seil0.projectlaogai.controller.CacheController.Companion.course | ||||
| import org.mosad.seil0.projectlaogai.controller.TCoRAPIController | ||||
| import org.mosad.seil0.projectlaogai.hsoparser.DataTypes | ||||
| import java.util.* | ||||
| import android.util.TypedValue | ||||
|  | ||||
| /** | ||||
|  * The settings controller class | ||||
| @ -87,6 +88,14 @@ class SettingsFragment : Fragment() { | ||||
|         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 | ||||
|  | ||||
|         val outValue = TypedValue() | ||||
|         activity!!.theme.resolveAttribute(R.attr.themeName, outValue, true) | ||||
|         if (outValue.string == "dark") { | ||||
|             switch_buffet.setTextColor(activity!!.resources.getColor(R.color.textPrimaryDark, activity!!.theme)) | ||||
|         } else { | ||||
|             switch_buffet.setTextColor(activity!!.resources.getColor(R.color.textPrimaryLight, activity!!.theme)) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @ -95,6 +104,19 @@ class SettingsFragment : Fragment() { | ||||
|     private fun initActions() { | ||||
|         linLayoutUser.setOnClickListener { | ||||
|             // open a new dialog | ||||
|             // TODO move and save | ||||
| //            val outValue = TypedValue() | ||||
| //            activity!!.theme.resolveAttribute(R.attr.themeName, outValue, true) | ||||
| //            if (outValue.string == "dark") { | ||||
| //                Aesthetic.config { | ||||
| //                    activityTheme(R.style.AppTheme_Light) | ||||
| //                } | ||||
| //            } else { | ||||
| //                Aesthetic.config { | ||||
| //                    activityTheme(R.style.AppTheme_Dark) | ||||
| //                } | ||||
| //            } | ||||
|  | ||||
|         } | ||||
|  | ||||
|         linLayoutCourse.setOnClickListener { | ||||
|  | ||||
| @ -22,7 +22,6 @@ | ||||
|  | ||||
| package org.mosad.seil0.projectlaogai.fragments | ||||
|  | ||||
| import android.os.Build | ||||
| import android.os.Bundle | ||||
| import android.view.LayoutInflater | ||||
| import android.view.View | ||||
| @ -94,17 +93,15 @@ class TimeTableFragment : Fragment() { | ||||
|                     .show() | ||||
|             } | ||||
|  | ||||
|             // TODO only works with android m(23) or higher | ||||
|             // hide the btnCardValue if the user is scrolling down | ||||
|             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | ||||
|                 scrollViewTimetable.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY -> | ||||
|                     if (scrollY > oldScrollY) { | ||||
|                         faBtnAddLesson.hide() | ||||
|                     } else { | ||||
|                         faBtnAddLesson.show() | ||||
|                     } | ||||
|             scrollViewTimetable.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY -> | ||||
|                 if (scrollY > oldScrollY) { | ||||
|                     faBtnAddLesson.hide() | ||||
|                 } else { | ||||
|                     faBtnAddLesson.show() | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
| @ -3,9 +3,7 @@ | ||||
|  | ||||
|     <item android:drawable="@color/colorPrimary"/> | ||||
|  | ||||
|     <!--TODO when minAPI is 23 use this--> | ||||
|     <!--<item android:gravity="center" android:width="144dp" android:height="144dp">--> | ||||
|     <item android:gravity="center"> | ||||
|     <item android:gravity="center" android:width="144dp" android:height="144dp"> | ||||
|         <bitmap | ||||
|                 android:gravity="fill_horizontal|fill_vertical" | ||||
|                 android:src="@mipmap/ic_laogai_icon_splash"/> | ||||
|  | ||||
| @ -3,7 +3,7 @@ | ||||
|                                    xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|                                    android:layout_width="match_parent" | ||||
|                                    android:layout_height="wrap_content" app:cardUseCompatPadding="true" | ||||
|                                    app:cardElevation="5dp" app:cardBackgroundColor="@color/themeSecondary" | ||||
|                                    app:cardElevation="5dp" app:cardBackgroundColor="?themeSecondary" | ||||
| > | ||||
|  | ||||
|     <LinearLayout | ||||
|  | ||||
| @ -3,7 +3,8 @@ | ||||
|              xmlns:tools="http://schemas.android.com/tools" | ||||
|              android:layout_width="match_parent" | ||||
|              android:layout_height="match_parent" | ||||
|              tools:context=".fragments.HomeFragment"> | ||||
|              tools:context=".fragments.HomeFragment" | ||||
|              android:background="?themePrimary"> | ||||
|  | ||||
|     <androidx.constraintlayout.widget.ConstraintLayout | ||||
|             android:layout_width="match_parent" | ||||
|  | ||||
| @ -1,9 +1,10 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <FrameLayout 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" | ||||
|              xmlns:tools="http://schemas.android.com/tools" | ||||
|              android:layout_width="match_parent" | ||||
|              android:layout_height="match_parent" | ||||
|              tools:context=".fragments.MensaFragment"> | ||||
|              tools:context=".fragments.MensaFragment" | ||||
|              android:background="?themePrimary"> | ||||
|  | ||||
|     <androidx.swiperefreshlayout.widget.SwipeRefreshLayout | ||||
|             android:layout_width="match_parent" | ||||
| @ -12,13 +13,13 @@ | ||||
|  | ||||
|         <ScrollView | ||||
|                 android:layout_width="match_parent" | ||||
|                 android:layout_height="match_parent" android:id="@+id/scrollView_Mensa"> | ||||
|                 android:layout_height="match_parent" | ||||
|                 android:id="@+id/scrollView_Mensa"> | ||||
|             <LinearLayout | ||||
|                     android:orientation="vertical" | ||||
|                     android:layout_width="match_parent" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:animateLayoutChanges="false" | ||||
|                     android:background="@color/themePrimary" | ||||
|                     android:id="@+id/linLayout_Mensa"/> | ||||
|         </ScrollView> | ||||
|     </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | ||||
|  | ||||
| @ -1,9 +1,11 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <FrameLayout 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" | ||||
|              xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|              xmlns:tools="http://schemas.android.com/tools" | ||||
|              android:layout_width="match_parent" | ||||
|              android:layout_height="match_parent" | ||||
|              tools:context=".fragments.SettingsFragment"> | ||||
|              tools:context=".fragments.SettingsFragment" | ||||
|              android:background="?themePrimary"> | ||||
|  | ||||
|     <androidx.constraintlayout.widget.ConstraintLayout | ||||
|             android:layout_width="match_parent" | ||||
| @ -12,14 +14,19 @@ | ||||
|         <LinearLayout | ||||
|                 android:orientation="vertical" | ||||
|                 android:layout_width="match_parent" | ||||
|                 android:layout_height="match_parent" app:layout_constraintTop_toTopOf="parent" | ||||
|                 app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" | ||||
|                 android:background="@android:color/background_light"> | ||||
|                 android:layout_height="match_parent" | ||||
|                 app:layout_constraintTop_toTopOf="parent" | ||||
|                 app:layout_constraintStart_toStartOf="parent" | ||||
|                 app:layout_constraintEnd_toEndOf="parent" | ||||
|         > | ||||
|             <androidx.cardview.widget.CardView | ||||
|                     android:layout_width="match_parent" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:layout_marginTop="9dp" android:id="@+id/cardView_Info" app:cardElevation="5dp" | ||||
|                     app:cardUseCompatPadding="true"> | ||||
|                     android:layout_marginTop="9dp" | ||||
|                     android:id="@+id/cardView_Info" | ||||
|                     app:cardElevation="5dp" | ||||
|                     app:cardUseCompatPadding="true" | ||||
|                     app:cardBackgroundColor="?themeSecondary"> | ||||
|                 <LinearLayout | ||||
|                         android:orientation="vertical" | ||||
|                         android:layout_width="match_parent" | ||||
| @ -27,24 +34,33 @@ | ||||
|                     <TextView | ||||
|                             android:text="@string/info" | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" android:id="@+id/txtView_Info" | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:id="@+id/txtView_Info" | ||||
|                             android:typeface="sans" | ||||
|                             android:textSize="18sp" android:textStyle="bold" android:fontFamily="sans-serif" | ||||
|                             android:layout_margin="7dp" android:textColor="?colorAccent"/> | ||||
|                             android:textSize="18sp" | ||||
|                             android:textStyle="bold" | ||||
|                             android:fontFamily="sans-serif" | ||||
|                             android:layout_margin="7dp" | ||||
|                             android:textColor="?colorAccent"/> | ||||
|                     <LinearLayout | ||||
|                             android:orientation="vertical" | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" android:padding="7dp" android:id="@+id/linLayout_User"> | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:padding="7dp" | ||||
|                             android:id="@+id/linLayout_User"> | ||||
|                         <TextView | ||||
|                                 android:text="@string/sample_user" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:id="@+id/txtView_User" | ||||
|                                 android:textSize="16sp" android:textStyle="bold" | ||||
|                                 android:textColor="@android:color/primary_text_light"/> | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:id="@+id/txtView_User" | ||||
|                                 android:textSize="16sp" | ||||
|                                 android:textStyle="bold" | ||||
|                         /> | ||||
|                         <TextView | ||||
|                                 android:text="@string/user" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:id="@+id/txtView_UserDesc"/> | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:id="@+id/txtView_UserDesc"/> | ||||
|                     </LinearLayout> | ||||
|                     <View | ||||
|                             android:id="@+id/divider2" | ||||
| @ -55,18 +71,21 @@ | ||||
|                     <LinearLayout | ||||
|                             android:orientation="vertical" | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" android:layout_margin="7dp" | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:layout_margin="7dp" | ||||
|                             android:id="@+id/linLayout_Course"> | ||||
|                         <TextView | ||||
|                                 android:text="@string/sample_course" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:id="@+id/txtView_Course" | ||||
|                                 android:textSize="16sp" android:textColor="@android:color/primary_text_light" | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:id="@+id/txtView_Course" | ||||
|                                 android:textSize="16sp" | ||||
|                                 android:textStyle="bold"/> | ||||
|                         <TextView | ||||
|                                 android:text="@string/course_desc" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:id="@+id/txtView_CourseDesc"/> | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:id="@+id/txtView_CourseDesc"/> | ||||
|                     </LinearLayout> | ||||
|                     <View | ||||
|                             android:id="@+id/divider" | ||||
| @ -77,43 +96,57 @@ | ||||
|                     <LinearLayout | ||||
|                             android:orientation="vertical" | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="match_parent" android:layout_margin="7dp" | ||||
|                             android:layout_height="match_parent" | ||||
|                             android:layout_margin="7dp" | ||||
|                             android:id="@+id/linLayout_About"> | ||||
|                         <TextView | ||||
|                                 android:text="@string/about_txtView" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:id="@+id/txtView_About" | ||||
|                                 android:textStyle="bold" android:textSize="16sp" | ||||
|                                 android:textColor="@android:color/primary_text_light"/> | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:id="@+id/txtView_About" | ||||
|                                 android:textStyle="bold" | ||||
|                                 android:textSize="16sp" | ||||
|                         /> | ||||
|                         <TextView | ||||
|                                 android:text="@string/about_version" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:id="@+id/txtView_AboutDesc"/> | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:id="@+id/txtView_AboutDesc"/> | ||||
|                     </LinearLayout> | ||||
|                 </LinearLayout> | ||||
|             </androidx.cardview.widget.CardView> | ||||
|  | ||||
|             <androidx.cardview.widget.CardView | ||||
|                     android:layout_width="match_parent" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:id="@+id/cardView_Settings" app:cardElevation="5dp" | ||||
|                     app:cardUseCompatPadding="true"> | ||||
|                     android:id="@+id/cardView_Settings" | ||||
|                     app:cardElevation="5dp" | ||||
|                     app:cardUseCompatPadding="true" | ||||
|                     app:cardBackgroundColor="?themeSecondary"> | ||||
|                 <LinearLayout | ||||
|                         android:orientation="vertical" | ||||
|                         android:layout_width="match_parent" | ||||
|                         android:layout_height="wrap_content" android:id="@+id/linLayout_Settings" android:padding="7dp"> | ||||
|                         android:layout_height="wrap_content" | ||||
|                         android:id="@+id/linLayout_Settings" | ||||
|                         android:padding="7dp"> | ||||
|                     <TextView | ||||
|                             android:text="@string/settings" | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" android:id="@+id/txtView_Settings" | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:id="@+id/txtView_Settings" | ||||
|                             android:typeface="sans" | ||||
|                             android:textSize="18sp" android:textColor="?colorAccent" | ||||
|                             android:textStyle="bold" android:paddingTop="3dp"/> | ||||
|                             android:textSize="18sp" | ||||
|                             android:textColor="?colorAccent" | ||||
|                             android:textStyle="bold" | ||||
|                             android:paddingTop="3dp"/> | ||||
|                     <LinearLayout | ||||
|                             android:orientation="horizontal" | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:gravity="center_vertical|end" | ||||
|                             android:clickable="true" android:id="@+id/linLayout_PrimaryColor" android:focusable="true"> | ||||
|                             android:clickable="true" | ||||
|                             android:id="@+id/linLayout_PrimaryColor" | ||||
|                             android:focusable="true"> | ||||
|                         <LinearLayout | ||||
|                                 android:orientation="vertical" | ||||
|                                 android:layout_width="wrap_content" | ||||
| @ -121,22 +154,27 @@ | ||||
|                             <TextView | ||||
|                                     android:text="@string/primary_color" | ||||
|                                     android:layout_width="match_parent" | ||||
|                                     android:layout_height="wrap_content" android:id="@+id/txtView_PrimaryColor" | ||||
|                                     android:textSize="16sp" android:textStyle="bold" | ||||
|                                     android:textColor="@android:color/primary_text_light"/> | ||||
|                                     android:layout_height="wrap_content" | ||||
|                                     android:id="@+id/txtView_PrimaryColor" | ||||
|                                     android:textSize="16sp" | ||||
|                                     android:textStyle="bold" | ||||
|                             /> | ||||
|                             <TextView | ||||
|                                     android:text="@string/primary_color_desc" | ||||
|                                     android:layout_width="match_parent" | ||||
|                                     android:layout_height="wrap_content" android:id="@+id/txtView_PrimaryColorDesc"/> | ||||
|                                     android:layout_height="wrap_content" | ||||
|                                     android:id="@+id/txtView_PrimaryColorDesc"/> | ||||
|                         </LinearLayout> | ||||
|                         <LinearLayout | ||||
|                                 android:orientation="vertical" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:layout_margin="7dp" | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:layout_margin="7dp" | ||||
|                                 android:gravity="end"> | ||||
|                             <View | ||||
|                                     android:layout_width="40dp" | ||||
|                                     android:layout_height="40dp" android:id="@+id/view_PrimaryColor" | ||||
|                                     android:layout_height="40dp" | ||||
|                                     android:id="@+id/view_PrimaryColor" | ||||
|                                     android:background="?colorPrimary"/> | ||||
|                         </LinearLayout> | ||||
|                     </LinearLayout> | ||||
| @ -145,7 +183,9 @@ | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:gravity="center_vertical|end" | ||||
|                             android:clickable="true" android:id="@+id/linLayout_AccentColor" android:focusable="true"> | ||||
|                             android:clickable="true" | ||||
|                             android:id="@+id/linLayout_AccentColor" | ||||
|                             android:focusable="true"> | ||||
|                         <LinearLayout | ||||
|                                 android:orientation="vertical" | ||||
|                                 android:layout_width="wrap_content" | ||||
| @ -153,31 +193,38 @@ | ||||
|                             <TextView | ||||
|                                     android:text="@string/accent_color" | ||||
|                                     android:layout_width="match_parent" | ||||
|                                     android:layout_height="wrap_content" android:id="@+id/txtView_AccentColor" | ||||
|                                     android:textSize="16sp" android:textStyle="bold" | ||||
|                                     android:textColor="@android:color/primary_text_light"/> | ||||
|                                     android:layout_height="wrap_content" | ||||
|                                     android:id="@+id/txtView_AccentColor" | ||||
|                                     android:textSize="16sp" | ||||
|                                     android:textStyle="bold" | ||||
|                             /> | ||||
|                             <TextView | ||||
|                                     android:text="@string/accent_color_desc" | ||||
|                                     android:layout_width="match_parent" | ||||
|                                     android:layout_height="wrap_content" android:id="@+id/txtView_AccentColorDesc"/> | ||||
|                                     android:layout_height="wrap_content" | ||||
|                                     android:id="@+id/txtView_AccentColorDesc"/> | ||||
|                         </LinearLayout> | ||||
|                         <LinearLayout | ||||
|                                 android:orientation="vertical" | ||||
|                                 android:layout_width="match_parent" | ||||
|                                 android:layout_height="wrap_content" android:layout_margin="7dp" | ||||
|                                 android:layout_height="wrap_content" | ||||
|                                 android:layout_margin="7dp" | ||||
|                                 android:gravity="end"> | ||||
|                             <View | ||||
|                                     android:layout_width="40dp" | ||||
|                                     android:layout_height="40dp" android:id="@+id/view_AccentColor" | ||||
|                                     android:layout_height="40dp" | ||||
|                                     android:id="@+id/view_AccentColor" | ||||
|                                     android:background="?colorAccent"/> | ||||
|                         </LinearLayout> | ||||
|                     </LinearLayout> | ||||
|                     <Switch | ||||
|                             android:layout_width="match_parent" | ||||
|                             android:layout_height="wrap_content" android:id="@+id/switch_buffet" | ||||
|                             android:layout_height="wrap_content" | ||||
|                             android:id="@+id/switch_buffet" | ||||
|                             android:textSize="16sp" | ||||
|                             android:textColor="@android:color/primary_text_light" android:textStyle="bold" | ||||
|                             android:text="@string/show_buffet"/> | ||||
|                             android:textStyle="bold" | ||||
|                             android:text="@string/show_buffet" | ||||
|                     /> | ||||
|                 </LinearLayout> | ||||
|             </androidx.cardview.widget.CardView> | ||||
|         </LinearLayout> | ||||
|  | ||||
| @ -1,9 +1,10 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <FrameLayout 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" | ||||
|              xmlns:tools="http://schemas.android.com/tools" | ||||
|              android:layout_width="match_parent" | ||||
|              android:layout_height="match_parent" | ||||
|              tools:context=".fragments.TimeTableFragment"> | ||||
|              tools:context=".fragments.TimeTableFragment" | ||||
|              android:background="?themePrimary"> | ||||
|  | ||||
|     <androidx.swiperefreshlayout.widget.SwipeRefreshLayout | ||||
|             android:layout_width="match_parent" | ||||
| @ -18,7 +19,6 @@ | ||||
|                     android:layout_width="match_parent" | ||||
|                     android:layout_height="wrap_content" | ||||
|                     android:animateLayoutChanges="false" | ||||
|                     android:background="@color/themePrimary" | ||||
|                     android:id="@+id/linLayout_Timetable"/> | ||||
|         </ScrollView> | ||||
|     </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | ||||
|  | ||||
| @ -11,7 +11,7 @@ | ||||
|         <TextView | ||||
|                 android:layout_width="wrap_content" | ||||
|                 android:layout_height="wrap_content" android:id="@+id/txtView_lessonSubject" android:layout_weight="1" | ||||
|                 android:textSize="15sp" android:textColor="@color/textPrimary"/> | ||||
|                 android:textSize="15sp"/> | ||||
|         <TextView | ||||
|                 android:text="@string/a_time" | ||||
|                 android:layout_width="wrap_content" | ||||
| @ -21,15 +21,15 @@ | ||||
|     <TextView | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" android:id="@+id/txtView_lessonTeacher" android:textSize="15sp" | ||||
|             android:textColor="@color/textPrimary"/> | ||||
|     /> | ||||
|     <TextView | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" android:id="@+id/txtView_lessonRoom" | ||||
|             android:textColor="@color/textPrimary"/> | ||||
|     /> | ||||
|     <View | ||||
|             android:id="@+id/divider_lesson" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="1dp" | ||||
|             android:background="?android:attr/listDivider" | ||||
|             android:background="?dividerColor" | ||||
|     /> | ||||
| </LinearLayout> | ||||
| @ -8,16 +8,16 @@ | ||||
|             android:text="@string/meal" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" android:id="@+id/txtView_MealHeading" android:textSize="18sp" | ||||
|             android:textColor="@color/textPrimary" android:textAlignment="center" android:paddingBottom="5dp" | ||||
|             android:textAlignment="center" android:paddingBottom="5dp" | ||||
|             android:textStyle="bold"/> | ||||
|     <TextView | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" android:id="@+id/txtView_Meal" android:textSize="15sp" | ||||
|             android:textColor="@color/textPrimary" android:textAlignment="center"/> | ||||
|             android:textAlignment="center"/> | ||||
|     <View | ||||
|             android:id="@+id/divider_meal" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="1dp" | ||||
|             android:background="?android:attr/listDivider" | ||||
|             android:background="?dividerColor" | ||||
|     /> | ||||
| </LinearLayout> | ||||
							
								
								
									
										9
									
								
								app/src/main/res/values/attrs.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								app/src/main/res/values/attrs.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
|     <attr format="string" name="themeName"/> | ||||
|     <attr format="color" name="themePrimary"/> | ||||
|     <attr format="color" name="themeSecondary"/> | ||||
|     <attr format="color" name="textPrimary"/> | ||||
|     <attr format="color" name="textSecondary"/> | ||||
|     <attr format="color" name="dividerColor"/> | ||||
| </resources> | ||||
| @ -2,28 +2,27 @@ | ||||
| <resources> | ||||
|     <color name="colorPrimary">#000000</color> | ||||
|     <color name="colorPrimaryDark">#000000</color> | ||||
|     <color name="colorAccent">#3F51B5</color> | ||||
|     <color name="ic_launcher_background">#FFFFFF</color> | ||||
|  | ||||
|     <color name="themePrimary">#FFFFFF</color> | ||||
|     <color name="themeSecondary">#FFFFFF</color> | ||||
|     <color name="themeTertiary">#FAFAFA</color> <!-- TODO find a better color --> | ||||
|     <color name="colorAccent">#3f51b5</color> | ||||
|     <color name="ic_launcher_background">#ffffff</color> | ||||
|  | ||||
|     <color name="themePrimary">#ffffff</color> | ||||
|     <color name="themeSecondary">#ffffff</color> | ||||
|     <color name="textPrimary">#000000</color> | ||||
|     <color name="textSecondary">#818181</color> | ||||
|  | ||||
|     <!--theme color section, not the working colors--> | ||||
|     <color name="textPrimaryDark">#FFFFFF</color> | ||||
|     <color name="textSecondaryDark">#E0E0E0</color> | ||||
|     <color name="textPrimaryLight">#000000</color> | ||||
|     <color name="textSecondaryLight">#818181</color> | ||||
|  | ||||
|     <color name="themePrimaryDark">#000000</color> | ||||
|     <color name="themeSecondaryDark">#303030</color> | ||||
|     <color name="themeTertiaryDark">#424242</color> | ||||
|     <color name="textPrimaryDark">#ffffff</color> | ||||
|     <color name="textSecondaryDark">#e0e0e0</color> | ||||
|     <color name="dividerDark">#232323</color> | ||||
|  | ||||
|     <color name="themePrimaryLight">#ffffff</color> | ||||
|     <color name="themeSecondaryLight">#ffffff</color> | ||||
|     <color name="textPrimaryLight">#000000</color> | ||||
|     <color name="textSecondaryLight">#818181</color> | ||||
|     <color name="dividerLight">#e0e0e0</color> | ||||
|  | ||||
|     <color name="themePrimaryLight">#FFFFFF</color> | ||||
|     <color name="themeSecondaryLight">#FFFFFF</color> | ||||
|     <color name="themeTertiaryLight">#424242</color> <!-- TODO find a better color --> | ||||
|  | ||||
| </resources> | ||||
|  | ||||
| @ -1,13 +1,30 @@ | ||||
| <resources> | ||||
|  | ||||
|     <!-- Base application theme. --> | ||||
|     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||||
|         <!-- Customize your theme here. --> | ||||
|     <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | ||||
|         <item name="colorPrimary">@color/colorPrimary</item> | ||||
|         <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||||
|         <item name="colorAccent">@color/colorAccent</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="AppTheme.Light" parent="AppTheme"> | ||||
|         <item name="themeName">light</item> | ||||
|         <item name="themePrimary">@color/themePrimaryLight</item> | ||||
|         <item name="themeSecondary">@color/themeSecondaryLight</item> | ||||
|         <item name="android:textColor">@color/textPrimaryLight</item> | ||||
|         <item name="textPrimary">@color/textPrimaryLight</item> | ||||
|         <item name="dividerColor">@color/dividerLight</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="AppTheme.Dark" parent="AppTheme"> | ||||
|         <item name="themeName">dark</item> | ||||
|         <item name="themePrimary">@color/themePrimaryDark</item> | ||||
|         <item name="themeSecondary">@color/themeSecondaryDark</item> | ||||
|         <item name="android:textColor">@color/textPrimaryDark</item> | ||||
|         <item name="textPrimary">@color/textPrimaryDark</item> | ||||
|         <item name="dividerColor">@color/dividerDark</item> | ||||
|     </style> | ||||
|  | ||||
|     <style name="AppTheme.NoActionBar"> | ||||
|         <item name="windowActionBar">false</item> | ||||
|         <item name="windowNoTitle">true</item> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user