├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── misc.xml
└── runConfigurations.xml
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── rajendra
│ │ └── courseapp
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── rajendra
│ │ │ └── courseapp
│ │ │ ├── CoursePage.java
│ │ │ ├── MainActivity.java
│ │ │ ├── adapter
│ │ │ ├── CategoryAdapter.java
│ │ │ └── CourseAdapter.java
│ │ │ ├── model
│ │ │ ├── Category.java
│ │ │ ├── Course.java
│ │ │ └── PlayList.java
│ │ │ └── retrofit
│ │ │ ├── ApiInterface.java
│ │ │ └── RetrofitClient.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── business.png
│ │ ├── buy_button_bg.xml
│ │ ├── buy_layout_bg.xml
│ │ ├── ic_arrow_left.xml
│ │ ├── ic_bestseller.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_menu.xml
│ │ ├── ic_more_vertical.xml
│ │ ├── ic_person.xml
│ │ ├── ic_play_circle.xml
│ │ ├── ic_search.xml
│ │ ├── ic_shopping_bag.xml
│ │ ├── ic_star.xml
│ │ ├── layout_bg.xml
│ │ ├── search_bg.xml
│ │ ├── user.png
│ │ └── ux_big.png
│ │ ├── font
│ │ ├── nunito.xml
│ │ ├── nunito_bold.xml
│ │ └── nunito_semibold.xml
│ │ ├── layout
│ │ ├── activity_course_page.xml
│ │ ├── activity_main.xml
│ │ ├── category_row_items.xml
│ │ └── course_list_row_items.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── font_certs.xml
│ │ ├── preloaded_fonts.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── rajendra
│ └── courseapp
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
19 |
20 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.rajendra.courseapp"
9 | minSdkVersion 21
10 | targetSdkVersion 29
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 |
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 |
29 | implementation 'androidx.appcompat:appcompat:1.1.0'
30 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
31 | testImplementation 'junit:junit:4.12'
32 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
33 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
34 | implementation 'androidx.recyclerview:recyclerview:1.1.0'
35 |
36 | // Retrofit dependencies
37 | implementation 'com.squareup.retrofit2:retrofit:2.4.0'
38 | implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
39 |
40 |
41 | // glide image dependency
42 | implementation 'com.github.bumptech.glide:glide:4.11.0'
43 | annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
44 | implementation 'androidx.cardview:cardview:1.0.0'
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/rajendra/courseapp/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("com.rajendra.courseapp", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/CoursePage.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.recyclerview.widget.LinearLayoutManager;
5 | import androidx.recyclerview.widget.RecyclerView;
6 |
7 | import android.os.Bundle;
8 | import android.widget.TextView;
9 | import android.widget.Toast;
10 |
11 | import com.rajendra.courseapp.adapter.CourseAdapter;
12 | import com.rajendra.courseapp.model.Category;
13 | import com.rajendra.courseapp.model.Course;
14 | import com.rajendra.courseapp.model.PlayList;
15 | import com.rajendra.courseapp.retrofit.ApiInterface;
16 | import com.rajendra.courseapp.retrofit.RetrofitClient;
17 |
18 | import java.util.List;
19 |
20 | import retrofit2.Call;
21 | import retrofit2.Callback;
22 | import retrofit2.Response;
23 |
24 | public class CoursePage extends AppCompatActivity {
25 |
26 | RecyclerView courseRecyclerView;
27 | ApiInterface apiInterface;
28 | CourseAdapter courseAdapter;
29 |
30 | TextView member, rating, name, price;
31 |
32 |
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 |
38 |
39 |
40 | setContentView(R.layout.activity_course_page);
41 |
42 | member = findViewById(R.id.members);
43 | rating = findViewById(R.id.rating);
44 | name = findViewById(R.id.name);
45 | price = findViewById(R.id.price);
46 |
47 | apiInterface = RetrofitClient.getRetrofitClient().create(ApiInterface.class);
48 |
49 | courseRecyclerView = findViewById(R.id.course_recycler);
50 |
51 | Call> call = apiInterface.getCourseContent();
52 |
53 | call.enqueue(new Callback>() {
54 | @Override
55 | public void onResponse(Call> call, Response> response) {
56 |
57 | List courseList = response.body();
58 |
59 | getCourseContent(courseList.get(0).getPlayList());
60 | //lets run it
61 |
62 |
63 | member.setText(courseList.get(0).getMember());
64 | rating.setText(courseList.get(0).getRating());
65 | name.setText(courseList.get(0).getCourseName());
66 | price.setText("₹ "+courseList.get(0).getPrice());
67 |
68 | }
69 |
70 | @Override
71 | public void onFailure(Call> call, Throwable t) {
72 | Toast.makeText(CoursePage.this, "No response from server", Toast.LENGTH_SHORT).show();
73 | }
74 | });
75 |
76 | }
77 |
78 | private void getCourseContent(List playLists){
79 |
80 | RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
81 | courseRecyclerView.setLayoutManager(layoutManager);
82 | courseAdapter = new CourseAdapter(this, playLists);
83 | courseRecyclerView.setAdapter(courseAdapter);
84 | courseAdapter.notifyDataSetChanged();
85 |
86 |
87 |
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 | import androidx.recyclerview.widget.RecyclerView;
5 | import androidx.recyclerview.widget.StaggeredGridLayoutManager;
6 |
7 | import android.os.Bundle;
8 | import android.widget.Toast;
9 |
10 | import com.rajendra.courseapp.adapter.CategoryAdapter;
11 | import com.rajendra.courseapp.model.Category;
12 | import com.rajendra.courseapp.retrofit.ApiInterface;
13 | import com.rajendra.courseapp.retrofit.RetrofitClient;
14 |
15 | import java.util.List;
16 |
17 | import retrofit2.Call;
18 | import retrofit2.Callback;
19 | import retrofit2.Response;
20 | import retrofit2.Retrofit;
21 |
22 | public class MainActivity extends AppCompatActivity {
23 |
24 | RecyclerView categoryRecyclerView;
25 | CategoryAdapter categoryAdapter;
26 |
27 | ApiInterface apiInterface;
28 |
29 | @Override
30 | protected void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 |
33 |
34 | setContentView(R.layout.activity_main);
35 |
36 | apiInterface = RetrofitClient.getRetrofitClient().create(ApiInterface.class);
37 |
38 | categoryRecyclerView = findViewById(R.id.course_recycler);
39 |
40 | Call> call = apiInterface.getAllCategory();
41 |
42 | call.enqueue(new Callback>() {
43 | @Override
44 | public void onResponse(Call> call, Response> response) {
45 |
46 | List categoryList = response.body();
47 |
48 | getAllCategory(categoryList);
49 |
50 | //lets run it
51 | }
52 |
53 | @Override
54 | public void onFailure(Call> call, Throwable t) {
55 | Toast.makeText(MainActivity.this, "No response from server", Toast.LENGTH_SHORT).show();
56 | }
57 | });
58 |
59 | //lets run this app and check server is responding or not.
60 | // we have successfully fetched data from api.
61 | // now we will setup this json response to recyclerview.
62 |
63 |
64 | }
65 |
66 |
67 | // welcome to all of you.
68 | // first of all i am goinf to import some assets
69 |
70 | // now we will setup Retrofit for network call fetching data from server.
71 | // lets import retrofit dependency
72 |
73 | private void getAllCategory(List categoryList){
74 |
75 | RecyclerView.LayoutManager layoutManager = new StaggeredGridLayoutManager(2, 1);
76 | categoryRecyclerView.setLayoutManager(layoutManager);
77 | categoryAdapter = new CategoryAdapter(this, categoryList);
78 | categoryRecyclerView.setAdapter(categoryAdapter);
79 | categoryAdapter.notifyDataSetChanged();
80 |
81 | }
82 |
83 | // now again we need to create a model class for data and adapter class for recycler view
84 | // lest have a look on json data
85 | // this data comming from server having course content details
86 | // lets do it fast.
87 |
88 | // tutorial has benn complited see you the next tutorial.
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/adapter/CategoryAdapter.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp.adapter;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.recyclerview.widget.RecyclerView;
13 |
14 | import com.bumptech.glide.Glide;
15 | import com.rajendra.courseapp.CoursePage;
16 | import com.rajendra.courseapp.MainActivity;
17 | import com.rajendra.courseapp.R;
18 | import com.rajendra.courseapp.model.Category;
19 |
20 | import java.util.List;
21 |
22 | public class CategoryAdapter extends RecyclerView.Adapter {
23 |
24 | private Context context;
25 | List categoryList;
26 |
27 | public CategoryAdapter(Context context, List categoryList) {
28 | this.context = context;
29 | this.categoryList = categoryList;
30 | }
31 |
32 | @NonNull
33 | @Override
34 | public CategoryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
35 | View view = LayoutInflater.from(context).inflate(R.layout.category_row_items, parent, false);
36 |
37 |
38 | // now here we create a recyclerview row items.
39 | return new CategoryViewHolder(view);
40 | }
41 |
42 | @Override
43 | public void onBindViewHolder(@NonNull CategoryViewHolder holder, int position) {
44 |
45 | // here we will bind data in recyclerview ro items.
46 |
47 | holder.categoryName.setText(categoryList.get(position).getCategoryName());
48 | holder.totalCategory.setText(categoryList.get(position).getTotalCourses());
49 |
50 | // for image we need to add glide image fetching library from netwok
51 |
52 | Glide.with(context).load(categoryList.get(position).getImage()).into(holder.categoryImage);
53 |
54 | holder.itemView.setOnClickListener(new View.OnClickListener() {
55 | @Override
56 | public void onClick(View view) {
57 |
58 | Intent i = new Intent(context, CoursePage.class);
59 | context.startActivity(i);
60 |
61 | }
62 | });
63 |
64 | }
65 |
66 | @Override
67 | public int getItemCount() {
68 | return categoryList.size();
69 | }
70 |
71 | public static class CategoryViewHolder extends RecyclerView.ViewHolder{
72 |
73 | ImageView categoryImage;
74 | TextView categoryName, totalCategory;
75 |
76 | public CategoryViewHolder(@NonNull View itemView) {
77 | super(itemView);
78 |
79 | categoryImage = itemView.findViewById(R.id.course);
80 | categoryName = itemView.findViewById(R.id.course_name);
81 | totalCategory = itemView.findViewById(R.id.total_course);
82 |
83 |
84 | }
85 | }
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/adapter/CourseAdapter.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 | import android.widget.Toast;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import com.rajendra.courseapp.R;
14 | import com.rajendra.courseapp.model.PlayList;
15 |
16 | import java.util.List;
17 |
18 | public class CourseAdapter extends RecyclerView.Adapter {
19 |
20 | Context context;
21 | List playLists;
22 |
23 | public CourseAdapter(Context context, List playLists) {
24 | this.context = context;
25 | this.playLists = playLists;
26 | }
27 |
28 | @NonNull
29 | @Override
30 | public CourseViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
31 | View view = LayoutInflater.from(context).inflate(R.layout.course_list_row_items, parent, false);
32 |
33 | return new CourseViewHolder(view);
34 | }
35 |
36 | @Override
37 | public void onBindViewHolder(@NonNull CourseViewHolder holder, int position) {
38 |
39 | int i=position+1;
40 | holder.contentNumber.setText("0"+i);
41 | holder.contentTime.setText(playLists.get(position).getTime());
42 | holder.contentName.setText(playLists.get(position).getName());
43 |
44 | }
45 |
46 | @Override
47 | public int getItemCount() {
48 | return playLists.size();
49 | }
50 |
51 |
52 | public static class CourseViewHolder extends RecyclerView.ViewHolder{
53 |
54 |
55 | TextView contentNumber, contentTime, contentName;
56 |
57 | public CourseViewHolder(@NonNull View itemView) {
58 | super(itemView);
59 |
60 | contentName = itemView.findViewById(R.id.content_title);
61 | contentTime = itemView.findViewById(R.id.content_time);
62 | contentNumber = itemView.findViewById(R.id.content_number);
63 |
64 | }
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/model/Category.java:
--------------------------------------------------------------------------------
1 |
2 | package com.rajendra.courseapp.model;
3 |
4 | import com.google.gson.annotations.Expose;
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | public class Category {
8 |
9 | @SerializedName("categoryId")
10 | @Expose
11 | private String categoryId;
12 | @SerializedName("categoryName")
13 | @Expose
14 | private String categoryName;
15 | @SerializedName("totalCourses")
16 | @Expose
17 | private String totalCourses;
18 | @SerializedName("image")
19 | @Expose
20 | private String image;
21 |
22 | public String getCategoryId() {
23 | return categoryId;
24 | }
25 |
26 | public void setCategoryId(String categoryId) {
27 | this.categoryId = categoryId;
28 | }
29 |
30 | public String getCategoryName() {
31 | return categoryName;
32 | }
33 |
34 | public void setCategoryName(String categoryName) {
35 | this.categoryName = categoryName;
36 | }
37 |
38 | public String getTotalCourses() {
39 | return totalCourses;
40 | }
41 |
42 | public void setTotalCourses(String totalCourses) {
43 | this.totalCourses = totalCourses;
44 | }
45 |
46 | public String getImage() {
47 | return image;
48 | }
49 |
50 | public void setImage(String image) {
51 | this.image = image;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/model/Course.java:
--------------------------------------------------------------------------------
1 |
2 | package com.rajendra.courseapp.model;
3 |
4 | import java.util.List;
5 | import com.google.gson.annotations.Expose;
6 | import com.google.gson.annotations.SerializedName;
7 |
8 | public class Course {
9 |
10 | @SerializedName("courseName")
11 | @Expose
12 | private String courseName;
13 | @SerializedName("rating")
14 | @Expose
15 | private String rating;
16 | @SerializedName("price")
17 | @Expose
18 | private String price;
19 | @SerializedName("bestSeller")
20 | @Expose
21 | private String bestSeller;
22 | @SerializedName("member")
23 | @Expose
24 | private String member;
25 | @SerializedName("playList")
26 | @Expose
27 | private List playList = null;
28 |
29 | public String getCourseName() {
30 | return courseName;
31 | }
32 |
33 | public void setCourseName(String courseName) {
34 | this.courseName = courseName;
35 | }
36 |
37 | public String getRating() {
38 | return rating;
39 | }
40 |
41 | public void setRating(String rating) {
42 | this.rating = rating;
43 | }
44 |
45 | public String getPrice() {
46 | return price;
47 | }
48 |
49 | public void setPrice(String price) {
50 | this.price = price;
51 | }
52 |
53 | public String getBestSeller() {
54 | return bestSeller;
55 | }
56 |
57 | public void setBestSeller(String bestSeller) {
58 | this.bestSeller = bestSeller;
59 | }
60 |
61 | public String getMember() {
62 | return member;
63 | }
64 |
65 | public void setMember(String member) {
66 | this.member = member;
67 | }
68 |
69 | public List getPlayList() {
70 | return playList;
71 | }
72 |
73 | public void setPlayList(List playList) {
74 | this.playList = playList;
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/model/PlayList.java:
--------------------------------------------------------------------------------
1 |
2 | package com.rajendra.courseapp.model;
3 |
4 | import com.google.gson.annotations.Expose;
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | public class PlayList {
8 |
9 | @SerializedName("name")
10 | @Expose
11 | private String name;
12 | @SerializedName("time")
13 | @Expose
14 | private String time;
15 |
16 | public String getName() {
17 | return name;
18 | }
19 |
20 | public void setName(String name) {
21 | this.name = name;
22 | }
23 |
24 | public String getTime() {
25 | return time;
26 | }
27 |
28 | public void setTime(String time) {
29 | this.time = time;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/retrofit/ApiInterface.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp.retrofit;
2 |
3 | import com.rajendra.courseapp.model.Category;
4 | import com.rajendra.courseapp.model.Course;
5 |
6 | import java.util.List;
7 |
8 | import retrofit2.Call;
9 | import retrofit2.http.GET;
10 |
11 | public interface ApiInterface {
12 |
13 | @GET("category.json")
14 | Call> getAllCategory();
15 |
16 | @GET("course.json")
17 | Call> getCourseContent();
18 |
19 | // we need to make model class for our data
20 | // first have a look on json structure.
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/rajendra/courseapp/retrofit/RetrofitClient.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp.retrofit;
2 |
3 | import retrofit2.Retrofit;
4 | import retrofit2.converter.gson.GsonConverterFactory;
5 |
6 | public class RetrofitClient {
7 |
8 | private static Retrofit retrofit;
9 | private static final String BASE_URL = "https://androidappsforyoutube.s3.ap-south-1.amazonaws.com/course_app/";
10 |
11 | public static Retrofit getRetrofitClient(){
12 |
13 | if(retrofit == null){
14 |
15 | retrofit = new Retrofit.Builder()
16 | .baseUrl(BASE_URL)
17 | .addConverterFactory(GsonConverterFactory.create())
18 | .build();
19 | }
20 | return retrofit;
21 |
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/business.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/drawable/business.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/buy_button_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/buy_layout_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_left.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_bestseller.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_more_vertical.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_person.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_play_circle.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_shopping_bag.xml:
--------------------------------------------------------------------------------
1 |
6 |
13 |
20 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_star.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/layout_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/drawable/user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ux_big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/drawable/ux_big.png
--------------------------------------------------------------------------------
/app/src/main/res/font/nunito.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/nunito_bold.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/nunito_semibold.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_course_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
30 |
31 |
40 |
41 |
49 |
50 |
51 |
63 |
64 |
74 |
75 |
82 |
83 |
97 |
98 |
118 |
119 |
120 |
121 |
129 |
130 |
141 |
142 |
150 |
151 |
162 |
163 |
174 |
175 |
184 |
185 |
196 |
197 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
28 |
29 |
41 |
42 |
53 |
54 |
73 |
74 |
86 |
87 |
98 |
99 |
109 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/category_row_items.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
28 |
29 |
41 |
42 |
52 |
53 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/course_list_row_items.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
24 |
25 |
35 |
36 |
48 |
49 |
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #3700B3
5 | #03DAC5
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/font_certs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @array/com_google_android_gms_fonts_certs_dev
5 | - @array/com_google_android_gms_fonts_certs_prod
6 |
7 |
8 | -
9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
10 |
11 |
12 |
13 | -
14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preloaded_fonts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @font/nunito
5 | - @font/nunito_bold
6 | - @font/nunito_semibold
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CourseApp
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/rajendra/courseapp/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.rajendra.courseapp;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.6.0'
12 |
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rbishtdev/CourseApp/0aec6fa0b8d3f5195ccdbb6237f00ec6018513a5/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Apr 23 23:14:59 IST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name='CourseApp'
2 | include ':app'
3 |
--------------------------------------------------------------------------------