1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-03-05 12:01:35 +00:00

Initial commit for updated flow of themes. (Check description)

Removed DayNight theme. Added a 'white' theme for Light, and 'black' theme for Dark.
Users will have to set the type of Light or Dark theme they want to use.
Default is white for light, black for dark.
More themes will be added later.
This commit is contained in:
Ammar Githam 2020-09-13 19:21:14 +09:00
parent fb20deb9ee
commit ebdaae94d1
26 changed files with 372 additions and 114 deletions

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M18,4V3c0,-0.55 -0.45,-1 -1,-1H5c-0.55,0 -1,0.45 -1,1v4c0,0.55 0.45,1 1,1h12c0.55,0 1,-0.45 1,-1V6h1v4H9v11c0,0.55 0.45,1 1,1h2c0.55,0 1,-0.45 1,-1v-9h8V4h-3z" />
</vector>

View file

@ -1,6 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View file

@ -1,9 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
</vector>

View file

@ -11,7 +11,7 @@
limitations under the License
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#1f000000" />
<solid android:color="@color/grey_600_a20" />
<size
android:width="1dp"
android:height="1dp" />

View file

@ -48,5 +48,5 @@
android:layout_gravity="end"
android:scaleType="fitCenter"
android:visibility="gone"
app:srcCompat="@drawable/ic_star" />
app:srcCompat="@drawable/ic_star_24" />
</FrameLayout>

View file

@ -2,4 +2,4 @@
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@drawable/preference_list_divider_material" />
android:background="@drawable/pref_list_divider_material" />

View file

@ -4,6 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:padding="8dp">
<com.facebook.drawee.view.SimpleDraweeView
@ -16,15 +19,15 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:roundAsCircle="true"
tools:src="@mipmap/ic_launcher" />
tools:background="@mipmap/ic_launcher" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvUsername"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingEnd="4dp"
android:paddingRight="4dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
@ -39,16 +42,17 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:paddingEnd="4dp"
android:paddingRight="4dp"
tools:visibility="gone"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvUsername"
tools:text="full name" />
tools:text="full name"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/isVerified"

View file

@ -13,6 +13,7 @@
android:id="@+id/profile_pic"
android:layout_width="@dimen/image_size_40"
android:layout_height="@dimen/image_size_40"
android:background="@android:color/transparent"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
@ -22,6 +23,7 @@
android:id="@+id/full_name"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/transparent"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:paddingLeft="16dp"
@ -39,11 +41,13 @@
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@android:color/transparent"
android:gravity="center_vertical"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingEnd="16dp"
android:paddingRight="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/arrow_down"
app:layout_constraintStart_toEndOf="@id/profile_pic"
@ -54,6 +58,7 @@
android:id="@+id/arrow_down"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:padding="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -51,7 +51,11 @@
<fragment
android:id="@+id/settingsPreferencesFragment"
android:name="awais.instagrabber.fragments.settings.SettingsPreferencesFragment"
android:label="@string/action_settings" />
android:label="@string/action_settings">
<action
android:id="@+id/action_settingsPreferencesFragment_to_themePreferencesFragment"
app:destination="@id/themePreferencesFragment" />
</fragment>
<fragment
android:id="@+id/aboutFragment"
android:name="awais.instagrabber.fragments.settings.AboutFragment"
@ -61,4 +65,8 @@
android:name="awais.instagrabber.fragments.NotificationsViewerFragment"
android:label="@string/title_notifications"
tools:layout="@layout/fragment_notifications_viewer" />
<fragment
android:id="@+id/themePreferencesFragment"
android:name="awais.instagrabber.fragments.settings.ThemePreferencesFragment"
android:label="@string/theme_settings" />
</navigation>

View file

@ -117,4 +117,16 @@
<item>@navigation/profile_nav_graph</item>
<item>@navigation/more_nav_graph</item>
</array>
<string-array name="light_themes">
<item>@string/light_white_theme</item>
</string-array>
<string-array name="light_theme_values">
<item>@style/AppTheme.Light.White</item>
</string-array>
<string-array name="dark_themes">
<item>@string/dark_black_theme</item>
</string-array>
<string-array name="dark_theme_values">
<item>@style/AppTheme.Dark.Black</item>
</string-array>
</resources>

