added a dark theme, see #15
* the app now needs sdkversion 23 now an min
This commit is contained in:
@ -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