Skip to content

Commit

Permalink
Prepping for next release...
Browse files Browse the repository at this point in the history
  • Loading branch information
bapspatil committed Jul 24, 2018
1 parent fe308a3 commit bb8db09
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 78 deletions.
51 changes: 44 additions & 7 deletions README.md
@@ -1,9 +1,46 @@

# CaptainChef
A Material-design baking/cooking recipes app (Project 3: Baking App)
<br/><br/>

A Material design baking/cooking recipes app.

<a href='https://play.google.com/store/apps/details?id=bapspatil.captainchef&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' width="30%" height="30%"/></a>
<br/><br/>
<img src="https://github.com/bapspatil/CaptainChef/blob/master/screenshots/screen0.png"> <img src="https://github.com/bapspatil/CaptainChef/blob/master/screenshots/screen1.png">
<img src="https://github.com/bapspatil/CaptainChef/blob/master/screenshots/screen2.png"> <img src="https://github.com/bapspatil/CaptainChef/blob/master/screenshots/screen3.png">
<img src="https://github.com/bapspatil/CaptainChef/blob/master/screenshots/screen4.png">
<br/><br/>

## Screenshots

<img src="./design/screen0.png">&ensp;<img src="./design/screen1.png">
<img src="./design/screen2.png">&ensp;<img src="./design/screen3.png">
<img src="./design/screen4.png">

## Libraries Used

