Skip to content

Photo App Android Jetpack - Implementation Architecture Component Android Jetpack

Notifications You must be signed in to change notification settings

utsmannn/PhotoPagination

Repository files navigation

Photo App Android Jetpack - Implementation Architecture Component Android Jetpack

Source from Unsplash

This is app single activity and using:

Architecture Component

  • Navigation Component
  • LiveData
  • Paging Library
  • Room
  • Lifecycles
  • WorkManager (under development)

Design Pattern

  • Model-View-ViewModel
  • Builder Pattern

Other libraries

  • RxJava + RxAndroid - link
  • Fast Android Networking - link
  • Glide - link
  • PhotoView - link
  • Material Drawer - link
  • Chrome Custom Tabs - with AndroidX support - link

Navigation Component

Navigation refers to the interactions that allow users to navigate across, into, and back out from the different pieces of content within your app. Android Jetpack's Navigation component helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer. The Navigation component also ensures a consistent and predictable user experience by adhering to an established set of principles. - Google

Basically, navigation components are a new alternative to fragment transactions. So that your application is of good quality with Single Activity. All actions are collected in one xml file and you can simply call the action if needed.

  • main_graph.xml - code

Paging Library

Pagination recyclerview build on DataSource and observing data on viewmodel. Check on code sampe with Rx support

  • DataSource - code
  • SourceFactory - code
  • Observing on ViewModel - code

Room

The Room persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite. -Google. Check my code for sample with Rx support

  • Model - code
  • Dao - code
  • Repository - code
  • Database - code
  • And implementation using Rx on viewmodel - code

Builder Pattern

Builder pattern is great for classes that can have complex initialization. It typically consists of setting values for multiple variables, some of which may be required with the rest being optional. I Using builder pattern for create get random photo when using some action. Check my code.

  • Builder - code
  • You need interface for create listener - code
  • And implementation - code

Tile Support for Nougat

This app support custom tile in quick setting (check image) and action for random photo (when I creating using builder) and setup wallpaper.

  • Sample code tile service - code
Tile Support
screenshot

Widget support

For device under nougat, I provide widget when same feature.

  • Code for widget - code
  • Preference widget in xml - code

Using DownloadManager

This app using download manager default by android and use Broadcast manager for receiving notify complete

  • Download file - code
  • You need register broadcast and delegate intent filter with DownloadManager.ACTION_DOWNLOAD_COMPLETE - code

Material Design

Material design is beauty for app development, I Using Material Drawer Library by agan Mikepenz for build drawer with amazing ui (chek img and code). This app use chip from material library for place history search and tags.

Screenshot

LICENSE

Copyright 2019 Muhammad Utsman. All rights reserved.
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.

Releases

No releases published

Packages

No packages published

Languages