Fixes layout issue with themes, added pdf night mode switch in settings

This commit is contained in:
M M Arif
2020-03-06 18:46:22 +05:00
parent 14addf5ed0
commit 61f953d70d
17 changed files with 155 additions and 23 deletions

View File

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
@ -14,7 +14,7 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:background="?attr/primaryBackgroundColor"
tools:ignore="UnusedAttribute">
<ImageView
@ -32,7 +32,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/white"
android:textColor="?attr/primaryTextColor"
android:maxLines="1"
android:textSize="20sp" />
@ -49,6 +49,7 @@
android:numColumns="4"
android:columnWidth="80dp"
android:stretchMode="columnWidth"
android:background="?attr/primaryBackgroundColor"
android:gravity="center"/>
<TextView
@ -58,7 +59,7 @@
android:layout_margin="15dp"
android:gravity="center"
android:text="@string/noDataMembers"
android:textColor="@color/white"
android:textColor="?attr/primaryTextColor"
android:textSize="20sp"
android:visibility="gone" />

View File

@ -49,6 +49,7 @@
android:numColumns="4"
android:columnWidth="80dp"
android:stretchMode="columnWidth"
android:background="?attr/primaryBackgroundColor"
android:gravity="center"/>
<TextView

View File

@ -49,6 +49,7 @@
android:numColumns="4"
android:columnWidth="80dp"
android:stretchMode="columnWidth"
android:background="?attr/primaryBackgroundColor"
android:gravity="center"/>
<TextView

View File

@ -19,10 +19,11 @@
android:inputType="text"
android:background="@drawable/shape_inputs"
android:textColor="?attr/inputTextColor"
android:textColorHint="?attr/primaryBackgroundColor"
android:textColorHint="?attr/hintColor"
android:hint="@string/exploreTextBoxHint"
android:textColorHighlight="?attr/primaryTextColor"
android:imeOptions="actionSend" />
android:imeOptions="actionSend"
android:autofillHints="@string/exploreTextBoxHint" />
<TextView
android:id="@+id/noData"

View File

@ -19,7 +19,7 @@
layout="@layout/layout_settings_appearance"/>
<View
android:id="@+id/translationDivider"
android:id="@+id/fileViewDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="44dp"
@ -29,6 +29,21 @@
android:layout_below="@id/timeLayout"
/>
<include
android:id="@+id/fileViewLayout"
layout="@layout/layout_settings_fileview"/>
<View
android:id="@+id/translationDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="44dp"
android:layout_marginEnd="5dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:layout_below="@id/fileViewLayout"
/>
<include
android:id="@+id/langLayout"
layout="@layout/layout_settings_languages"/>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/layoutFileView"
android:orientation="vertical"
android:layout_below="@+id/fileViewDivider"
android:background="?attr/primaryBackgroundColor">
<TextView
android:id="@+id/fileViewAppearance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:drawableStart="@drawable/ic_file"
android:drawablePadding="20dp"
android:text="@string/fileViewerHeader"
android:textStyle="bold"
android:textColor="@color/colorDarkGreen"/>
<RelativeLayout
android:id="@+id/pdfMode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/pdfModeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginStart="44dp"
android:layout_marginEnd="4dp"
android:text="@string/settingsPdfModeHeaderText"
android:textColor="?attr/primaryTextColor"/>
<Switch
android:id="@+id/switchPdfMode"
android:layout_toEndOf="@+id/pdfModeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:switchMinWidth="56dp"
android:layout_alignParentEnd="true"
android:gravity="end"
android:layout_gravity="end" />
</RelativeLayout>
</LinearLayout>

View File

@ -4,7 +4,6 @@
android:id="@+id/gridViewData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<ImageView
@ -21,7 +20,6 @@
android:gravity="top|center_horizontal"
android:layout_marginTop="1dp"
android:text="@string/orgMember"
android:textSize="14sp"
android:textColor="?attr/primaryTextColor" />
android:textSize="14sp" />
</LinearLayout>

View File

@ -4,7 +4,6 @@
android:id="@+id/gridViewData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<ImageView
@ -21,7 +20,6 @@
android:gravity="top|center_horizontal"
android:layout_marginTop="1dp"
android:text="@string/starMember"
android:textSize="14sp"
android:textColor="?attr/primaryTextColor" />
android:textSize="14sp" />
</LinearLayout>

View File

@ -4,7 +4,6 @@
android:id="@+id/gridViewData"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical">
<ImageView
@ -21,7 +20,6 @@
android:gravity="top|center_horizontal"
android:layout_marginTop="1dp"
android:text="@string/watcherMember"
android:textSize="14sp"
android:textColor="?attr/primaryTextColor" />
android:textSize="14sp" />
</LinearLayout>

View File

@ -265,6 +265,8 @@
<string name="themeSelectorDialogTitle">Select App Theme</string>
<string name="themeSelectionHeaderText">Theme</string>
<string name="themeSelectionSelectedText" translatable="false">Dark</string>
<string name="settingsPdfModeHeaderText">PDF Night Mode</string>
<string name="fileViewerHeader">File Viewer</string>
<!-- settings -->
<string name="noMoreData">No more data available</string>

View File

@ -4,7 +4,6 @@
<!-- Dark theme - default -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:windowBackground">@color/colorPrimary</item>
<item name="android:typeface">monospace</item>
<item name="colorAccent">@color/colorAccent</item>
@ -19,13 +18,13 @@
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back_24dp</item>
<item name="autoCompleteTextViewStyle">@style/AppThemeDarkSearchAutoCompleteTextView</item>
<item name="hintColor">@color/hintColor</item>
<item name="colorControlActivated">@color/darkGreen</item>
</style>
<!-- Dark theme - default -->
<!-- Light theme -->
<style name="AppThemeLight" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:statusBarColor">@color/colorPrimary</item>
<item name="android:windowBackground">@color/lightThemeBackground</item>
<item name="android:typeface">monospace</item>
<item name="colorAccent">@color/colorAccent</item>
@ -40,6 +39,7 @@
<item name="android:homeAsUpIndicator">@drawable/ic_arrow_back_24dp</item>
<item name="autoCompleteTextViewStyle">@style/AppThemeLightSearchAutoCompleteTextView</item>
<item name="hintColor">@color/hintColor</item>
<item name="colorControlActivated">@color/darkGreen</item>
</style>
<!-- Light theme -->