* [Android Support Library](https://developer.android.com/topic/libraries/support-library/)
* [Anko](https://github.com/Kotlin/anko/)
* [Retrofit](https://github.com/square/retrofit/)
* [Glide](https://github.com/bumptech/glide/)
* [Gson](https://github.com/google/gson/)
* [Toasty](https://github.com/GrenderG/Toasty/)
* [ExoPlayer](https://github.com/google/ExoPlayer/)

## Developed By

Bapusaheb Patil

<img src="https://github.com/bapspatil.png" width="20%">

https://bapspatil.com

## License

Copyright 2018 Bapusaheb Patil

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.
25 changes: 11 additions & 14 deletions app/build.gradle
Expand Up @@ -5,13 +5,13 @@ apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
buildToolsVersion "28.0.1"
defaultConfig {
applicationId "bapspatil.captainchef"
minSdkVersion 21
targetSdkVersion 27
versionCode 2
versionName "1.1"
versionCode 3
versionName "1.2"
}
buildTypes {
release {
Expand All @@ -36,14 +36,13 @@ androidExtensions {
}

ext {
ankoVersion = '0.10.4'
support = '27.1.0'
glideVersion = '4.6.1'
butterknifeVersion = '8.8.1'
exoplayerVersion = '2.7.2'
toastyVersion = '1.2.8'
ankoVersion = '0.10.5'
support = '27.1.1'
glideVersion = '4.7.1'
exoplayerVersion = '2.8.2'
toastyVersion = '1.3.0'
retrofitVer = '2.4.0'
gsonVer = '2.8.2'
gsonVer = '2.8.5'
}

dependencies {
Expand All @@ -52,7 +51,7 @@ dependencies {
implementation "org.jetbrains.anko:anko:$ankoVersion"
implementation "org.jetbrains.anko:anko-design:$ankoVersion"

// Android Support
// Android Support Library
implementation "com.android.support:appcompat-v7:$support"
implementation "com.android.support:support-v4:$support"
implementation "com.android.support:support-v13:$support"
Expand All @@ -62,11 +61,9 @@ dependencies {
implementation "com.android.support:recyclerview-v7:$support"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

// App
// App dependencies
implementation "com.github.bumptech.glide:glide:$glideVersion"
kapt "com.github.bumptech.glide:compiler:$glideVersion"
implementation "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
implementation "com.google.android.exoplayer:exoplayer:$exoplayerVersion"
implementation "com.github.GrenderG:Toasty:$toastyVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitVer"
Expand Down
Expand Up @@ -26,9 +26,9 @@ class FoodItemsActivity : AppCompatActivity(), FoodItemsRecyclerViewAdapter.OnFo
private var mAdapter: FoodItemsRecyclerViewAdapter? = null

@BindView(R.id.food_items_rv)
internal var mFoodItemsRecyclerView: RecyclerView? = null
var mFoodItemsRecyclerView: RecyclerView? = null
@BindView(R.id.toolbar)
internal var toolbar: Toolbar? = null
var toolbar: Toolbar? = null

private val isPhone: Boolean
get() {
Expand Down
13 changes: 6 additions & 7 deletions app/src/main/java/bapspatil/captainchef/ui/RecipeActivity.kt
Expand Up @@ -23,9 +23,9 @@ class RecipeActivity : AppCompatActivity(), StepsListFragment.OnStepClickListene
private lateinit var fragmentManager: FragmentManager
private var mTwoPane: Boolean = false
@BindView(R.id.toolbar)
internal var toolbar: Toolbar? = null
var toolbar: Toolbar? = null
@BindView(R.id.recipe_toolbar_tv)
internal var recipeToolbarTextView: TextView? = null
var recipeToolbarTextView: TextView? = null

private val isPhone: Boolean
get() {
Expand All @@ -51,7 +51,7 @@ class RecipeActivity : AppCompatActivity(), StepsListFragment.OnStepClickListene
if (isPhone) {
mTwoPane = false
if (savedInstanceState == null) {
val stepsListFragment = StepsListFragment.newInstance(ingredientsList, recipeStepsList, foodItemName)
val stepsListFragment = StepsListFragment.newInstance(ingredientsList!!, recipeStepsList!!, foodItemName!!)
fragmentManager.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
.replace(R.id.recipe_container, stepsListFragment)
Expand All @@ -61,7 +61,7 @@ class RecipeActivity : AppCompatActivity(), StepsListFragment.OnStepClickListene
} else {
mTwoPane = true
if (savedInstanceState == null) {
val stepsListFragment = StepsListFragment.newInstance(ingredientsList, recipeStepsList, foodItemName)
val stepsListFragment = StepsListFragment.newInstance(ingredientsList!!, recipeStepsList!!, foodItemName!!)
fragmentManager.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
.replace(R.id.recipe_container, stepsListFragment)
Expand All @@ -78,7 +78,7 @@ class RecipeActivity : AppCompatActivity(), StepsListFragment.OnStepClickListene
val options = ActivityOptions.makeCustomAnimation(applicationContext, android.R.anim.fade_in, android.R.anim.fade_out)
startActivity(startRecipeDetailsActivity, options.toBundle())
} else {
val stepsDetailsFragment = StepsDetailsFragment.newInstance(mRecipeStep, recipeStepsList)
val stepsDetailsFragment = StepsDetailsFragment.newInstance(mRecipeStep, recipeStepsList!!)
fragmentManager = supportFragmentManager
fragmentManager.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
Expand All @@ -92,8 +92,7 @@ class RecipeActivity : AppCompatActivity(), StepsListFragment.OnStepClickListene
this@RecipeActivity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
}

override fun onButtonClicked(buttonClicked: Int, recipeStep: RecipeStep, recipeSteps: ArrayList<RecipeStep>, view: View) {
override fun onButtonClicked(buttonClicked: Int, recipeStep: RecipeStep?, recipeSteps: ArrayList<RecipeStep>?, view: View) {

}

}
Expand Up @@ -27,7 +27,7 @@ class RecipeDetailsActivity : AppCompatActivity(), StepsDetailsFragment.OnButton
mRecipeStepsList = intent.getParcelableArrayListExtra("recipeList")
fragmentManager = supportFragmentManager
if (savedInstanceState == null) {
val stepsDetailsFragment = StepsDetailsFragment.newInstance(mRecipeStep, mRecipeStepsList)
val stepsDetailsFragment = StepsDetailsFragment.newInstance(mRecipeStep!!, mRecipeStepsList!!)
fragmentManager!!.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
.replace(R.id.recipe_details_container, stepsDetailsFragment)
Expand All @@ -47,22 +47,22 @@ class RecipeDetailsActivity : AppCompatActivity(), StepsDetailsFragment.OnButton
}
}

override fun onButtonClicked(buttonClicked: Int, recipeStep: RecipeStep, recipeSteps: ArrayList<RecipeStep>, view: View) {
override fun onButtonClicked(buttonClicked: Int, recipeStep: RecipeStep?, recipeSteps: ArrayList<RecipeStep>?, view: View) {
if (buttonClicked == StepsDetailsFragment.PREV_BUTTON) {
var id = recipeStep.stepId
var id = recipeStep!!.stepId
id--
val prevRecipeStep = recipeSteps[id]
val stepsDetailsFragment = StepsDetailsFragment.newInstance(prevRecipeStep, mRecipeStepsList)
val prevRecipeStep = recipeSteps!![id]
val stepsDetailsFragment = StepsDetailsFragment.newInstance(prevRecipeStep, mRecipeStepsList!!)
fragmentManager = supportFragmentManager
fragmentManager!!.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
.replace(R.id.recipe_details_container, stepsDetailsFragment)
.commit()
} else {
var id = recipeStep.stepId
var id = recipeStep!!.stepId
id++
val nextRecipeStep = recipeSteps[id]
val stepsDetailsFragment = StepsDetailsFragment.newInstance(nextRecipeStep, mRecipeStepsList)
val nextRecipeStep = recipeSteps!![id]
val stepsDetailsFragment = StepsDetailsFragment.newInstance(nextRecipeStep, mRecipeStepsList!!)
fragmentManager = supportFragmentManager
fragmentManager!!.beginTransaction()
.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
Expand Down
Expand Up @@ -36,17 +36,17 @@ import java.util.*
*/
class StepsDetailsFragment : Fragment() {
@BindView(R.id.step_description_tv)
internal var mStepDescription: TextView? = null
var mStepDescription: TextView? = null
@BindView(R.id.video_exoplayer_view)
internal var mPlayerView: SimpleExoPlayerView? = null
var mPlayerView: SimpleExoPlayerView? = null
@BindView(R.id.next_button)
internal var nextButton: Button? = null
var nextButton: Button? = null
@BindView(R.id.prev_button)
internal var prevButton: Button? = null
var prevButton: Button? = null
@BindView(R.id.next_card_view)
internal var nextCardView: CardView? = null
var nextCardView: CardView? = null
@BindView(R.id.prev_card_view)
internal var prevCardView: CardView? = null
var prevCardView: CardView? = null
private var mPlayer: SimpleExoPlayer? = null
private var unbinder: Unbinder? = null
private var recipeStep: RecipeStep? = null
Expand Down
20 changes: 6 additions & 14 deletions app/src/main/java/bapspatil/captainchef/ui/StepsListFragment.kt
Expand Up @@ -3,37 +3,29 @@ package bapspatil.captainchef.ui
import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.CardView
import android.support.v7.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import bapspatil.captainchef.R
import bapspatil.captainchef.adapters.IngredientsRecyclerViewAdapter
import bapspatil.captainchef.adapters.MyRecyclerView
import bapspatil.captainchef.adapters.StepsListRecyclerViewAdapter
import bapspatil.captainchef.model.Ingredient
import bapspatil.captainchef.model.RecipeStep
import bapspatil.captainchef.sync.UpdateRecipeService
import butterknife.BindView
import butterknife.ButterKnife
import butterknife.OnClick
import butterknife.Unbinder
import es.dmoral.toasty.Toasty
import kotlinx.android.synthetic.main.fragment_steps_list.*
import java.util.*


/**
* Created by bapspatil
*/
class StepsListFragment : Fragment(), StepsListRecyclerViewAdapter.OnRecipeStepClickedListener {
// private OnStepClickListener mListener;
@BindView(R.id.ingredients_rv)
internal var mIngredientsRecyclerView: MyRecyclerView? = null
@BindView(R.id.steps_rv)
internal var mStepsRecyclerView: MyRecyclerView? = null
@BindView(R.id.add_to_widget_button)
internal var addToWidgetButton: CardView? = null

private var ingredientsList: ArrayList<Ingredient>? = null
private var mIngredientsAdapter: IngredientsRecyclerViewAdapter? = null
private var recipeStepsList: ArrayList<RecipeStep>? = null
Expand Down Expand Up @@ -67,12 +59,12 @@ class StepsListFragment : Fragment(), StepsListRecyclerViewAdapter.OnRecipeStepC
mIngredientsAdapter = IngredientsRecyclerViewAdapter(context!!, ingredientsList!!)
mStepsListAdapter = StepsListRecyclerViewAdapter(context!!, recipeStepsList!!, this)

mIngredientsRecyclerView!!.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
ingredients_rv!!.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
val linearLayoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
mStepsRecyclerView!!.layoutManager = linearLayoutManager
steps_rv!!.layoutManager = linearLayoutManager

mIngredientsRecyclerView!!.adapter = mIngredientsAdapter!!
mStepsRecyclerView!!.adapter = mStepsListAdapter!!
ingredients_rv!!.adapter = mIngredientsAdapter!!
steps_rv!!.adapter = mStepsListAdapter!!
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
@@ -1,15 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlinVer = '1.2.31'
ext.kotlinVer = '1.2.51'
repositories {
jcenter()
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVer"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
26 changes: 9 additions & 17 deletions gradle.properties
@@ -1,18 +1,10 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
# Enable Gradle Daemon
org.gradle.daemon=true
# Enable parallel builds
org.gradle.parallel=true
# Enable Build Cache
android.enableBuildCache=true
# Enable simple gradle caching
org.gradle.caching=true
# Increase memory allotted to JVM
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

0 comments on commit bb8db09

Please sign in to comment.