Skip to content

Commit 8f76fd7

Browse files
Merge pull request #1 from UdacityAndroidBasicsScholarship/master
update from original.
2 parents 612a461 + 2b98cea commit 8f76fd7

39 files changed

+882
-30
lines changed
535 Bytes
Binary file not shown.

.idea/codeStyles/Project.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

100755100644
File mode changed.

.idea/misc.xml

100755100644
Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

100755100644
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

100755100644
File mode changed.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# daily-goals
2+
This application is a collaborative project made by the Google Udacity Android Basics Scholars.
3+
4+
# Project Name: Daily Goals App
5+
6+
## Idea:
7+
8+
Daily goals app. An app that reminds you of your daily goals set. It will showcase our performance in the form of pie chart. It will have database(say using Room)
9+
to store performance.
10+
The app will be like an assistant which will guide you throughout your life.
11+
It will manage your day. It will manage how you spend your time. It will manage your relations and connections. Eg. It will give you optimized suggestions to spend that time effectively by considering how you spend your time, the app will build your schedule and will tell you accordingly. The app will use machine learning.

app/build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
12
apply plugin: 'com.android.application'
23

34
android {
4-
compileSdkVersion 26
5+
compileSdkVersion 27
56
defaultConfig {
67
applicationId "com.example.dhananjay.dailygoals"
7-
minSdkVersion 15
8-
targetSdkVersion 26
8+
minSdkVersion 21
9+
targetSdkVersion 27
910
versionCode 1
1011
versionName "1.0"
1112
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -20,9 +21,13 @@ android {
2021

2122
dependencies {
2223
implementation fileTree(dir: 'libs', include: ['*.jar'])
23-
implementation 'com.android.support:appcompat-v7:26.1.0'
24-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
24+
implementation 'com.android.support:appcompat-v7:27.1.1'
25+
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
2526
testImplementation 'junit:junit:4.12'
26-
androidTestImplementation 'com.android.support.test:runner:0.5'
27-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
27+
androidTestImplementation 'com.android.support.test:runner:1.0.1'
28+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
29+
implementation 'com.android.support:cardview-v7:27.1.1'
30+
implementation 'com.android.support:design:27.1.1'
31+
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
32+
implementation 'com.android.support:recyclerview-v7:27.1.1'
2833
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
package com.example.dhananjay.dailygoals;
2+
3+
import android.content.Context;
4+
import android.support.annotation.NonNull;
5+
import android.support.design.widget.BottomNavigationView;
6+
import android.support.design.widget.CoordinatorLayout;
7+
import android.support.v4.view.ViewCompat;
8+
import android.util.AttributeSet;
9+
import android.util.Log;
10+
import android.view.View;
11+
12+
import static java.lang.Math.max;
13+
import static java.lang.Math.min;
14+
15+
16+
public class BottomNavigationBehavior extends CoordinatorLayout.Behavior<BottomNavigationView> {
17+
18+
/**
19+
* Default constructor for instantiating the behavior
20+
*/
21+
public BottomNavigationBehavior() {
22+
super();
23+
}
24+
25+
/**
26+
* Default constructor for inflating behaviors from the layout
27+
*
28+
* @param context
29+
* @param attrs
30+
*/
31+
32+
public BottomNavigationBehavior(Context context, AttributeSet attrs) {
33+
super(context, attrs);
34+
}
35+
36+
37+
/**
38+
* @param coordinatorLayout the CoordinatorLayout with which the behavior is associated
39+
* @param child the child view of the CoordinatorLayout this behavior is associated with
40+
* @param directTargetChild the child view of the CoordinatorLayout that either is or contains the view that is the target of nested
41+
* scrolling operation
42+
* @param target the descendant of the CoordinatorLayout initiating the scroll operation
43+
* @param axes the axis of scrolling - horizontal or vertical
44+
* @param type type of input event that caused the scrolling
45+
* @return true if behavior wishes to accept this nested scroll
46+
*/
47+
@Override
48+
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull BottomNavigationView child, @NonNull View directTargetChild, @NonNull View target, int axes, int type) {
49+
Log.v("Tag", target.getClass().toString());
50+
return axes == ViewCompat.SCROLL_AXIS_VERTICAL;
51+
}
52+
53+
54+
/**
55+
* @param coordinatorLayout
56+
* @param child
57+
* @param target
58+
* @param dx the horizontal number of pixels that the user attempted to scroll
59+
* @param dy the vertical number of pixels that the user attempted to scroll
60+
* @param consumed an integer array where consumed[0] should be set to dx , consumer[1] should be set
61+
* to dy
62+
* @param type
63+
*/
64+
@Override
65+
public void onNestedPreScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull BottomNavigationView child, @NonNull View target, int dx, int dy, @NonNull int[] consumed, int type) {
66+
super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type);
67+
child.setTranslationY(max(0f, min(((float) child.getHeight()), child.getTranslationY() + dy)));
68+
}
69+
70+
}

0 commit comments

Comments
 (0)