View file

@ -35,4 +35,34 @@
<!-- Amoled Colors -->
<color name="background_amoled">#000000</color>
<color name="white">#FFFFFF</color>
<color name="black">#000000</color>
<color name="grey_50">#FAFAFA</color>
<color name="grey_100">#F5F5F5</color>
<color name="grey_200">#EEEEEE</color>
<color name="grey_300">#E0E0E0</color>
<color name="grey_400">#BDBDBD</color>
<color name="grey_500">#9E9E9E</color>
<color name="grey_600">#757575</color>
<color name="grey_700">#616161</color>
<color name="grey_800">#424242</color>
<color name="grey_900">#212121</color>
<color name="grey_600_a20">#32757575</color>
<color name="blue_50">#E3F2FD</color>
<color name="blue_100">#BBDEFB</color>
<color name="blue_200">#90CAF9</color>
<color name="blue_300">#64B5F6</color>
<color name="blue_400">#42A5F5</color>
<color name="blue_500">#2196F3</color>
<color name="blue_600">#1E88E5</color>
<color name="blue_700">#1976D2</color>
<color name="blue_800">#1565C0</color>
<color name="blue_900">#0D47A1</color>
<color name="blue_A100">#82B1FF</color>
<color name="blue_A200">#448AFF</color>
<color name="blue_A400">#2979FF</color>
<color name="blue_A700">#2962FF</color>
</resources>

View file

@ -277,4 +277,8 @@
<string name="about_category_3pt_summary">The following third-party open-source libraries are used:</string>
<string name="reminder">Reminder</string>
<string name="reminder_summary">Please use this app responsibly. Downloaded images should only be used for purposes allowed by applicable laws.</string>
<string name="light_white_theme">White</string>
<string name="dark_black_theme">Black</string>
<string name="light_theme_settings">Light theme</string>
<string name="dark_theme_settings">Dark theme</string>
</resources>

View file

@ -45,4 +45,50 @@
<item name="subtitleTextStyle">?attr/textAppearanceSubtitle1</item>
<item name="background">?attr/colorPrimary</item>
</style>
<style name="Widget.BottomNavigationView.Light.White" parent="@style/Widget.MaterialComponents.BottomNavigationView.PrimarySurface">
<item name="colorPrimary">@color/black</item>
</style>
<style name="Widget.BottomNavigationView.Dark.Black" parent="@style/Widget.MaterialComponents.BottomNavigationView.PrimarySurface">
<item name="colorPrimary">@color/white</item>
</style>
<style name="Widget.MaterialComponents.Button.Light.White" parent="Widget.MaterialComponents.Button">
<item name="materialThemeOverlay">@style/ThemeOverlay.Button.Dark.Black</item>
</style>
<style name="Widget.MaterialComponents.Button.Dark.Black" parent="Widget.MaterialComponents.Button">
<item name="materialThemeOverlay">@style/ThemeOverlay.Button.Dark.Black</item>
</style>
<style name="ThemeOverlay.Button.Dark.Black" parent="">
<item name="colorPrimary">@color/white</item>
</style>
<style name="Widget.Dialog.Dark.Black" parent="@style/Theme.AppCompat.Dialog">
<item name="android:background">@color/grey_800</item>
</style>
<style name="Widget.AlertDialog.Dark.Black" parent="@style/Theme.AppCompat.Dialog.Alert">
<item name="android:background">@color/grey_800</item>
</style>
<style name="Widget.AppCompat.CompoundButton.Switch.Dark.Black" parent="@style/Widget.AppCompat.CompoundButton.Switch">
<item name="trackTint">@color/grey_800</item>
<item name="colorControlActivated">@color/blue_900</item>
</style>
<style name="ThemeOverlay.Switch.Dark.Black" parent="">
<item name="colorOnSurface">@color/grey_800</item>
</style>
<style name="Widget.AppCompat.ListView.DropDown.Dark.Black" parent="@style/Widget.AppCompat.ListView.DropDown">
<item name="android:background">@color/grey_800</item>
</style>
<style name="PreferenceFragmentCompatStyle.Dark.Black" parent="PreferenceFragment.Material">
<item name="android:divider">@drawable/pref_list_divider_material</item>
</style>
</resources>

