├── LICENSE ├── README.md ├── SampleFoodBlog ├── .gitignore ├── .idea │ ├── caches │ │ ├── build_file_checksums.ser │ │ └── gradle_models.ser │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ ├── Pacifico.ttf │ │ │ └── extravaganzza.ttf │ │ ├── ic_launcher-web.png │ │ ├── java │ │ └── com │ │ │ └── droidclan │ │ │ └── samplefoodblog │ │ │ ├── BlogDetails.java │ │ │ ├── Fragments │ │ │ ├── ActivityFragment.java │ │ │ ├── BookmarksFragment.java │ │ │ ├── HomeFragment.java │ │ │ └── TrendingFragment.java │ │ │ ├── Helper │ │ │ ├── BlogViewHolder.java │ │ │ ├── BookmarksViewHolder.java │ │ │ ├── BottomNavigationViewHelper.java │ │ │ ├── CommentViewHolder.java │ │ │ ├── CustomTypefaceSpan.java │ │ │ ├── PostsViewHolder.java │ │ │ └── TimeFormatter.java │ │ │ ├── LoginActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── Modal │ │ │ ├── Blog.java │ │ │ ├── Bookmarks.java │ │ │ └── Comment.java │ │ │ ├── PostActivity.java │ │ │ ├── ProfileActivity.java │ │ │ ├── RegisterActivity.java │ │ │ ├── SearchActivity.java │ │ │ ├── SettingsActivity.java │ │ │ └── WelcomeScreenActivity.java │ │ └── res │ │ ├── anim │ │ ├── translate_down.xml │ │ ├── translate_up.xml │ │ ├── zoom_in.xml │ │ └── zoom_out.xml │ │ ├── drawable │ │ ├── activity.xml │ │ ├── back.xml │ │ ├── back_btn_two.xml │ │ ├── bell.xml │ │ ├── bookmark.xml │ │ ├── bookmarked.xml │ │ ├── bottom_nav_colorselector.xml │ │ ├── call.xml │ │ ├── close_btn.xml │ │ ├── comment_logo.xml │ │ ├── cursor.xml │ │ ├── delete.xml │ │ ├── edit.xml │ │ ├── edittext_shape_two.xml │ │ ├── edittextshape.xml │ │ ├── facebooklogo.xml │ │ ├── facebooksigninbtn.xml │ │ ├── googlelogo.xml │ │ ├── googlesigninbtn.xml │ │ ├── home.xml │ │ ├── ic_launcher_foreground.xml │ │ ├── ic_shines.xml │ │ ├── liked.xml │ │ ├── loginbutton.xml │ │ ├── loginsignupbg.png │ │ ├── logo.xml │ │ ├── logout_button.xml │ │ ├── logowhite.xml │ │ ├── mail.xml │ │ ├── nameavatar.xml │ │ ├── no_comments.xml │ │ ├── notifications.xml │ │ ├── password.xml │ │ ├── search.xml │ │ ├── send_comment.xml │ │ ├── send_comment_input.xml │ │ ├── share.xml │ │ ├── tick.xml │ │ ├── trending.xml │ │ ├── unliked.xml │ │ ├── views.xml │ │ ├── web.xml │ │ └── welcomescreenbg.png │ │ ├── layout │ │ ├── activity_blog_details.xml │ │ ├── activity_login.xml │ │ ├── activity_main.xml │ │ ├── activity_post.xml │ │ ├── activity_profile.xml │ │ ├── activity_register.xml │ │ ├── activity_search.xml │ │ ├── activity_settings.xml │ │ ├── activity_welcome_screen.xml │ │ ├── blog_row.xml │ │ ├── comment_dialog_layout.xml │ │ ├── comment_layout.xml │ │ ├── contact_dialog_layout.xml │ │ ├── custom_toolbar.xml │ │ ├── fragment_activity.xml │ │ ├── fragment_bookmarks.xml │ │ ├── fragment_home.xml │ │ ├── fragment_trending.xml │ │ ├── post_grid.xml │ │ └── second_toolbar.xml │ │ ├── menu │ │ └── bootm_nav_menu.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 │ │ ├── raw │ │ ├── comment_sound.mp3 │ │ └── like_btn_click.wav │ │ └── values │ │ ├── colors.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle └── ScreenShots ├── Screenshot 1.png ├── Screenshot 2.png ├── Screenshot 3.png ├── Screenshot 4.png ├── Screenshot 5.png └── Screenshot 6.png /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Vishal Roy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sample Food Blog 2 | 3 | A simple blog application, having contents related to Food. I created this app when I was a beginner in android app development. This app is not so perfect, so please avoid mistakes. But still it can be helpful for a beginner, so feel free to fork & use it 😎 4 | 5 | [![](https://img.shields.io/badge/Built%20with-Firebase-brightgreen)](https://firebase.google.com) 6 | 7 | ## Screenshots 8 | 9 | 10 | 11 | 12 | 13 | ## LICENSE 14 | 15 | ``` 16 | Copyright (c) 2018 Vishal Roy 17 | 18 | Permission is hereby granted, free of charge, to any person obtaining a copy 19 | of this software and associated documentation files (the "Software"), to deal 20 | in the Software without restriction, including without limitation the rights 21 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 22 | copies of the Software, and to permit persons to whom the Software is 23 | furnished to do so, subject to the following conditions: 24 | 25 | The above copyright notice and this permission notice shall be included in all 26 | copies or substantial portions of the Software. 27 | 28 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 30 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 31 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 32 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 33 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 34 | SOFTWARE. 35 | ``` 36 | -------------------------------------------------------------------------------- /SampleFoodBlog/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 21 | -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /SampleFoodBlog/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "com.droidclan.samplefoodblog" 7 | minSdkVersion 21 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | multiDexEnabled true 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(dir: 'libs', include: ['*.jar']) 24 | implementation 'com.android.support:appcompat-v7:27.0.2' 25 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 26 | implementation 'com.google.firebase:firebase-core:11.8.0' 27 | implementation 'com.google.firebase:firebase-auth:11.8.0' 28 | implementation 'com.google.android.gms:play-services-auth:11.8.0' 29 | implementation 'com.facebook.android:facebook-login:4.30.0' 30 | implementation 'de.hdodenhof:circleimageview:2.2.0' 31 | implementation 'com.google.firebase:firebase-storage:11.8.0' 32 | implementation 'com.google.firebase:firebase-firestore:11.8.0' 33 | implementation "com.firebaseui:firebase-ui-firestore:3.2.2" 34 | implementation 'com.android.support:design:27.0.2' 35 | implementation 'com.github.bumptech.glide:glide:4.6.1' 36 | implementation 'com.android.support:support-v4:27.0.2' 37 | implementation 'jp.wasabeef:blurry:2.1.1' 38 | testImplementation 'junit:junit:4.12' 39 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 40 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 41 | } 42 | 43 | apply plugin: 'com.google.gms.google-services' 44 | -------------------------------------------------------------------------------- /SampleFoodBlog/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 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 19 | 20 | 24 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 41 | 46 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 62 | 67 | 71 | 76 | 80 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/assets/fonts/Pacifico.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/app/src/main/assets/fonts/Pacifico.ttf -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/assets/fonts/extravaganzza.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/app/src/main/assets/fonts/extravaganzza.ttf -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Fragments/ActivityFragment.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Fragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.Fragment; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | import com.droidclan.samplefoodblog.R; 10 | 11 | 12 | public class ActivityFragment extends Fragment{ 13 | 14 | @Override 15 | public void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | 18 | } 19 | 20 | @Override 21 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 22 | Bundle savedInstanceState) { 23 | return inflater.inflate(R.layout.fragment_activity, container, false); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Fragments/BookmarksFragment.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Fragments; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.CoordinatorLayout; 5 | import android.support.v4.app.Fragment; 6 | import android.support.v7.widget.LinearLayoutManager; 7 | import android.support.v7.widget.RecyclerView; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.RelativeLayout; 12 | 13 | import com.droidclan.samplefoodblog.Helper.BookmarksViewHolder; 14 | import com.droidclan.samplefoodblog.Modal.Bookmarks; 15 | import com.droidclan.samplefoodblog.R; 16 | import com.firebase.ui.firestore.FirestoreRecyclerAdapter; 17 | import com.firebase.ui.firestore.FirestoreRecyclerOptions; 18 | import com.google.firebase.auth.FirebaseAuth; 19 | import com.google.firebase.firestore.FirebaseFirestore; 20 | import com.google.firebase.firestore.Query; 21 | 22 | 23 | public class BookmarksFragment extends Fragment { 24 | 25 | private RecyclerView blog_list; 26 | private FirestoreRecyclerAdapter adapter; 27 | private CoordinatorLayout coordinatorLayout; 28 | private FirebaseAuth mAuth; 29 | private String user_id; 30 | private RelativeLayout error; 31 | 32 | 33 | @Override 34 | public void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | 37 | } 38 | 39 | @Override 40 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 41 | Bundle savedInstanceState) { 42 | View view = inflater.inflate(R.layout.fragment_bookmarks, container, false); 43 | mAuth = FirebaseAuth.getInstance(); 44 | user_id = mAuth.getCurrentUser().getUid(); 45 | error = view.findViewById(R.id.error); 46 | error.setVisibility(View.GONE); 47 | 48 | //Initializing the Recycler View 49 | blog_list = view.findViewById(R.id.blog_list); 50 | populateBlogList(); 51 | blog_list.setAdapter(adapter); 52 | blog_list.setHasFixedSize(true); 53 | final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity()); 54 | blog_list.setLayoutManager(linearLayoutManager); 55 | coordinatorLayout = view.findViewById(R.id.main_layout); 56 | adapter.startListening(); 57 | 58 | //Checking if no bookmarks 59 | if (adapter.getItemCount() == 0){ 60 | error.setVisibility(View.VISIBLE); 61 | }else { 62 | error.setVisibility(View.GONE); 63 | } 64 | 65 | return view; 66 | } 67 | 68 | 69 | private void populateBlogList(){ 70 | 71 | 72 | Query query = FirebaseFirestore.getInstance() 73 | .collection("Users") 74 | .document(user_id) 75 | .collection("Bookmarks") 76 | .orderBy("BookmarkTime", Query.Direction.DESCENDING); 77 | 78 | FirestoreRecyclerOptions options = new FirestoreRecyclerOptions.Builder() 79 | .setQuery(query, Bookmarks.class) 80 | .build(); 81 | 82 | adapter = new FirestoreRecyclerAdapter(options) { 83 | @Override 84 | public void onBindViewHolder(BookmarksViewHolder holder, int position, final Bookmarks model) { 85 | 86 | holder.setImage(model.getImage(),getActivity()); 87 | holder.setUser(getActivity(), model.getUser()); 88 | holder.setDate(model.getTime()); 89 | holder.setTitle(model.getTitle()); 90 | holder.setDesc(model.getDesc()); 91 | holder.setLikes(model.getTitle()); 92 | holder.setBookmark(model.getTitle(), coordinatorLayout); 93 | holder.setView(model.getTitle()); 94 | holder.showPostDetails(model.getImage(), model.getUser(), model.getTime(), model.getTitle(), getActivity()); 95 | } 96 | 97 | @Override 98 | public BookmarksViewHolder onCreateViewHolder(ViewGroup group, int i) { 99 | View view = LayoutInflater.from(group.getContext()) 100 | .inflate(R.layout.blog_row, group, false); 101 | return new BookmarksViewHolder(view); 102 | } 103 | 104 | @Override 105 | public void onDataChanged() { 106 | if (adapter.getItemCount() == 0){ 107 | error.setVisibility(View.VISIBLE); 108 | }else { 109 | error.setVisibility(View.GONE); 110 | } 111 | } 112 | }; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Fragments/HomeFragment.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Fragments; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.design.widget.CoordinatorLayout; 7 | import android.support.v4.app.Fragment; 8 | import android.support.v7.widget.GridLayoutManager; 9 | import android.support.v7.widget.LinearLayoutManager; 10 | import android.support.v7.widget.RecyclerView; 11 | import android.text.style.IconMarginSpan; 12 | import android.view.LayoutInflater; 13 | import android.view.View; 14 | import android.view.ViewGroup; 15 | import android.widget.TextView; 16 | 17 | import com.droidclan.samplefoodblog.BlogDetails; 18 | import com.droidclan.samplefoodblog.Helper.BlogViewHolder; 19 | import com.droidclan.samplefoodblog.Modal.Blog; 20 | import com.droidclan.samplefoodblog.PostActivity; 21 | import com.droidclan.samplefoodblog.R; 22 | import com.firebase.ui.firestore.FirestoreRecyclerAdapter; 23 | import com.firebase.ui.firestore.FirestoreRecyclerOptions; 24 | import com.google.firebase.firestore.FirebaseFirestore; 25 | import com.google.firebase.firestore.Query; 26 | 27 | import java.lang.reflect.Array; 28 | import java.util.ArrayList; 29 | import java.util.Arrays; 30 | import java.util.Objects; 31 | 32 | import de.hdodenhof.circleimageview.CircleImageView; 33 | 34 | 35 | public class HomeFragment extends Fragment { 36 | 37 | private RecyclerView blog_list; 38 | private FirestoreRecyclerAdapter adapter; 39 | private CoordinatorLayout coordinatorLayout; 40 | 41 | @Override 42 | public void onCreate(Bundle savedInstanceState) { 43 | super.onCreate(savedInstanceState); 44 | } 45 | 46 | @Override 47 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 48 | Bundle savedInstanceState) { 49 | View view = inflater.inflate(R.layout.fragment_home, container, false); 50 | 51 | // Initializing the Recycler View 52 | blog_list = view.findViewById(R.id.blog_list); 53 | populateBlogList(); 54 | blog_list.setAdapter(adapter); 55 | blog_list.setHasFixedSize(true); 56 | final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity()); 57 | blog_list.setLayoutManager(linearLayoutManager); 58 | coordinatorLayout = view.findViewById(R.id.main_layout); 59 | adapter.startListening(); 60 | 61 | return view; 62 | } 63 | 64 | 65 | // Populating Blog List 66 | private void populateBlogList(){ 67 | 68 | 69 | Query query = FirebaseFirestore.getInstance() 70 | .collection("Posts") 71 | .orderBy("Time", Query.Direction.DESCENDING); 72 | 73 | FirestoreRecyclerOptions options = new FirestoreRecyclerOptions.Builder() 74 | .setQuery(query, Blog.class) 75 | .build(); 76 | 77 | adapter = new FirestoreRecyclerAdapter(options) { 78 | @Override 79 | public void onBindViewHolder(BlogViewHolder holder, int position, final Blog model) { 80 | 81 | holder.setImage(model.getImage(),getActivity()); 82 | holder.setUser(getActivity(), model.getUser(), getActivity()); 83 | holder.setDate(model.getTime()); 84 | holder.setTitle(model.getTitle()); 85 | holder.setDesc(model.getDesc()); 86 | holder.setLikes(getActivity(),model.getTitle()); 87 | holder.setBookmark(getActivity(),model.getTitle(), model.getDesc(), model.getImage(), model.getTime(), coordinatorLayout, model.getUser()); 88 | holder.setView(model.getViews()); 89 | holder.showPostDetails(model.getImage(), model.getUser(), model.getTime(), model.getTitle(), model.getDetails(), model.getViews(), getActivity()); 90 | } 91 | 92 | @Override 93 | public BlogViewHolder onCreateViewHolder(ViewGroup group, int i) { 94 | View view = LayoutInflater.from(group.getContext()) 95 | .inflate(R.layout.blog_row, group, false); 96 | return new BlogViewHolder(view); 97 | } 98 | }; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Fragments/TrendingFragment.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Fragments; 2 | 3 | import android.content.Intent; 4 | import android.support.design.widget.CoordinatorLayout; 5 | import android.support.v4.app.Fragment; 6 | import android.os.Bundle; 7 | import android.support.v7.widget.LinearLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.TextView; 13 | 14 | import com.droidclan.samplefoodblog.BlogDetails; 15 | import com.droidclan.samplefoodblog.Helper.BlogViewHolder; 16 | import com.droidclan.samplefoodblog.Modal.Blog; 17 | import com.droidclan.samplefoodblog.R; 18 | import com.firebase.ui.firestore.FirestoreRecyclerAdapter; 19 | import com.firebase.ui.firestore.FirestoreRecyclerOptions; 20 | import com.google.firebase.auth.FirebaseAuth; 21 | import com.google.firebase.firestore.FirebaseFirestore; 22 | import com.google.firebase.firestore.Query; 23 | 24 | public class TrendingFragment extends Fragment { 25 | 26 | private RecyclerView blog_list; 27 | private FirestoreRecyclerAdapter adapter; 28 | private CoordinatorLayout coordinatorLayout; 29 | 30 | @Override 31 | public void onCreate(Bundle savedInstanceState) { 32 | super.onCreate(savedInstanceState); 33 | } 34 | 35 | @Override 36 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 37 | Bundle savedInstanceState) { 38 | View view = inflater.inflate(R.layout.fragment_trending, container, false); 39 | 40 | // Initializing the Recycler View 41 | blog_list = view.findViewById(R.id.blog_list); 42 | populateBlogList(); 43 | blog_list.setAdapter(adapter); 44 | blog_list.setHasFixedSize(true); 45 | final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity()); 46 | blog_list.setLayoutManager(linearLayoutManager); 47 | coordinatorLayout = view.findViewById(R.id.main_layout); 48 | adapter.startListening(); 49 | 50 | return view; 51 | } 52 | 53 | 54 | // Populating Blog List 55 | private void populateBlogList(){ 56 | 57 | Query query = FirebaseFirestore.getInstance() 58 | .collection("Posts") 59 | .orderBy("Views", Query.Direction.DESCENDING); 60 | 61 | FirestoreRecyclerOptions options = new FirestoreRecyclerOptions.Builder() 62 | .setQuery(query, Blog.class) 63 | .build(); 64 | 65 | adapter = new FirestoreRecyclerAdapter(options) { 66 | @Override 67 | public void onBindViewHolder(BlogViewHolder holder, int position, final Blog model) { 68 | 69 | holder.setImage(model.getImage(),getActivity()); 70 | holder.setUser(getActivity(), model.getUser(), getActivity()); 71 | holder.setDate(model.getTime()); 72 | holder.setTitle(model.getTitle()); 73 | holder.setDesc(model.getDesc()); 74 | holder.setLikes(getActivity(), model.getTitle()); 75 | holder.setBookmark(getActivity(), model.getTitle(), model.getDesc(), model.getImage(), model.getTime(), coordinatorLayout, model.getUser()); 76 | holder.setView(model.getViews()); 77 | holder.showPostDetails(model.getImage(), model.getUser(), model.getTime(), model.getTitle(), model.getDetails(), model.getViews(), getActivity()); 78 | 79 | } 80 | 81 | @Override 82 | public BlogViewHolder onCreateViewHolder(ViewGroup group, int i) { 83 | View view = LayoutInflater.from(group.getContext()) 84 | .inflate(R.layout.blog_row, group, false); 85 | return new BlogViewHolder(view); 86 | } 87 | }; 88 | 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Helper/BottomNavigationViewHelper.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Helper; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.support.design.internal.BottomNavigationItemView; 5 | import android.support.design.internal.BottomNavigationMenuView; 6 | import android.support.design.widget.BottomNavigationView; 7 | import android.util.Log; 8 | import java.lang.reflect.Field; 9 | 10 | public class BottomNavigationViewHelper { 11 | public static void disableShiftMode(BottomNavigationView view) { 12 | BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0); 13 | try { 14 | Field shiftingMode = menuView.getClass().getDeclaredField("mShiftingMode"); 15 | shiftingMode.setAccessible(true); 16 | shiftingMode.setBoolean(menuView, false); 17 | shiftingMode.setAccessible(false); 18 | for (int i = 0; i < menuView.getChildCount(); i++) { 19 | BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i); 20 | //noinspection RestrictedApi 21 | item.setShiftingMode(false); 22 | // set once again checked value, so view will be updated 23 | //noinspection RestrictedApi 24 | item.setChecked(item.getItemData().isChecked()); 25 | } 26 | } catch (NoSuchFieldException e) { 27 | Log.e("BNVHelper", "Unable to get shift mode field", e); 28 | } catch (IllegalAccessException e) { 29 | Log.e("BNVHelper", "Unable to change value of shift mode", e); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Helper/CommentViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Helper; 2 | 3 | 4 | import android.app.Activity; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.support.annotation.NonNull; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.View; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | import android.widget.Toast; 13 | 14 | import com.bumptech.glide.Glide; 15 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 16 | import com.bumptech.glide.request.RequestOptions; 17 | import com.droidclan.samplefoodblog.ProfileActivity; 18 | import com.droidclan.samplefoodblog.R; 19 | import com.google.android.gms.tasks.OnCompleteListener; 20 | import com.google.android.gms.tasks.Task; 21 | import com.google.firebase.auth.FirebaseAuth; 22 | import com.google.firebase.firestore.DocumentReference; 23 | import com.google.firebase.firestore.DocumentSnapshot; 24 | import com.google.firebase.firestore.FirebaseFirestore; 25 | 26 | import de.hdodenhof.circleimageview.CircleImageView; 27 | 28 | public class CommentViewHolder extends RecyclerView.ViewHolder { 29 | 30 | View view; 31 | String user; 32 | private TextView comment_details; 33 | 34 | public CommentViewHolder(View itemView) { 35 | super(itemView); 36 | view = itemView; 37 | user = FirebaseAuth.getInstance().getCurrentUser().getUid(); 38 | comment_details = view.findViewById(R.id.comment_details); 39 | 40 | } 41 | 42 | public void setUserImage(final String user_id, final Activity ctx){ 43 | final CircleImageView user_image = view.findViewById(R.id.user_image); 44 | 45 | user_image.setOnClickListener(new View.OnClickListener() { 46 | @Override 47 | public void onClick(View v) { 48 | Intent profile = new Intent(ctx, ProfileActivity.class); 49 | profile.putExtra("UserId", user_id); 50 | ctx.startActivity(profile); 51 | } 52 | }); 53 | 54 | comment_details.setOnClickListener(new View.OnClickListener() { 55 | @Override 56 | public void onClick(View v) { 57 | Intent profile = new Intent(ctx, ProfileActivity.class); 58 | profile.putExtra("UserId", user_id); 59 | ctx.startActivity(profile); 60 | } 61 | }); 62 | 63 | DocumentReference documentReference = FirebaseFirestore.getInstance().collection("Users").document(user_id); 64 | documentReference.get().addOnCompleteListener(ctx, new OnCompleteListener() { 65 | @Override 66 | public void onComplete(@NonNull Task task) { 67 | if (task.isSuccessful()){ 68 | Glide.with(ctx) 69 | .applyDefaultRequestOptions(new RequestOptions() 70 | .placeholder(R.drawable.com_facebook_profile_picture_blank_square) 71 | .error(R.drawable.com_facebook_profile_picture_blank_square) 72 | .diskCacheStrategy(DiskCacheStrategy.ALL)) 73 | .load(task.getResult().get("url").toString()) 74 | .into(user_image); 75 | } 76 | } 77 | }); 78 | } 79 | 80 | public void setComment(String comment){ 81 | TextView user_comment = view.findViewById(R.id.user_comment); 82 | user_comment.setText(comment); 83 | } 84 | 85 | public void setDetails(String name, long time){ 86 | TimeFormatter timeFormatter = new TimeFormatter(); 87 | String details = name + " • " + timeFormatter.getTime(time); 88 | comment_details.setText(details); 89 | } 90 | 91 | public void setDeleteBtn(final String user_id, final String post_id, final String comment, final long time){ 92 | ImageView delete_comment = view.findViewById(R.id.delete_comment); 93 | 94 | if (System.currentTimeMillis()-time <= 300000){ 95 | if (user.equals(user_id)){ 96 | delete_comment.setVisibility(View.VISIBLE); 97 | delete_comment.setOnClickListener(new View.OnClickListener() { 98 | @Override 99 | public void onClick(View v) { 100 | FirebaseFirestore.getInstance().collection("Posts").document(post_id).collection("Comments") 101 | .document(time+user_id).delete(); 102 | } 103 | }); 104 | }else { 105 | delete_comment.setVisibility(View.GONE); 106 | } 107 | }else { 108 | delete_comment.setVisibility(View.GONE); 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Helper/CustomTypefaceSpan.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Helper; 2 | 3 | import android.graphics.Paint; 4 | import android.graphics.Typeface; 5 | import android.text.TextPaint; 6 | import android.text.style.TypefaceSpan; 7 | 8 | public class CustomTypefaceSpan extends TypefaceSpan { 9 | 10 | private final Typeface newType; 11 | 12 | public CustomTypefaceSpan(String family, Typeface type) { 13 | super(family); 14 | newType = type; 15 | } 16 | 17 | @Override 18 | public void updateDrawState(TextPaint ds) { 19 | applyCustomTypeFace(ds, newType); 20 | } 21 | 22 | @Override 23 | public void updateMeasureState(TextPaint paint) { 24 | applyCustomTypeFace(paint, newType); 25 | } 26 | 27 | private static void applyCustomTypeFace(Paint paint, Typeface tf) { 28 | int oldStyle; 29 | Typeface old = paint.getTypeface(); 30 | if (old == null) { 31 | oldStyle = 0; 32 | } else { 33 | oldStyle = old.getStyle(); 34 | } 35 | 36 | int fake = oldStyle & ~tf.getStyle(); 37 | if ((fake & Typeface.BOLD) != 0) { 38 | paint.setFakeBoldText(true); 39 | } 40 | 41 | if ((fake & Typeface.ITALIC) != 0) { 42 | paint.setTextSkewX(-0.25f); 43 | } 44 | 45 | paint.setTypeface(tf); 46 | } 47 | } -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Helper/PostsViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Helper; 2 | 3 | import android.app.Activity; 4 | import android.content.Intent; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | import com.bumptech.glide.Glide; 9 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 10 | import com.bumptech.glide.request.RequestOptions; 11 | import com.droidclan.samplefoodblog.BlogDetails; 12 | import com.droidclan.samplefoodblog.R; 13 | 14 | 15 | public class PostsViewHolder extends RecyclerView.ViewHolder { 16 | 17 | private View view; 18 | private ImageView post_image; 19 | 20 | public PostsViewHolder(View itemView) { 21 | super(itemView); 22 | view = itemView; 23 | post_image = view.findViewById(R.id.post_image); 24 | } 25 | 26 | public void showPostDetails(String imgurl, String user, long time, String title, String details, int views, final Activity activity){ 27 | 28 | Glide.with(activity) 29 | .applyDefaultRequestOptions(new RequestOptions() 30 | .placeholder(R.color.com_facebook_device_auth_text) 31 | .error(R.color.com_facebook_device_auth_text) 32 | .diskCacheStrategy(DiskCacheStrategy.ALL)) 33 | .load(imgurl) 34 | .into(post_image); 35 | 36 | 37 | final Intent post = new Intent(activity, BlogDetails.class); 38 | post.putExtra("ImageUrl", imgurl); 39 | post.putExtra("Time", time); 40 | post.putExtra("User", user); 41 | post.putExtra("Title", title); 42 | post.putExtra("Details", details); 43 | post.putExtra("Views", views); 44 | 45 | post_image.setOnClickListener(new View.OnClickListener() { 46 | @Override 47 | public void onClick(View v) { 48 | activity.startActivity(post); 49 | } 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/Helper/TimeFormatter.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog.Helper; 2 | 3 | 4 | import java.text.SimpleDateFormat; 5 | 6 | public class TimeFormatter { 7 | 8 | String timeString = ""; 9 | 10 | public String getTime(long time){ 11 | 12 | long currentTime = System.currentTimeMillis(); 13 | long timeDifference = currentTime-time; 14 | 15 | SimpleDateFormat sdfMinute = new SimpleDateFormat("mm"); 16 | SimpleDateFormat sdfHour = new SimpleDateFormat("HH"); 17 | SimpleDateFormat sdfDay = new SimpleDateFormat("dd"); 18 | SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yy"); 19 | 20 | if (timeDifference <= 600000){ 21 | return "Just now"; 22 | }else if (timeDifference <= 3.6e+6){ 23 | timeString = sdfMinute.format(timeDifference); 24 | return timeString.replaceFirst("0","") + " minutes ago"; 25 | }else if (timeDifference <= 8.64e+7){ 26 | timeString = sdfHour.format(timeDifference); 27 | return timeString.replaceFirst("0","") + " hours ago"; 28 | }else if (timeDifference <= 2.592e+9){ 29 | timeString = sdfDay.format(timeDifference); 30 | return timeString.replaceFirst("0","") + " days ago"; 31 | }else if (timeDifference > 2.592e+9){ 32 | timeString = sdf.format(time); 33 | return timeString; 34 | } 35 | 36 | 37 | return ""; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Intent; 5 | import android.graphics.Typeface; 6 | import android.net.Uri; 7 | import android.os.Build; 8 | import android.os.Bundle; 9 | import android.os.Handler; 10 | import android.provider.ContactsContract; 11 | import android.provider.Settings; 12 | import android.support.annotation.NonNull; 13 | import android.support.design.widget.BottomNavigationView; 14 | import android.support.design.widget.FloatingActionButton; 15 | import android.support.v4.app.Fragment; 16 | import android.support.v4.app.FragmentTransaction; 17 | import android.support.v7.app.AppCompatActivity; 18 | import android.support.v7.widget.Toolbar; 19 | import android.text.Spannable; 20 | import android.text.SpannableString; 21 | import android.view.Menu; 22 | import android.view.MenuItem; 23 | import android.view.View; 24 | import android.widget.ImageView; 25 | import android.widget.TextView; 26 | import android.widget.Toast; 27 | 28 | import com.bumptech.glide.Glide; 29 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 30 | import com.bumptech.glide.request.RequestOptions; 31 | import com.droidclan.samplefoodblog.Fragments.BookmarksFragment; 32 | import com.droidclan.samplefoodblog.Fragments.HomeFragment; 33 | import com.droidclan.samplefoodblog.Fragments.ActivityFragment; 34 | import com.droidclan.samplefoodblog.Fragments.TrendingFragment; 35 | import com.droidclan.samplefoodblog.Helper.BottomNavigationViewHelper; 36 | import com.droidclan.samplefoodblog.Helper.CustomTypefaceSpan; 37 | import com.google.firebase.auth.FirebaseAuth; 38 | 39 | import de.hdodenhof.circleimageview.CircleImageView; 40 | 41 | public class MainActivity extends AppCompatActivity { 42 | 43 | TextView header; 44 | FirebaseAuth mAuth; 45 | BottomNavigationView bottom_nav; 46 | private CircleImageView profileimage; 47 | private Fragment homeFragment,trendingFragment,bookmarksFragment,activityFragment; 48 | 49 | @Override 50 | protected void onCreate(Bundle savedInstanceState) { 51 | super.onCreate(savedInstanceState); 52 | setContentView(R.layout.activity_main); 53 | mAuth = FirebaseAuth.getInstance(); 54 | 55 | 56 | //Customizing the Toolbar 57 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 58 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); 59 | } 60 | Toolbar toolbar = findViewById(R.id.toolbar); 61 | setSupportActionBar(toolbar); 62 | getSupportActionBar().setTitle(""); 63 | Typeface pacifico = Typeface.createFromAsset(getAssets(), "fonts/Pacifico.ttf"); 64 | header = findViewById(R.id.header); 65 | header.setTypeface(pacifico); 66 | profileimage = findViewById(R.id.profileimage); 67 | profileimage.setOnClickListener(new View.OnClickListener() { 68 | @Override 69 | public void onClick(View v) { 70 | Intent profile = new Intent(MainActivity.this, ProfileActivity.class); 71 | profile.putExtra("UserId", mAuth.getCurrentUser().getUid()); 72 | startActivity(profile); 73 | } 74 | }); 75 | loadprofileImage(mAuth.getCurrentUser().getPhotoUrl()); 76 | ImageView search = findViewById(R.id.search); 77 | search.setOnClickListener(new View.OnClickListener() { 78 | @Override 79 | public void onClick(View v) { 80 | startActivity(new Intent(MainActivity.this, SearchActivity.class)); 81 | } 82 | }); 83 | 84 | 85 | //Customizing Bottom Navigation 86 | bottom_nav = findViewById(R.id.bottom_nav); 87 | BottomNavigationViewHelper.disableShiftMode(bottom_nav); 88 | Menu m = bottom_nav.getMenu(); 89 | for (int i=0;i= Build.VERSION_CODES.M) { 88 | if (ContextCompat.checkSelfPermission(PostActivity.this, android.Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { 89 | ActivityCompat.requestPermissions(PostActivity.this, new String[]{android.Manifest.permission.READ_EXTERNAL_STORAGE}, 1); 90 | } else { 91 | pickimage(); 92 | } 93 | } else { 94 | pickimage(); 95 | } 96 | } 97 | }); 98 | } 99 | 100 | @Override 101 | public void onBackPressed() { 102 | super.onBackPressed(); 103 | } 104 | 105 | @Override 106 | public boolean onOptionsItemSelected(MenuItem item) { 107 | int id = item.getItemId(); 108 | 109 | if (id == android.R.id.home) { 110 | super.onBackPressed(); 111 | } 112 | 113 | return true; 114 | } 115 | 116 | 117 | @Override 118 | public void onActivityResult(int requestCode, int resultCode, Intent data) { 119 | if (requestCode == PICK_IMAGE) { 120 | 121 | if (data != null) { 122 | post_image_uri = data.getData(); 123 | post_image.setImageURI(post_image_uri); 124 | } else { 125 | Toast.makeText(this, "Unable to load Image", Toast.LENGTH_LONG).show(); 126 | } 127 | } 128 | } 129 | 130 | private void pickimage() { 131 | Intent intent = new Intent(Intent.ACTION_GET_CONTENT); 132 | intent.setType("image/*"); 133 | startActivityForResult(intent, PICK_IMAGE); 134 | } 135 | 136 | private boolean allClear() { 137 | if (post_image_uri == null) { 138 | toast("Please select an Image"); 139 | return false; 140 | }else if (TextUtils.isEmpty(post_title.getText().toString())){ 141 | post_title.setError("Title can't be Empty"); 142 | return false; 143 | }else if (TextUtils.isEmpty(post_details.getText().toString())){ 144 | post_details.setError("Detail can't be Empty"); 145 | return false; 146 | }else { 147 | return true; 148 | } 149 | } 150 | 151 | private void uploadPostImage(final String postId) { 152 | pdialog = new ProgressDialog(PostActivity.this, R.style.MyAlertDialogStyle); 153 | pdialog.setMessage("Please wait..."); 154 | pdialog.setIndeterminate(true); 155 | pdialog.setCanceledOnTouchOutside(false); 156 | pdialog.setCancelable(false); 157 | pdialog.show(); 158 | StorageReference riversRef = FirebaseStorage.getInstance().getReference().child("post_images/" + postId + ".png"); 159 | riversRef.putFile(post_image_uri) 160 | .addOnCompleteListener(new OnCompleteListener() { 161 | @Override 162 | public void onComplete(@NonNull Task task) { 163 | if (task.isSuccessful()) { 164 | savePostDetails(task.getResult().getDownloadUrl().toString()); 165 | } else { 166 | Toast.makeText(PostActivity.this, "Unable to upload Image ! " + task.getException(), Toast.LENGTH_SHORT).show(); 167 | pdialog.dismiss(); 168 | } 169 | } 170 | }); 171 | } 172 | 173 | private void savePostDetails(String imageUrl) { 174 | String title = post_title.getText().toString(); 175 | String details = post_details.getText().toString(); 176 | String desc = details.substring(0, Math.min(details.length(), 250)); 177 | String user = mAuth.getCurrentUser().getUid(); 178 | 179 | Map post = new HashMap<>(); 180 | post.put("User", user); 181 | post.put("Views", 0); 182 | post.put("Image", imageUrl); 183 | post.put("Time", System.currentTimeMillis()); 184 | post.put("Title", title); 185 | post.put("Desc", desc); 186 | post.put("Details", details); 187 | 188 | FirebaseFirestore.getInstance().collection("Posts").document(title) 189 | .set(post) 190 | .addOnSuccessListener(new OnSuccessListener() { 191 | @Override 192 | public void onSuccess(Void aVoid) { 193 | pdialog.dismiss(); 194 | post_title.setText(""); 195 | post_details.setText(""); 196 | post_image.setImageResource(R.color.com_facebook_device_auth_text); 197 | Toast.makeText(PostActivity.this, "Post uploaded successfully :)", Toast.LENGTH_LONG).show(); 198 | } 199 | }) 200 | .addOnFailureListener(new OnFailureListener() { 201 | @Override 202 | public void onFailure(@NonNull Exception e) { 203 | Toast.makeText(getApplicationContext(), "Something went wrong :(", Toast.LENGTH_LONG).show(); 204 | } 205 | }); 206 | } 207 | 208 | private void toast(String message){ 209 | Toast.makeText(PostActivity.this, message, Toast.LENGTH_SHORT).show(); 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/SearchActivity.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog; 2 | 3 | import android.os.Build; 4 | import android.os.Bundle; 5 | import android.support.design.widget.CoordinatorLayout; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.LinearLayoutManager; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.support.v7.widget.Toolbar; 10 | import android.view.KeyEvent; 11 | import android.view.LayoutInflater; 12 | import android.view.MotionEvent; 13 | import android.view.View; 14 | import android.view.ViewGroup; 15 | import android.view.inputmethod.EditorInfo; 16 | import android.widget.EditText; 17 | import android.widget.ImageView; 18 | import android.widget.TextView; 19 | import com.droidclan.samplefoodblog.Helper.BlogViewHolder; 20 | import com.droidclan.samplefoodblog.Modal.Blog; 21 | import com.firebase.ui.firestore.FirestoreRecyclerAdapter; 22 | import com.firebase.ui.firestore.FirestoreRecyclerOptions; 23 | import com.google.firebase.firestore.FirebaseFirestore; 24 | import com.google.firebase.firestore.Query; 25 | 26 | public class SearchActivity extends AppCompatActivity { 27 | 28 | CoordinatorLayout coordinatorLayout; 29 | Toolbar toolbar; 30 | ImageView back; 31 | EditText search_input; 32 | RecyclerView blog_list; 33 | private FirestoreRecyclerAdapter adapter; 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | setContentView(R.layout.activity_search); 39 | 40 | //Finding view by id 41 | coordinatorLayout = findViewById(R.id.constraint_layout); 42 | toolbar = findViewById(R.id.toolbar); 43 | back = findViewById(R.id.back); 44 | search_input = findViewById(R.id.search_input); 45 | blog_list = findViewById(R.id.blog_list); 46 | 47 | 48 | //Initializing the recycler view 49 | 50 | 51 | 52 | //Customizing the action bar 53 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 54 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); 55 | } 56 | 57 | setSupportActionBar(toolbar); 58 | getSupportActionBar().setTitle(""); 59 | search_input.setOnTouchListener(new View.OnTouchListener() { 60 | @Override 61 | public boolean onTouch(View v, MotionEvent event) { 62 | final int DRAWABLE_RIGHT = 2; 63 | if(event.getAction() == MotionEvent.ACTION_UP) { 64 | if(event.getRawX() >= (search_input.getRight() - search_input.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width())) { 65 | search_input.setText(""); 66 | } 67 | } 68 | return false; 69 | } 70 | }); 71 | 72 | search_input.setOnEditorActionListener(new TextView.OnEditorActionListener() { 73 | @Override 74 | public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { 75 | if (actionId == EditorInfo.IME_ACTION_SEARCH) { 76 | String text = search_input.getText().toString(); 77 | if (!text.equals("")){ 78 | populateBlogList(text); 79 | blog_list.setAdapter(adapter); 80 | blog_list.setHasFixedSize(true); 81 | final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(SearchActivity.this); 82 | blog_list.setLayoutManager(linearLayoutManager); 83 | adapter.startListening(); 84 | } 85 | } 86 | return false; 87 | } 88 | }); 89 | 90 | back.setOnClickListener(new View.OnClickListener() { 91 | @Override 92 | public void onClick(View v) { 93 | SearchActivity.super.onBackPressed(); 94 | } 95 | }); 96 | } 97 | 98 | 99 | private void populateBlogList(String search_text){ 100 | 101 | 102 | Query query = FirebaseFirestore.getInstance() 103 | .collection("Posts") 104 | .orderBy("Title") 105 | .orderBy("Time", Query.Direction.DESCENDING) 106 | .whereGreaterThanOrEqualTo("Title", search_text); 107 | // .startAt(search_text) 108 | // .endAt(search_text + "\uf8ff"); 109 | 110 | 111 | FirestoreRecyclerOptions options = new FirestoreRecyclerOptions.Builder() 112 | .setQuery(query, Blog.class) 113 | .build(); 114 | 115 | 116 | adapter = new FirestoreRecyclerAdapter(options) { 117 | @Override 118 | public void onBindViewHolder(BlogViewHolder holder, int position, final Blog model) { 119 | 120 | holder.setImage(model.getImage(),SearchActivity.this); 121 | holder.setUser(SearchActivity.this, model.getUser(), SearchActivity.this); 122 | holder.setDate(model.getTime()); 123 | holder.setTitle(model.getTitle()); 124 | holder.setDesc(model.getDesc()); 125 | holder.setLikes(SearchActivity.this, model.getTitle()); 126 | holder.setBookmark(SearchActivity.this, model.getTitle(), model.getDesc(), model.getImage(), model.getTime(), coordinatorLayout, model.getUser()); 127 | holder.setView(model.getViews()); 128 | holder.showPostDetails(model.getImage(), model.getUser(), model.getTime(), model.getTitle(), model.getDetails(), model.getViews(), SearchActivity.this); 129 | 130 | } 131 | 132 | @Override 133 | public BlogViewHolder onCreateViewHolder(ViewGroup group, int i) { 134 | View view = LayoutInflater.from(group.getContext()) 135 | .inflate(R.layout.blog_row, group, false); 136 | return new BlogViewHolder(view); 137 | } 138 | }; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog; 2 | 3 | import android.content.Intent; 4 | import android.content.SharedPreferences; 5 | import android.graphics.Typeface; 6 | import android.os.Build; 7 | import android.support.annotation.NonNull; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.os.Bundle; 10 | import android.support.v7.widget.CardView; 11 | import android.support.v7.widget.Toolbar; 12 | import android.view.View; 13 | import android.widget.Button; 14 | import android.widget.CompoundButton; 15 | import android.widget.ImageView; 16 | import android.widget.Switch; 17 | import android.widget.TextView; 18 | 19 | import com.bumptech.glide.Glide; 20 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 21 | import com.bumptech.glide.request.RequestOptions; 22 | import com.google.firebase.auth.FirebaseAuth; 23 | import com.google.firebase.auth.FirebaseUser; 24 | import de.hdodenhof.circleimageview.CircleImageView; 25 | 26 | public class SettingsActivity extends AppCompatActivity { 27 | 28 | private Toolbar toolbar; 29 | private TextView title; 30 | private ImageView back_btn; 31 | private CircleImageView profile_image; 32 | private CardView name, email, password, notification; 33 | private TextView profile_name, profile_email, profile_password, notification_text, version; 34 | private Button logout_btn; 35 | private Switch nbtn; 36 | private FirebaseAuth mAuth; 37 | private FirebaseUser user; 38 | private String photo_url, username, useremail, provider; 39 | 40 | 41 | @Override 42 | protected void onCreate(Bundle savedInstanceState) { 43 | super.onCreate(savedInstanceState); 44 | setContentView(R.layout.activity_settings); 45 | 46 | 47 | //Finding view By ID 48 | toolbar = findViewById(R.id.toolbar); 49 | title = findViewById(R.id.title); 50 | back_btn = findViewById(R.id.back_btn); 51 | profile_image = findViewById(R.id.profile_image); 52 | name = findViewById(R.id.name); 53 | email = findViewById(R.id.email); 54 | password = findViewById(R.id.password); 55 | notification = findViewById(R.id.notification); 56 | profile_name = findViewById(R.id.profile_name); 57 | profile_email = findViewById(R.id.profile_email); 58 | profile_password = findViewById(R.id.profile_password); 59 | notification_text = findViewById(R.id.notification_text); 60 | version = findViewById(R.id.version); 61 | logout_btn = findViewById(R.id.logout_btn); 62 | nbtn = findViewById(R.id.nbtn); 63 | 64 | 65 | 66 | 67 | //Changing the Typefaces 68 | Typeface extravaganzza = Typeface.createFromAsset(getAssets(), "fonts/extravaganzza.ttf"); 69 | title.setTypeface(extravaganzza); 70 | profile_name.setTypeface(extravaganzza); 71 | profile_email.setTypeface(extravaganzza); 72 | profile_password.setTypeface(extravaganzza); 73 | notification_text.setTypeface(extravaganzza); 74 | version.setTypeface(extravaganzza); 75 | logout_btn.setTypeface(extravaganzza); 76 | 77 | 78 | 79 | 80 | mAuth = FirebaseAuth.getInstance(); 81 | logout_btn.setOnClickListener(new View.OnClickListener() { 82 | @Override 83 | public void onClick(View v) { 84 | mAuth.signOut(); 85 | } 86 | }); 87 | String version_name = "Version - " + BuildConfig.VERSION_NAME; 88 | version.setText(version_name); 89 | mAuth.addAuthStateListener(new FirebaseAuth.AuthStateListener() { 90 | @Override 91 | public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) { 92 | if (firebaseAuth.getCurrentUser() == null){ 93 | SettingsActivity.this.finish(); 94 | Intent main = new Intent(SettingsActivity.this, LoginActivity.class); 95 | main.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 96 | startActivity(main); 97 | } 98 | } 99 | }); 100 | 101 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 102 | getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); 103 | } 104 | user = mAuth.getCurrentUser(); 105 | setSupportActionBar(toolbar); 106 | getSupportActionBar().setTitle(""); 107 | back_btn.setOnClickListener(new View.OnClickListener() { 108 | @Override 109 | public void onClick(View v) { 110 | SettingsActivity.super.onBackPressed(); 111 | } 112 | }); 113 | 114 | //Setting profile information 115 | getProfileDetails(); 116 | 117 | 118 | } 119 | 120 | private void getProfileDetails(){ 121 | if (user != null){ 122 | 123 | SharedPreferences sharedPreferences = getSharedPreferences("notification", MODE_PRIVATE); 124 | final SharedPreferences.Editor editor = sharedPreferences.edit(); 125 | if (!sharedPreferences.contains("on")){ 126 | editor.putBoolean("on", true); 127 | editor.apply(); 128 | } 129 | 130 | if (sharedPreferences.getBoolean("on", true)){ 131 | nbtn.setChecked(true); 132 | notification_text.setText("Notifications ON"); 133 | }else { 134 | nbtn.setChecked(false); 135 | notification_text.setText("Notifications OFF"); 136 | } 137 | 138 | nbtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 139 | @Override 140 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 141 | if (isChecked){ 142 | editor.putBoolean("on", true); 143 | notification_text.setText("Notifications ON"); 144 | editor.apply(); 145 | }else { 146 | editor.putBoolean("on", false); 147 | notification_text.setText("Notifications OFF"); 148 | editor.apply(); 149 | } 150 | } 151 | }); 152 | 153 | 154 | photo_url = user.getPhotoUrl().toString(); 155 | username = user.getDisplayName(); 156 | useremail = user.getEmail(); 157 | provider = user.getProviders().get(0); 158 | 159 | 160 | profile_name.setText(username); 161 | profile_email.setText(useremail); 162 | setProfileImage(photo_url); 163 | 164 | 165 | if (emailLogin()){ 166 | password.setVisibility(View.VISIBLE); 167 | }else { 168 | password.setVisibility(View.GONE); 169 | } 170 | } 171 | } 172 | 173 | private void setProfileImage(String url){ 174 | Glide.with(SettingsActivity.this) 175 | .applyDefaultRequestOptions(new RequestOptions() 176 | .diskCacheStrategy(DiskCacheStrategy.ALL)) 177 | .load(url) 178 | .into(profile_image); 179 | } 180 | 181 | 182 | private boolean emailLogin(){ 183 | return provider.equals("firebase"); 184 | } 185 | 186 | } 187 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/java/com/droidclan/samplefoodblog/WelcomeScreenActivity.java: -------------------------------------------------------------------------------- 1 | package com.droidclan.samplefoodblog; 2 | 3 | import android.content.Intent; 4 | import android.graphics.Typeface; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.view.WindowManager; 9 | import android.widget.Button; 10 | import android.widget.TextView; 11 | 12 | import com.google.firebase.auth.FirebaseAuth; 13 | 14 | import java.util.Random; 15 | 16 | public class WelcomeScreenActivity extends AppCompatActivity { 17 | 18 | TextView toptext, quotetext; 19 | private FirebaseAuth mAuth; 20 | Button signup, signin; 21 | 22 | @Override 23 | protected void onStart() { 24 | super.onStart(); 25 | mAuth = FirebaseAuth.getInstance(); 26 | if (mAuth.getCurrentUser()!=null){ 27 | Intent intent = new Intent(WelcomeScreenActivity.this, MainActivity.class); 28 | startActivity(intent); 29 | } 30 | } 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | setContentView(R.layout.activity_welcome_screen); 36 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, 37 | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); 38 | Typeface pacifico = Typeface.createFromAsset(getAssets(), "fonts/Pacifico.ttf"); 39 | 40 | 41 | signin = findViewById(R.id.signin); 42 | signup = findViewById(R.id.signup); 43 | quotetext = findViewById(R.id.quotetext); 44 | toptext = findViewById(R.id.toptext); 45 | toptext.setTypeface(pacifico); 46 | quotetext.setTypeface(pacifico); 47 | 48 | showquotes(); 49 | 50 | signin.setOnClickListener(new View.OnClickListener() { 51 | @Override 52 | public void onClick(View view) { 53 | startActivity(new Intent(WelcomeScreenActivity.this, LoginActivity.class)); 54 | } 55 | }); 56 | 57 | signup.setOnClickListener(new View.OnClickListener() { 58 | @Override 59 | public void onClick(View view) { 60 | startActivity(new Intent(WelcomeScreenActivity.this, RegisterActivity.class)); 61 | } 62 | }); 63 | } 64 | 65 | private void showquotes(){ 66 | String quote1 ="Nothing is better than going home to family and eating good food and relaxing"; 67 | String quote2 ="One cannot think well, love well, sleep well, if one has not dined well"; 68 | String quote3 ="Your diet is a bank account. Good food choices are good investments"; 69 | String quote4 ="Spaghetti can be eaten most successfully if you inhale it like a vacuum cleaner"; 70 | String quote5 ="If music be the food of love, play on"; 71 | 72 | String[] quotes = {quote1,quote2,quote3,quote4,quote5}; 73 | Random r = new Random(); 74 | int n = r.nextInt(5); 75 | quotetext.setText("\""+quotes[n]+"\""); 76 | 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/anim/translate_down.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/anim/translate_up.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/anim/zoom_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/anim/zoom_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 13 | 14 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/activity.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/back.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/back_btn_two.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/bell.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/bookmark.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/bookmarked.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/bottom_nav_colorselector.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/call.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/close_btn.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/comment_logo.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/cursor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/edit.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/edittext_shape_two.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/edittextshape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/facebooklogo.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/facebooksigninbtn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/googlelogo.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/googlesigninbtn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/home.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 8 | 11 | 14 | 17 | 20 | 23 | 26 | 29 | 32 | 35 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/ic_shines.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/liked.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/loginbutton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/loginsignupbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/app/src/main/res/drawable/loginsignupbg.png -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/logo.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/logout_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/logowhite.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/mail.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/nameavatar.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/no_comments.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/notifications.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/password.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/send_comment.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/send_comment_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/tick.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/trending.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/unliked.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/views.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/web.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/drawable/welcomescreenbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vishalroygeek/SampleFoodBlog/40ae2cf374cdf453407039385e91b66cdd2f84b8/SampleFoodBlog/app/src/main/res/drawable/welcomescreenbg.png -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/layout/activity_blog_details.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 16 | 17 | 23 | 24 | 27 | 28 | 37 | 38 | 50 | 51 | 60 | 61 | 67 | 68 | 74 | 75 | 86 | 87 | 103 | 104 | 121 | 122 | 123 | 124 | 125 | 132 | 133 | 141 | 142 | 153 | 154 | 165 | 166 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /SampleFoodBlog/app/src/main/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 22 | 23 | 36 | 37 | 59 | 60 | 82 | 83 |