Git Product home page Git Product logo

egorikftp / lady-happy-android Goto Github PK

View Code? Open in Web Editor NEW
259.0 8.0 23.0 44.61 MB

Open Source multi-module app for Handmade Hats company with modern approaches under the hood.

Home Page: https://lady-happy.com

License: Apache License 2.0

Kotlin 99.31% Shell 0.06% JavaScript 0.63%
clean-architecture firebase-firestore multimodule-kotlin-app multimodule handmade-hats dynamic-delivery koin gradle-kts kotlin-flow buildsrc

lady-happy-android's Introduction

Icon

Lady Happy - handmade hats and accessories

API

Download Status Rating Status

Project characteristics ๐Ÿš€

This project brings to the table set of best practices, tools, and solutions:

Integration with Google Assistance ๐Ÿงโ€

Currently available commands in production:

  • actions.intent.GET_THING - Easter egg in application, the real feature with search functionality will be available in the next feature drop.

    Command example: Hey Google, search [felt hats] on lady happy

  • actions.intent.OPEN_APP_FEATURE - voice intent for opening main application screens:

    Command example: Hey Google, open [catalog, about, news, settings] screen on lady happy

Built With ๐Ÿ› 

  • Kotlin - First class and official programming language for Android development.

  • Coroutines - Kotlin's way of way of writing asynchronous, non-blocking code

    • StateFlow - notify views when the underlying data changes
    • SharedFlow - notify multiple subscribers that data changes
  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps

    • View Binding - Allows you to more easily write code that interacts with views
    • ViewModel - Manage UI-related data in a lifecycle conscious way
    • Saved State - Prevent data lost from system-initiated process death
  • Detekt - static code analysis tool for the Kotlin programming language

  • Koin - Dependency Injection Framework

  • Material Components for Android - Modular and customizable Material Design UI components for Android

  • Firebase libraries

Try without building sources

Get it on Google Play

Future plans

  • Step by step migration to Jetpack Compose
  • Allow everyone to try Dynamic delivery with demo credentials

Other things feel free to request using issues

How to build

Just checkout the repository and build with gradle, necessary debug key stored inside the repository.

Find this repository useful? โค๏ธ

Support it by joining stargazers for this repository. โญ
And follow me for my next creations! ๐Ÿคฉ

Structure ๐Ÿ”

This project follows multi-module structure:

Icon

App screenshots

Public features

IconIconIconIcon Icon

Dynamic features

IconIcon

License

 Copyright 2021 Yahor Urbanovich

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

lady-happy-android's People

Contributors

dependabot-preview[bot] avatar egorikftp avatar malligan avatar maximsemashko avatar urbanovichem 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

lady-happy-android's Issues

Request Dynamic feature access

Using this issue you can request demo access to the following Dynamic features:

  • Edit info screen

Icon

  • Publish new data screen

Icon

26.08.21 Load config from firebase

26.08.21 Load config from firebase


import com.egoriku.ladyhappy.postcreator.domain.predefined.PredefinedData
import com.egoriku.ladyhappy.postcreator.domain.usecase.PublishPostUseCase
import com.egoriku.ladyhappy.postcreator.domain.usecase.UploadImagesUseCase
import com.egoriku.ladyhappy.postcreator.presentation.state.DialogEvent
import com.egoriku.ladyhappy.postcreator.presentation.state.Effect
import com.egoriku.ladyhappy.postcreator.presentation.state.PostState
import com.egoriku.ladyhappy.postcreator.presentation.state.ScreenState
import com.egoriku.ladyhappy.postcreator.presentation.state.ScreenState.Uploading.Stage
import com.google.firebase.Timestamp
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.*

const val MAX_IMAGES_SIZE = 10

class PostViewModel(
    application: Application,
    private val uploadImagesUseCase: UploadImagesUseCase,
    private val publishPostUseCase: PublishPostUseCase,
) : AndroidViewModel(application) {

    private val _uiState = MutableStateFlow<ScreenState>(ScreenState.None)
    val uiState = _uiState.asStateFlow()

    private val _postState = MutableStateFlow(PostState())
    val postState = _postState.asStateFlow()

    private val _publishButtonAvailability = MutableStateFlow(false)
    val publishButtonAvailability = _publishButtonAvailability.asStateFlow()

    private val _dialogEffects = MutableSharedFlow<DialogEvent>()
    val dialogEffects = _dialogEffects.asSharedFlow()

    private val _effects = MutableSharedFlow<Effect>()
    val effects = _effects.asSharedFlow()

    private val _currentPostState
        get() = _postState.value

    private val subCategoryId: Int
        get() = requireNotNull(
            _currentPostState.chooserState
                .filterIsInstance<ChooserType.SubCategory>()
                .firstOrNull()
                ?.categoryId
        )

    init {
        viewModelScope.launch {
            _uiState.emit(ScreenState.Loading)
            // TODO: 26.08.21 Load config from firebase
            _uiState.emit(ScreenState.CreatePost)
        }
    }

    fun processEffect(effect: Effect) {
        viewModelScope.launch {
            _effects.emit(effect)
        }
    }

    fun openDialog(type: ChooserType) {
        val dialogEvent = when (type) {
            is ChooserType.Category -> DialogEvent.Category(
                data = PredefinedData.getCategoriesNames()
            )
            is ChooserType.SubCategory -> DialogEvent.SubCategory(
                data = PredefinedData.getSubCategoriesNames(subCategoryId)
            )
            is ChooserType.Color -> DialogEvent.Color
            is ChooserType.CreationDate -> DialogEvent.Date
        }

        viewModelScope.launch {
            _dialogEffects.emit(dialogEvent)
        }
    }

    fun processImageResult(list: List<Uri>) {
        val images = _currentPostState.imagesSection.images
        val newImages = list.map { ImageItem(uri = it) }

        _postState.value = _currentPostState.copy(
            imagesSection = ImageSection(images + newImages)
        )


1871318460819d14f96bf237fd5a6a6b44598b8e

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.