View file

@ -1,19 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog</item>
<item name="android:windowAnimationStyle">@style/AppTheme.WindowAnimationTransition</item>
<item name="bottomNavigationStyle">@style/AppTheme.BottomNavigationView</item>
<style name="AppTheme.Base" parent="Theme.MaterialComponents.Light.NoActionBar">
<!--<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog</item>-->
<!--<item name="android:windowAnimationStyle">@style/AppTheme.WindowAnimationTransition</item>-->
<!--<item name="bottomNavigationStyle">@style/AppTheme.BottomNavigationView</item>-->
<item name="windowActionModeOverlay">true</item>
<item name="actionModeStyle">@style/Widget.App.ActionMode</item>
<item name="actionModeCloseDrawable">@drawable/ic_close_24</item>
<item name="actionBarTheme">@style/ThemeOverlay.AppTheme.Dark.ActionBar</item>
<item name="android:textColorLink">@color/blue_700</item>
<item name="android:textColorHighlight">@color/blue_300</item>
<!--<item name="actionModeStyle">@style/Widget.App.ActionMode</item>-->
<!--<item name="actionBarTheme">@style/ThemeOverlay.AppTheme.Dark.ActionBar</item>-->
</style>
<style name="Theme.Amoled" parent="AppTheme">
<item name="android:colorBackground">@color/background_amoled</item>
<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog.Dark</item>
<style name="AppTheme" parent="AppTheme.Base" />
<style name="AppTheme.Light.White" parent="AppTheme.Base">
<item name="colorPrimary">@color/white</item>
<item name="colorOnPrimary">@color/black</item>
<item name="colorSecondary">@color/white</item>
<item name="colorOnSecondary">@color/black</item>
<item name="colorSurface">@color/white</item>
<item name="colorOnSurface">@color/black</item>
<item name="colorAccent">@color/black</item>
<item name="android:windowBackground">@color/white</item>
<item name="bottomNavigationStyle">@style/Widget.BottomNavigationView.Light.White</item>
<item name="materialButtonStyle">@style/Widget.MaterialComponents.Button.Light.White</item>
</style>
<style name="AppTheme.Dark.Black" parent="AppTheme.Base">
<item name="colorPrimary">@color/black</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorSecondary">@color/black</item>
<item name="colorOnSecondary">@color/white</item>
<item name="colorSurface">@color/black</item>
<item name="colorOnSurface">@color/white</item>
<item name="colorAccent">@color/blue_A700</item>
<item name="colorControlHighlight">@color/grey_600</item>
<item name="android:textColorPrimary">@color/white</item>
<item name="android:textColorSecondary">@color/white</item>
<item name="android:textColorHint">@color/grey_500</item>
<item name="android:windowBackground">@color/black</item>
<item name="bottomNavigationStyle">@style/Widget.BottomNavigationView.Dark.Black</item>
<item name="materialButtonStyle">@style/Widget.MaterialComponents.Button.Dark.Black</item>
<item name="android:dialogTheme">@style/Widget.Dialog.Dark.Black</item>
<item name="alertDialogTheme">@style/Widget.AlertDialog.Dark.Black</item>
<item name="switchStyle">@style/Widget.AppCompat.CompoundButton.Switch.Dark.Black</item>
<item name="android:dropDownListViewStyle">@style/Widget.AppCompat.ListView.DropDown.Dark.Black</item>
<item name="preferenceFragmentCompatStyle">@style/PreferenceFragmentCompatStyle.Dark.Black</item>
</style>
<style name="Theme.Amoled" parent="AppTheme.Base">
<!--<item name="android:colorBackground">@color/background_amoled</item>-->
<!--<item name="bottomSheetDialogTheme">@style/AppTheme.BottomSheetDialog.Dark</item>-->
</style>
<style name="AppTheme.BottomSheetDialog.Dark" parent="Theme.MaterialComponents.BottomSheetDialog" />