Giter Club home page Giter Club logo

android-mdc-theming's Introduction

Hi there πŸ‘‹

I'm a Principal Android Engineer at GoDaddy.

My area of focus is Jetpack Compose, Material Design and delightful UX/UI.

I'm based in Cape Town, South Africa πŸ‡ΏπŸ‡¦

You can find me on:

android-mdc-theming's People

Contributors

ricknout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-mdc-theming's Issues

Question: is it possible to use a theme based on OS settings?

On Android 8.1 (and maybe 9.0) there is a way to set a wallpaper or live wallpaper that will (try to) change the theme of the OS, making it dark or not.

Is it possible to adjust the UI based on it? If so, how can I do it and detect the theme?

I know that on Android Q it should be possible, but what about previous versions?

Can the chips have dynamic text other than "ChipDrawable"?

Hi,
Wonderful tutorial! The android documentation is particularly lacking and your project merges that gap.
In the file chip.xml the text seems hardcoded i.e. "ChipDrawable." Is this by design or can it be changed? I tried modifying chip.text but it made no difference.

round corners not working

Hello,

I tried to follow the tutorial as per the medium comment here . But still I'm not getting round corners. I made sure I extended the BottomSheetDialog thru my xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme.BottomSheet" parent="Theme.MaterialComponents.DayNight" />

    <style name="AppTheme.BottomSheet.Themed" parent="Theme.MaterialComponents.DayNight.NoActionBar">
        <!-- Global color attributes -->
        <item name="colorPrimary">@color/color_primary</item>
        <item name="colorPrimaryVariant">@color/color_primary_variant</item>
        <item name="colorOnPrimary">@color/color_on_primary</item>
        <item name="colorSecondary">@color/color_secondary</item>
        <item name="colorSecondaryVariant">@color/color_secondary_variant</item>
        <item name="colorOnSecondary">@color/color_on_secondary</item>
        <item name="colorError">@color/color_error</item>
        <item name="colorOnError">@color/color_on_error</item>
        <item name="colorSurface">@color/color_surface</item>
        <item name="colorOnSurface">@color/color_on_surface</item>
        <item name="android:colorBackground">@color/color_background</item>
        <item name="colorOnBackground">@color/color_on_background</item>
        <item name="android:statusBarColor">@color/color_status_bar</item>
        <!-- Global type attributes -->
        <item name="fontFamily">@font/roboto_mono</item>
        <item name="android:fontFamily">@font/roboto_mono</item>
        <!-- Global shape attributes -->
        <item name="shapeAppearanceSmallComponent">@style/AppShapeAppearance.SmallComponent</item>
        <item name="shapeAppearanceMediumComponent">@style/AppShapeAppearance.MediumComponent</item>
        <item name="shapeAppearanceLargeComponent">@style/AppShapeAppearance.LargeComponent</item>
        <!-- Bottom Sheet widget style attributes -->
        <item name="bottomSheetStyle">@style/AppStandardBottomSheet</item>
        <item name="bottomSheetDialogTheme">@style/AppModalBottomSheet</item>
    </style>

    <style name="AppStandardBottomSheet">
        <item name="shapeAppearance">?attr/shapeAppearanceLargeComponent</item>
        <item name="backgroundTint">?attr/colorSecondary</item>
        <item name="android:elevation">8dp</item>
        <item name="behavior_hideable">false</item>
        <item name="behavior_draggable">true</item>
        <item name="behavior_skipCollapsed">false</item>
        <item name="behavior_peekHeight">80dp</item>
        <item name="behavior_fitToContents">false</item>
        <item name="behavior_halfExpandedRatio">0.5</item>
        <item name="behavior_expandedOffset">0</item>
    </style>

    <style name="AppModalBottomSheet" parent="ThemeOverlay.MaterialComponents.DayNight.BottomSheetDialog">
        <item name="bottomSheetStyle">@style/ModalBottomSheet</item>
    </style>

    <style name="ModalBottomSheet" parent="Widget.MaterialComponents.BottomSheet.Modal">
        <!-- Apply attributes here -->
    </style>
</resources>

But still, I'm not seeing the round corners

image

Question: is BottomSheetDialogFragment shown small on landscape, on purpose?

I've noticed that if you show the BottomSheetDialogFragment via the sample, by clicking on "show modal bottom sheet", while on landscape , it gets shown much smaller:

image

Is this on purpose?
Why does it occur?
Is there an official way to handle this? To know if it's in this state? Is it possible to expand it by default?

The only thing I've found about it, is a workaround as such:
https://stackoverflow.com/a/55713263/878126
but it's not an official solution...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.