Skip to content

Commit

Permalink
created the project - add activities and fragments - added room and r…
Browse files Browse the repository at this point in the history
…epo class - set up the interactions between activites and frgaments
  • Loading branch information
medyas committed Oct 5, 2018
0 parents commit c0c639e
Show file tree
Hide file tree
Showing 89 changed files with 3,677 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.iml
.gradle
/local.properties
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild
52 changes: 52 additions & 0 deletions .idea/assetWizardSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
59 changes: 59 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "ml.medyas.bakingapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

// Room components
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"

// Lifecycle components
implementation "android.arch.lifecycle:extensions:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"

implementation 'com.google.android.exoplayer:exoplayer:2.8.4'

implementation 'com.squareup.picasso:picasso:2.71828'

implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

implementation 'com.google.code.gson:gson:2.8.5'

implementation 'com.github.kittinunf.fuel:fuel:1.15.0' //for JVM
implementation 'com.github.kittinunf.fuel:fuel-android:1.15.0' //for Android

implementation 'com.github.florent37:shapeofview:1.3.2'
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package ml.medyas.bakingapp;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("ml.medyas.bakingapp", appContext.getPackageName());
}
}
38 changes: 38 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="ml.medyas.bakingapp">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppNoActionBarTheme"
tools:ignore="GoogleAppIndexingWarning">

<activity android:name=".Activities.RecipeActivity" >

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".Activities.RecipeDetailActivity"
android:parentActivityName=".Activities.RecipeActivity"/>

<activity android:name=".Activities.RecipeDetailViewActivity"
android:parentActivityName=".Activities.RecipeDetailActivity"/>

<activity android:name=".Activities.SettingsActivity" />

<activity android:name=".Activities.AboutActivity"></activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package ml.medyas.bakingapp.Activities;

import android.content.Intent;
import android.os.Build;
import android.support.design.button.MaterialButton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.animation.AccelerateDecelerateInterpolator;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import ml.medyas.bakingapp.Classes.NavigationIconClickListener;
import ml.medyas.bakingapp.R;

import static ml.medyas.bakingapp.Classes.UtilsClass.getNavigationIconView;

public class AboutActivity extends AppCompatActivity {
@BindView(R.id.toolbar) Toolbar toolbar;

NavigationIconClickListener nav;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
ButterKnife.bind(this);

setSupportActionBar(toolbar);
getSupportActionBar().setTitle("About");
nav = new NavigationIconClickListener(this,
findViewById(R.id.product_grid),
new AccelerateDecelerateInterpolator(),
getResources().getDrawable(R.drawable.ic_menu_black_24dp),
getResources().getDrawable(R.drawable.ic_close_black_24dp));
toolbar.setNavigationOnClickListener(nav);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
findViewById(R.id.product_grid).setBackground(getDrawable(R.drawable.background_shape));
}
}

@OnClick({R.id.nav_recipe_activity, R.id.nav_settings_activity, R.id.nav_about_activity})
public void navMenuClicked(MaterialButton btn) {
int id = btn.getId();
switch (id) {
case R.id.nav_recipe_activity:
startActivity(new Intent(getApplicationContext(), RecipeActivity.class));
break;
case R.id.nav_settings_activity:
startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
break;
case R.id.nav_about_activity:
startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
break;
default:
return;
}
}
}
Loading

0 comments on commit c0c639e

Please sign in to comment.