diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..703ff73 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ + +# Created by https://www.gitignore.io/api/android + +### Android ### +# Built application files +*.apk +*.ap_ + +# Files for the Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +.idea/ +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# Intellij +*.iml + +### Android Patch ### +gen-external-apklibs + diff --git a/Files Repository/ProjectPitch.pptx b/Files Repository/ProjectPitch.pptx new file mode 100644 index 0000000..a476340 Binary files /dev/null and b/Files Repository/ProjectPitch.pptx differ diff --git a/Files Repository/Prototyping/WireFrame Landscape.docx b/Files Repository/Prototyping/WireFrame Landscape.docx new file mode 100644 index 0000000..248e906 Binary files /dev/null and b/Files Repository/Prototyping/WireFrame Landscape.docx differ diff --git a/Files Repository/Prototyping/WireFrame.docx b/Files Repository/Prototyping/WireFrame.docx new file mode 100644 index 0000000..0e2f81b Binary files /dev/null and b/Files Repository/Prototyping/WireFrame.docx differ diff --git a/Files Repository/Prototyping/Wireframe1.rtf b/Files Repository/Prototyping/Wireframe1.rtf new file mode 100644 index 0000000..745768b --- /dev/null +++ b/Files Repository/Prototyping/Wireframe1.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +{\field{\*\fldinst{HYPERLINK "https://popapp.in/w/projects/56dd020a8fb6c5fd0ad279a2/mockups/56dd04096464d4c2382f802d"}}{\fldrslt +\f0\fs24 \cf0 https://popapp.in/w/projects/56dd020a8fb6c5fd0ad279a2/mockups/56dd04096464d4c2382f802d}}} \ No newline at end of file diff --git a/Files Repository/TEST CASES.docx b/Files Repository/TEST CASES.docx new file mode 100644 index 0000000..b35deb0 Binary files /dev/null and b/Files Repository/TEST CASES.docx differ diff --git a/Files Repository/Test Cases.pdf b/Files Repository/Test Cases.pdf new file mode 100644 index 0000000..0d35ec7 Binary files /dev/null and b/Files Repository/Test Cases.pdf differ diff --git a/Files Repository/Testing.xlsx b/Files Repository/Testing.xlsx new file mode 100644 index 0000000..bbc4e9d Binary files /dev/null and b/Files Repository/Testing.xlsx differ diff --git a/Files Repository/Trello Board.rtf b/Files Repository/Trello Board.rtf new file mode 100644 index 0000000..f06849d --- /dev/null +++ b/Files Repository/Trello Board.rtf @@ -0,0 +1,7 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural +{\field{\*\fldinst{HYPERLINK "https://trello.com/b/1XNUwCCY/touchlab"}}{\fldrslt +\f0\fs24 \cf0 https://trello.com/b/1XNUwCCY/touchlab}}} \ No newline at end of file diff --git a/Late.ly/.gitignore b/Late.ly/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/Late.ly/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/Late.ly/.idea/.name b/Late.ly/.idea/.name new file mode 100644 index 0000000..5f19b50 --- /dev/null +++ b/Late.ly/.idea/.name @@ -0,0 +1 @@ +Late.ly \ No newline at end of file diff --git a/Late.ly/.idea/compiler.xml b/Late.ly/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/Late.ly/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/.idea/copyright/profiles_settings.xml b/Late.ly/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/Late.ly/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Late.ly/.idea/gradle.xml b/Late.ly/.idea/gradle.xml new file mode 100644 index 0000000..6961a30 --- /dev/null +++ b/Late.ly/.idea/gradle.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/Late.ly/.idea/misc.xml b/Late.ly/.idea/misc.xml new file mode 100644 index 0000000..fbb6828 --- /dev/null +++ b/Late.ly/.idea/misc.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/.idea/modules.xml b/Late.ly/.idea/modules.xml new file mode 100644 index 0000000..68cc4a8 --- /dev/null +++ b/Late.ly/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/.idea/runConfigurations.xml b/Late.ly/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/Late.ly/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/Late.ly/app/.gitignore b/Late.ly/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/Late.ly/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/Late.ly/app/build.gradle b/Late.ly/app/build.gradle new file mode 100644 index 0000000..e3ff9aa --- /dev/null +++ b/Late.ly/app/build.gradle @@ -0,0 +1,41 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + defaultConfig { + applicationId "com.example.android.lately" + minSdkVersion 15 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + multiDexEnabled true + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.android.support:design:23.1.1' + compile 'com.android.support:support-v4:23.1.1' + compile 'com.android.support:cardview-v7:+' + compile 'com.android.support:recyclerview-v7:23.1.1' + compile ('com.facebook.android:facebook-android-sdk:[4,5)'){ + exclude module: 'support-v4' + } + compile 'com.google.android.gms:play-services-appindexing:8.1.0' + compile 'com.google.code.gson:gson:2.6' + compile files('libs/retrofit-2.0.0-beta4.jar') + compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4' + compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4' + compile 'com.squareup.okhttp3:okhttp:3.1.2' + compile 'com.google.android.gms:play-services:8.4.0' +} diff --git a/Late.ly/app/proguard-rules.pro b/Late.ly/app/proguard-rules.pro new file mode 100644 index 0000000..ba26f6d --- /dev/null +++ b/Late.ly/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/ShowMe/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/Late.ly/app/src/androidTest/java/com/example/android/lately/ApplicationTest.java b/Late.ly/app/src/androidTest/java/com/example/android/lately/ApplicationTest.java new file mode 100644 index 0000000..bc59a8a --- /dev/null +++ b/Late.ly/app/src/androidTest/java/com/example/android/lately/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.example.android.lately; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/Late.ly/app/src/main/AndroidManifest.xml b/Late.ly/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..e9cc95d --- /dev/null +++ b/Late.ly/app/src/main/AndroidManifest.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/CardAdapter.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/CardAdapter.java new file mode 100644 index 0000000..0281717 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/CardAdapter.java @@ -0,0 +1,336 @@ +package com.example.android.lately.Cards; + +import android.graphics.Color; +import android.support.v7.widget.CardView; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.example.android.lately.MainActivity; +import com.example.android.lately.R; + +import org.w3c.dom.Text; + +import java.util.List; + +/** + * Created by perrycooperman on 3/8/16. + */ +public class CardAdapter extends RecyclerView.Adapter { + + List mParentCardList; + int mCurrentCardType; + ParentCardHolder mHolder; + public static final int TYPE_WEATHER = 1; + public static final int TYPE_EVENT = 2; + public static final int TYPE_FOURSQUARE = 5; + public static final int TYPE_REDDIT = 6; + public static final int TYPE_FACEBOOK = 7; + public static final int TAB_MAINPAGE = 0; + public static final int TAB_POLITICS = 1; + public static final int TAB_TECH = 2; + public static final int TAB_CAREER = 3; + public static final int TAB_FOOD = 4; + public static final int TAB_DANCING = 5; + public static final int TAB_ANIMALS = 6; + public static final int TAB_LANGUAGE = 7; + public static final int TAB_SPORTS = 8; + public static final int TAB_NATURE = 9; + public static final int TAB_DATING = 10; + + + public CardAdapter(List parentCardList) { + this.mParentCardList = parentCardList; + } + + + @Override + public ParentCardHolder onCreateViewHolder(ViewGroup parent, int viewType) { + +//get card type and set to member variable +// if an event card then + + //Depending on the CardType, We will inflate that specific Layout + View mView; + switch (viewType) { + case TYPE_EVENT: + mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.event_card, parent, false); + return new EventHolder(mView); + //if a article card then + case TYPE_WEATHER: + mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.weather_card,parent, false); + return new WeatherHolder(mView); + case TYPE_FOURSQUARE: + mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.foursquare_card, parent, false); + return new FoursquareHolder(mView); + case TYPE_REDDIT: + mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.reddit_card, parent, false); + return new RedditHolder(mView); + case TYPE_FACEBOOK: + mView = LayoutInflater.from(parent.getContext()).inflate(R.layout.facebook_card, parent, false); + return new FacebookHolder(mView); + default: + return null; + } + } + + @Override + public void onBindViewHolder(ParentCardHolder holder, int position) { + + // check card type member variable + +// switch case again + + mHolder = holder; +//Depending on the card type, we will extract card-specific information and place them into card specific placeholders + switch (mCurrentCardType) { + + + case TYPE_EVENT: + + EventCard eventCard = (EventCard) mParentCardList.get(position); + final EventHolder eventHolder = (EventHolder) mHolder; + + eventHolder.vGroupName.setText(eventCard.getGroup()); + eventHolder.vTime.setText(eventCard.getTime()); + eventHolder.vEventName.setText(eventCard.getEvent()); + eventHolder.vNumberOfPeople.setText(eventCard.getNumberOfPeople()); + eventHolder.vCardView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //TODO send to detail fragment with card ID + eventHolder.vGroupName.setText("This works"); + eventHolder.vCardView.setCardBackgroundColor(Color.GRAY); + + } + }); + break; + + case TYPE_WEATHER: + + WeatherCard weatherCard = (WeatherCard)mParentCardList.get(position); + WeatherHolder weatherHolder = (WeatherHolder) mHolder; + + weatherHolder.vCurrentTemp.setText(weatherCard.getmCurrentTemp()); + weatherHolder.vCurrentLocation.setText(weatherCard.getmCurrentLocation()); + weatherHolder.vCurrentDate.setText(weatherCard.getmFormattedCurrentDate()); + //TODO Create Set Weather Image Method using a case/switch returning a drawable to place here +// weatherHolder.vCurrentImage.setImageDrawable(setWeatherImage(weatherCard.getmCurrentSummary()); + weatherHolder.vDay1High.setText(weatherCard.getmNextFiveDaysHighTemp()[0]); + weatherHolder.vDay1Low.setText(weatherCard.getmNextFiveDaysLowTemp()[0]); + weatherHolder.vDay1Date.setText(weatherCard.getmNextFiveDaysDates()[0]); +// weatherHolder.vDay1Image.setImageDrawable(setWeatherImage(weatherCard.getmNextFiveDaysSummary()[0])); + weatherHolder.vDay2High.setText(weatherCard.getmNextFiveDaysHighTemp()[1]); + weatherHolder.vDay2Low.setText(weatherCard.getmNextFiveDaysLowTemp()[1]); + weatherHolder.vDay2Date.setText(weatherCard.getmNextFiveDaysDates()[1]); +// weatherHolder.vDay2Image.setImageDrawable(setWeatherImage(weatherCard.getmNextFiveDaysSummary()[1])); + weatherHolder.vDay3High.setText(weatherCard.getmNextFiveDaysHighTemp()[2]); + weatherHolder.vDay3Low.setText(weatherCard.getmNextFiveDaysLowTemp()[2]); + weatherHolder.vDay3Date.setText(weatherCard.getmNextFiveDaysDates()[2]); +// weatherHolder.vDay3Image.setImageDrawable(setWeatherImage(weatherCard.getmNextFiveDaysSummary()[2])); + weatherHolder.vDay4High.setText(weatherCard.getmNextFiveDaysHighTemp()[3]); + weatherHolder.vDay4Low.setText(weatherCard.getmNextFiveDaysLowTemp()[3]); + weatherHolder.vDay4Date.setText(weatherCard.getmNextFiveDaysDates()[3]); +// weatherHolder.vDay4Image.setImageDrawable(setWeatherImage(weatherCard.getmNextFiveDaysSummary()[3])); + weatherHolder.vDay5High.setText(weatherCard.getmNextFiveDaysHighTemp()[4]); + weatherHolder.vDay5Low.setText(weatherCard.getmNextFiveDaysLowTemp()[4]); + weatherHolder.vDay5Date.setText(weatherCard.getmNextFiveDaysDates()[4]); +// weatherHolder.vDay5Image.setImageDrawable(setWeatherImage(weatherCard.getmNextFiveDaysSummary()[4])); + break; + + case TYPE_FOURSQUARE: + + FoursquareCard foursquareCard = (FoursquareCard)mParentCardList.get(position); + final FoursquareHolder foursquareHolder = (FoursquareHolder) mHolder; + + foursquareHolder.vVenueName.setText(foursquareCard.getVenueName()); + foursquareHolder.vAddress.setText(foursquareCard.getVenueAddress()); + //TODO place image with url + // foursquareHolder.vImage.setImage(foursquareCard.getVenuePhotoURL()); + foursquareHolder.vCardView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //TODO send to detail fragment with card ID + foursquareHolder.vCardView.setCardBackgroundColor(Color.GRAY); + } + }); + break; + + case TYPE_FACEBOOK: + + FacebookCard facebookCard = (FacebookCard)mParentCardList.get(position); + final FacebookHolder facebookHolder = (FacebookHolder) mHolder; + + facebookHolder.vTime.setText(facebookCard.getCreatedTime()); + facebookHolder.vContent.setText(facebookCard.getMessage()); + facebookHolder.vName.setText(facebookCard.getUsername()); + + break; + case TYPE_REDDIT: + + RedditCard redditCard = (RedditCard)mParentCardList.get(position); + final RedditHolder redditHolder = (RedditHolder) mHolder; + + redditHolder.vTitle.setText(redditCard.getmTitle()); + redditHolder.vScore.setText(Integer.toString(redditCard.getmScore())); + redditHolder.vNumOfComments.setText(Integer.toString(redditCard.getmNumOfComment()) + " comments"); + redditHolder.vAuthor.setText("By: " + redditCard.getmAuthor() + " to " + redditCard.getmSubreddit()); + redditHolder.vCardView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + //TODO send to detail fragment with card ID + redditHolder.vCardView.setBackgroundColor(Color.GRAY); + } + }); + } + mHolder = null; + } + + + @Override + public int getItemCount() { + return mParentCardList.size(); + } + + @Override + public int getItemViewType(int position) { + //Identify the type of card at this index/position of our array as we go through the array + mCurrentCardType = mParentCardList.get(position).getmCardType(); + return mCurrentCardType; + } + + //Parent Holder can be any card type holder. Create a card type holder with parent extended. If adding a new card type... + //declare member variables, and create constructor which casts the layout id's to the member variable + public static class ParentCardHolder extends RecyclerView.ViewHolder { +//All holders are rectangles but each specificHolders is it's own square/parrallelogram/rhombus/etc. + public ParentCardHolder(View itemView) { + super(itemView); + } + } +//A holder targets each vessel(view) inside the layout and prepares values to toss into the vessels(views) + public static class EventHolder extends ParentCardHolder { + + TextView vGroupName; + TextView vTime; + TextView vEventName; + TextView vNumberOfPeople; + CardView vCardView; + + + public EventHolder(View itemView) { + super(itemView); + + vGroupName = (TextView) itemView.findViewById(R.id.eventcard_groupname); + vTime = (TextView) itemView.findViewById(R.id.eventcard_time); + vEventName = (TextView) itemView.findViewById(R.id.eventcard_eventname); + vNumberOfPeople = (TextView) itemView.findViewById(R.id.eventcard_attendants); + vCardView = (CardView) itemView.findViewById(R.id.eventcard_cardview); + } + } + + public static class FacebookHolder extends ParentCardHolder { + + TextView vName, vContent, vTime; + + public FacebookHolder(View itemView) { + super(itemView); + + vContent = (TextView) itemView.findViewById(R.id.facebook_content); + vName = (TextView) itemView.findViewById(R.id.facebook_name); + vTime = (TextView) itemView.findViewById(R.id.facebook_time); + } + } + + public static class RedditHolder extends ParentCardHolder{ + + TextView vScore, vTitle, vAuthor, vNumOfComments; + CardView vCardView; + + public RedditHolder(View itemView){ + super(itemView); + + vScore = (TextView) itemView.findViewById(R.id.reddit_card_score); + vTitle = (TextView) itemView.findViewById(R.id.reddit_card_title); + vAuthor = (TextView) itemView.findViewById(R.id.reddit_card_author_and_subreddit); + vNumOfComments = (TextView) itemView.findViewById(R.id.reddit_card_numberofcomments); + vCardView = (CardView) itemView.findViewById(R.id.reddit_card_cardview); + } + } + + public static class FoursquareHolder extends ParentCardHolder{ + + TextView vVenueName, vAddress; + ImageView vImage; + CardView vCardView; + + public FoursquareHolder(View itemView) { + super(itemView); + vVenueName = (TextView) itemView.findViewById(R.id.foursquarecard_venueName); + vAddress = (TextView) itemView.findViewById(R.id.foursquarecard_address); + vImage = (ImageView) itemView.findViewById(R.id.foursquarecard_image); + vCardView = (CardView) itemView.findViewById(R.id.foursquarecard_cardView); + + } + } + + + public static class WeatherHolder extends ParentCardHolder { + + TextView vCurrentDate, vCurrentTemp, vCurrentLocation; + ImageView vCurrentImage; + + TextView vDay1Date, vDay1High, vDay1Low; + ImageView vDay1Image; + + TextView vDay2Date, vDay2High, vDay2Low; + ImageView vDay2Image; + + TextView vDay3Date, vDay3High, vDay3Low; + ImageView vDay3Image; + + TextView vDay4Date, vDay4High, vDay4Low; + ImageView vDay4Image; + + TextView vDay5Date, vDay5High, vDay5Low; + ImageView vDay5Image; + + public WeatherHolder(View itemView) { + super(itemView); + + vCurrentDate = (TextView) itemView.findViewById(R.id.weathercard_current_date); + vCurrentTemp = (TextView) itemView.findViewById(R.id.weathercard_current_temp); + vCurrentLocation = (TextView) itemView.findViewById(R.id.weathercard_current_location); + vCurrentImage = (ImageView) itemView.findViewById(R.id.weathercard_current_image); + + vDay1Date = (TextView) itemView.findViewById(R.id.weathercard_day1_date); + vDay1High = (TextView) itemView.findViewById(R.id.weathercard_day1_high); + vDay1Image = (ImageView) itemView.findViewById(R.id.weathercard_day1_image); + vDay1Low = (TextView) itemView.findViewById(R.id.weathercard_day1_low); + + vDay2Date = (TextView) itemView.findViewById(R.id.weathercard_day2_date); + vDay2High = (TextView) itemView.findViewById(R.id.weathercard_day2_high); + vDay2Image = (ImageView) itemView.findViewById(R.id.weathercard_day2_image); + vDay2Low = (TextView) itemView.findViewById(R.id.weathercard_day2_low); + + vDay3Date = (TextView) itemView.findViewById(R.id.weathercard_day3_date); + vDay3High = (TextView) itemView.findViewById(R.id.weathercard_day3_high); + vDay3Image = (ImageView) itemView.findViewById(R.id.weathercard_day3_image); + vDay3Low = (TextView) itemView.findViewById(R.id.weathercard_day3_low); + + vDay4Date = (TextView) itemView.findViewById(R.id.weathercard_day4_date); + vDay4High = (TextView) itemView.findViewById(R.id.weathercard_day4_high); + vDay4Image = (ImageView) itemView.findViewById(R.id.weathercard_day4_image); + vDay4Low = (TextView) itemView.findViewById(R.id.weathercard_day4_low); + + vDay5Date = (TextView) itemView.findViewById(R.id.weathercard_day5_date); + vDay5High = (TextView) itemView.findViewById(R.id.weathercard_day5_high); + vDay5Image = (ImageView) itemView.findViewById(R.id.weathercard_day5_image); + vDay5Low = (TextView) itemView.findViewById(R.id.weathercard_day5_low); + } + } + +} + diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/EventCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/EventCard.java new file mode 100644 index 0000000..7e16db1 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/EventCard.java @@ -0,0 +1,94 @@ +package com.example.android.lately.Cards; + +/** + * Created by perrycooperman on 3/8/16. + */ +public class EventCard extends ParentCard { + String time; + String group; + String event; + String numberOfPeople; + String eventDescription; + String venueAddress; + String venueName; + String eventUrl; + + public EventCard(String event, String eventDescription, String eventUrl, String group, String numberOfPeople, String time, String venueAddress, String venueName, int mCardType, int mTabType, int mId) { + super(mCardType, mTabType, mId); + this.event = event; + this.eventDescription = eventDescription; + this.eventUrl = eventUrl; + this.group = group; + this.numberOfPeople = numberOfPeople; + this.time = time; + this.venueAddress = venueAddress; + this.venueName = venueName; + } + + public String getEventDescription() { + return eventDescription; + } + + public void setEventDescription(String eventDescription) { + this.eventDescription = eventDescription; + } + + public String getEventUrl() { + return eventUrl; + } + + public void setEventUrl(String eventUrl) { + this.eventUrl = eventUrl; + } + + public String getVenueAddress() { + return venueAddress; + } + + public void setVenueAddress(String venueAddress) { + this.venueAddress = venueAddress; + } + + public String getVenueName() { + return venueName; + } + + public void setVenueName(String venueName) { + this.venueName = venueName; + } + + public String getTime() { + return time; + } + + public void setTime(String time) { + this.time = time; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getEvent() { + return event; + } + + public void setEvent(String event) { + this.event = event; + } + + public String getNumberOfPeople() { + return numberOfPeople; + } + + public void setNumberOfPeople(String numberOfPeople) { + this.numberOfPeople = numberOfPeople; + } + + + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/FacebookCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/FacebookCard.java new file mode 100644 index 0000000..14fba90 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/FacebookCard.java @@ -0,0 +1,51 @@ +package com.example.android.lately.Cards; + +/** + * Created by Wasabi on 3/11/2016. + */ +public class FacebookCard extends ParentCard{ + String username; + String createdTime; + String message; + String imageUrl; + + public FacebookCard(String createdTime, String imageUrl, String message, String username, int mCardType, int mTabType, int mId) { + super(mCardType, mTabType, mId); + this.createdTime = createdTime; + this.imageUrl = imageUrl; + this.message = message; + this.username = username; + } + + public String getCreatedTime() { + return createdTime; + } + + public void setCreatedTime(String createdTime) { + this.createdTime = createdTime; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/FoursquareCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/FoursquareCard.java new file mode 100644 index 0000000..65e31c4 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/FoursquareCard.java @@ -0,0 +1,64 @@ +package com.example.android.lately.Cards; + +import java.util.ArrayList; + +/** + * Created by Wasabi on 3/11/2016. + */ +public class FoursquareCard extends ParentCard { + + String venueId; + String venueName; + String venueAddress; + String venueUrl; + String venuePhotoUrl; + + public FoursquareCard(String venueAddress, String venueId, String venueName, String venueUrl, String venuePhotoUrl,int mCardType, int mTabType, int mId) { + super(mCardType, mTabType, mId); + this.venueAddress = venueAddress; + this.venueId = venueId; + this.venueName = venueName; + this.venueUrl = venueUrl; + this.venuePhotoUrl = venuePhotoUrl; + } + + public String getVenuePhotoUrl() { + return venuePhotoUrl; + } + + public void setVenuePhotoUrl(String venuePhotoUrl) { + this.venuePhotoUrl = venuePhotoUrl; + } + + public String getVenueAddress() { + return venueAddress; + } + + public void setVenueAddress(String venueAddress) { + this.venueAddress = venueAddress; + } + + public String getVenueId() { + return venueId; + } + + public void setVenueId(String venueId) { + this.venueId = venueId; + } + + public String getVenueName() { + return venueName; + } + + public void setVenueName(String venueName) { + this.venueName = venueName; + } + + public String getVenueUrl() { + return venueUrl; + } + + public void setVenueUrl(String venueUrl) { + this.venueUrl = venueUrl; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/LargeArticleCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/LargeArticleCard.java new file mode 100644 index 0000000..94dbbe0 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/LargeArticleCard.java @@ -0,0 +1,48 @@ +package com.example.android.lately.Cards; + +import org.w3c.dom.Comment; + +import java.util.ArrayList; + +/** + * Created by ShowMe on 3/8/16. + */ +public class LargeArticleCard extends ParentCard { + String mSource; + String mTitle; + String mTime; + + + public LargeArticleCard(String mSource, String mTitle, String mTime, int cardType, int tabType, int id) { + super(cardType, tabType, id); + this.mSource = mSource; + this.mTitle = mTitle; + this.mTime = mTime; + } + + public String getmSource() { + return mSource; + } + + public void setmSource(String mSource) { + this.mSource = mSource; + } + + public String getmTitle() { + return mTitle; + } + + public void setmTitle(String mTitle) { + this.mTitle = mTitle; + } + + public String getmTime() { + return mTime; + } + + public void setmTime(String mTime) { + this.mTime = mTime; + } + + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/ParentCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/ParentCard.java new file mode 100644 index 0000000..212f07a --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/ParentCard.java @@ -0,0 +1,41 @@ +package com.example.android.lately.Cards; + +/** + * Created by ShowMe on 3/8/16. + */ +public class ParentCard { + int mCardType; + int mId; + int mTabType; + + public ParentCard(int mCardType, int mTabType, int mId) { + this.mCardType = mCardType; + this.mId = mId; + this.mTabType = mTabType; + + } + + public int getmTabType() { + return mTabType; + } + + public void setmTabType(int mTabType) { + this.mTabType = mTabType; + } + + public int getmId() { + return mId; + } + + public void setmId(int mId) { + this.mId = mId; + } + + public int getmCardType() { + return mCardType; + } + + public void setmCardType(int mCardType) { + this.mCardType = mCardType; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/RedditCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/RedditCard.java new file mode 100644 index 0000000..a89a701 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/RedditCard.java @@ -0,0 +1,104 @@ +package com.example.android.lately.Cards; + +import java.util.ArrayList; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class RedditCard extends ParentCard{ + + String mTitle; + String mTime; + String mContent; + String mAuthor; + ArrayList mComments; + int mScore; + int mNumOfComment; + String mSubreddit; + String mUrl; + + public RedditCard(String mAuthor, ArrayList mComments, String mContent, int mNumOfComment, int mScore, String mSubreddit, String mTime, String mTitle, String mUrl, int cardType, int tabType, int id) { + super(cardType, tabType, id); + this.mAuthor = mAuthor; + this.mComments = mComments; + this.mContent = mContent; + this.mNumOfComment = mNumOfComment; + this.mScore = mScore; + this.mSubreddit = mSubreddit; + this.mTime = mTime; + this.mTitle = mTitle; + this.mUrl = mUrl; + } + + public String getmUrl() { + return mUrl; + } + + public void setmUrl(String mUrl) { + this.mUrl = mUrl; + } + + public int getmNumOfComment() { + return mNumOfComment; + } + + public void setmNumOfComment(int mNumOfComment) { + this.mNumOfComment = mNumOfComment; + } + + public String getmAuthor() { + return mAuthor; + } + + public void setmAuthor(String mAuthor) { + this.mAuthor = mAuthor; + } + + public ArrayList getmComments() { + return mComments; + } + + public void setmComments(ArrayList mComments) { + this.mComments = mComments; + } + + public String getmContent() { + return mContent; + } + + public void setmContent(String mContent) { + this.mContent = mContent; + } + + public int getmScore() { + return mScore; + } + + public void setmScore(int mScore) { + this.mScore = mScore; + } + + public String getmSubreddit() { + return mSubreddit; + } + + public void setmSubreddit(String mSubreddit) { + this.mSubreddit = mSubreddit; + } + + public String getmTime() { + return mTime; + } + + public void setmTime(String mTime) { + this.mTime = mTime; + } + + public String getmTitle() { + return mTitle; + } + + public void setmTitle(String mTitle) { + this.mTitle = mTitle; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/RedditComment.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/RedditComment.java new file mode 100644 index 0000000..f56531c --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/RedditComment.java @@ -0,0 +1,60 @@ +package com.example.android.lately.Cards; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class RedditComment extends ParentCard{ + String mAuthor; + String mContent; + String mTime; + int mScore; + int mLevel; + + public RedditComment(String mAuthor, String mContent, int mScore, String mTime, int cardType, int tabType, int id) { + super(cardType, tabType, id); + this.mAuthor = mAuthor; + this.mContent = mContent; + this.mScore = mScore; + this.mTime = mTime; + } + + public int getmLevel() { + return mLevel; + } + + public void setmLevel(int mLevel) { + this.mLevel = mLevel; + } + + public String getmAuthor() { + return mAuthor; + } + + public void setmAuthor(String mAuthor) { + this.mAuthor = mAuthor; + } + + public String getmContent() { + return mContent; + } + + public void setmContent(String mContent) { + this.mContent = mContent; + } + + public int getmScore() { + return mScore; + } + + public void setmScore(int mScore) { + this.mScore = mScore; + } + + public String getmTime() { + return mTime; + } + + public void setmTime(String mTime) { + this.mTime = mTime; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/SmallArticleCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/SmallArticleCard.java new file mode 100644 index 0000000..ab75157 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/SmallArticleCard.java @@ -0,0 +1,46 @@ +package com.example.android.lately.Cards; + +/** + * Created by ShowMe on 3/8/16. + */ +public class SmallArticleCard extends ParentCard { + + String mSource; + String mTitle; + String mTime; + + + public SmallArticleCard(String mSource, String mTitle, String mTime, int cardType, int tabType, int id) { + super(cardType, tabType, id); + this.mSource = mSource; + this.mTitle = mTitle; + this.mTime = mTime; + } + + //to do: add images + + + public String getmSource() { + return mSource; + } + + public void setmSource(String mSource) { + this.mSource = mSource; + } + + public String getmTitle() { + return mTitle; + } + + public void setmTitle(String mTitle) { + this.mTitle = mTitle; + } + + public String getmTime() { + return mTime; + } + + public void setmTime(String mTime) { + this.mTime = mTime; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Cards/WeatherCard.java b/Late.ly/app/src/main/java/com/example/android/lately/Cards/WeatherCard.java new file mode 100644 index 0000000..41992c9 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Cards/WeatherCard.java @@ -0,0 +1,94 @@ +package com.example.android.lately.Cards; + +import java.util.List; + +/** + * Created by perrycooperman on 3/10/16. + */ +public class WeatherCard extends ParentCard { + String mCurrentTemp; + String mCurrentSummary; + String mCurrentLocation; + String mFormattedCurrentDate; + String[] mNextFiveDaysDates; + String[] mNextFiveDaysSummary; + String[] mNextFiveDaysHighTemp ; + String[] mNextFiveDaysLowTemp; + + public WeatherCard(String mCurrentTemp, String mCurrentSummary, String mCurrentLocation, String mFormattedCurrentDate, String[] mNextFiveDaysDates, String[] mNextFiveDaysSummary, String[] mNextFiveDaysHighTemp, String[] mNextFiveDaysLowTemp, int cardType, int tabType, int id) { + super(cardType, tabType, id); + this.mCurrentTemp = mCurrentTemp; + this.mCurrentSummary = mCurrentSummary; + this.mCurrentLocation = mCurrentLocation; + this.mFormattedCurrentDate = mFormattedCurrentDate; + this.mNextFiveDaysDates = mNextFiveDaysDates; + this.mNextFiveDaysSummary = mNextFiveDaysSummary; + this.mNextFiveDaysHighTemp = mNextFiveDaysHighTemp; + this.mNextFiveDaysLowTemp = mNextFiveDaysLowTemp; + } + + public String getmCurrentTemp() { + return mCurrentTemp; + } + + public void setmCurrentTemp(String mCurrentTemp) { + this.mCurrentTemp = mCurrentTemp; + } + + public String getmCurrentSummary() { + return mCurrentSummary; + } + + public void setmCurrentSummary(String mcurrentSummary) { + this.mCurrentSummary = mcurrentSummary; + } + + public String getmCurrentLocation() { + return mCurrentLocation; + } + + public void setmCurrentLocation(String mCurrentLocation) { + this.mCurrentLocation = mCurrentLocation; + } + + public String getmFormattedCurrentDate() { + return mFormattedCurrentDate; + } + + public void setmFormattedCurrentDate(String mFormattedCurrentDate) { + this.mFormattedCurrentDate = mFormattedCurrentDate; + } + + public String[] getmNextFiveDaysDates() { + return mNextFiveDaysDates; + } + + public void setmNextFiveDaysDates(String[] mNextFiveDaysDates) { + this.mNextFiveDaysDates = mNextFiveDaysDates; + } + + public String[] getmNextFiveDaysSummary() { + return mNextFiveDaysSummary; + } + + public void setmNextFiveDaysSummary(String[] mNextFiveDaysSummary) { + this.mNextFiveDaysSummary = mNextFiveDaysSummary; + } + + public String[] getmNextFiveDaysHighTemp() { + return mNextFiveDaysHighTemp; + } + + public void setmNextFiveDaysHighTemp(String[] mNextFiveDaysHighTemp) { + this.mNextFiveDaysHighTemp = mNextFiveDaysHighTemp; + } + + public String[] getmNextFiveDaysLowTemp() { + return mNextFiveDaysLowTemp; + } + + public void setmNextFiveDaysLowTemp(String[] mNextFiveDaysLowTemp) { + this.mNextFiveDaysLowTemp = mNextFiveDaysLowTemp; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Currently.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Currently.java new file mode 100644 index 0000000..d7d4853 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Currently.java @@ -0,0 +1,94 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Currently { + + @SerializedName("time") + @Expose + private Integer time; + @SerializedName("summary") + @Expose + private String summary; + @SerializedName("icon") + @Expose + private String icon; + @SerializedName("temperature") + @Expose + private Double temperature; + + + + public Integer getTime() { + return time; + } + + /** + * + * @param time + * The time + */ + public void setTime(Integer time) { + this.time = time; + } + + /** + * + * @return + * The summary + */ + public String getSummary() { + return summary; + } + + /** + * + * @param summary + * The summary + */ + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * + * @return + * The icon + */ + public String getIcon() { + return icon; + } + + /** + * + * @param icon + * The icon + */ + public void setIcon(String icon) { + this.icon = icon; + } + + + /** + * + * @return + * The temperature + */ + public Double getTemperature() { + return temperature; + } + + /** + * + * @param temperature + * The temperature + */ + public void setTemperature(Double temperature) { + this.temperature = temperature; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Daily.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Daily.java new file mode 100644 index 0000000..1931250 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Daily.java @@ -0,0 +1,78 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Daily { + + @SerializedName("summary") + @Expose + private String summary; + @SerializedName("icon") + @Expose + private String icon; + @SerializedName("data") + @Expose + private List data = new ArrayList(); + + /** + * + * @return + * The summary + */ + public String getSummary() { + return summary; + } + + /** + * + * @param summary + * The summary + */ + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * + * @return + * The icon + */ + public String getIcon() { + return icon; + } + + /** + * + * @param icon + * The icon + */ + public void setIcon(String icon) { + this.icon = icon; + } + + /** + * + * @return + * The data + */ + public List getData() { + return data; + } + + /** + * + * @param data + * The data + */ + public void setData(List data) { + this.data = data; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Datum.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Datum.java new file mode 100644 index 0000000..3c51253 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Datum.java @@ -0,0 +1,93 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Datum { + + + @SerializedName("time") + @Expose + private Integer time; + @SerializedName("summary") + @Expose + private String summary; + @SerializedName("icon") + @Expose + private String icon; + @SerializedName("temperature") + @Expose + private Double temperature; + public Integer getTime() { + return time; + } + + /** + * + * @param time + * The time + */ + public void setTime(Integer time) { + this.time = time; + } + + /** + * + * @return + * The summary + */ + public String getSummary() { + return summary; + } + + /** + * + * @param summary + * The summary + */ + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * + * @return + * The icon + */ + public String getIcon() { + return icon; + } + + /** + * + * @param icon + * The icon + */ + public void setIcon(String icon) { + this.icon = icon; + } + + + + /** + * + * @return + * The temperature + */ + public Double getTemperature() { + return temperature; + } + + /** + * + * @param temperature + * The temperature + */ + public void setTemperature(Double temperature) { + this.temperature = temperature; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Datum_.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Datum_.java new file mode 100644 index 0000000..ff6bfab --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Datum_.java @@ -0,0 +1,518 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Datum_ { + + @SerializedName("time") + @Expose + private Integer time; + @SerializedName("summary") + @Expose + private String summary; + @SerializedName("icon") + @Expose + private String icon; + @SerializedName("sunriseTime") + @Expose + private Integer sunriseTime; + @SerializedName("sunsetTime") + @Expose + private Integer sunsetTime; + @SerializedName("moonPhase") + @Expose + private Double moonPhase; + @SerializedName("temperatureMin") + @Expose + private Double temperatureMin; + @SerializedName("temperatureMinTime") + @Expose + private Integer temperatureMinTime; + @SerializedName("temperatureMax") + @Expose + private Double temperatureMax; + @SerializedName("temperatureMaxTime") + @Expose + private Integer temperatureMaxTime; + @SerializedName("apparentTemperatureMin") + @Expose + private Double apparentTemperatureMin; + @SerializedName("apparentTemperatureMinTime") + @Expose + private Integer apparentTemperatureMinTime; + @SerializedName("apparentTemperatureMax") + @Expose + private Double apparentTemperatureMax; + @SerializedName("apparentTemperatureMaxTime") + @Expose + private Integer apparentTemperatureMaxTime; + @SerializedName("dewPoint") + @Expose + private Double dewPoint; + @SerializedName("humidity") + @Expose + private Double humidity; + @SerializedName("windSpeed") + @Expose + private Double windSpeed; + @SerializedName("windBearing") + @Expose + private Integer windBearing; + @SerializedName("visibility") + @Expose + private double visibility; + @SerializedName("cloudCover") + @Expose + private Double cloudCover; + @SerializedName("pressure") + @Expose + private Double pressure; + @SerializedName("ozone") + @Expose + private Double ozone; + @SerializedName("precipIntensityMaxTime") + @Expose + private Integer precipIntensityMaxTime; + @SerializedName("precipType") + @Expose + private String precipType; + + /** + * + * @return + * The time + */ + public Integer getTime() { + return time; + } + + /** + * + * @param time + * The time + */ + public void setTime(Integer time) { + this.time = time; + } + + /** + * + * @return + * The summary + */ + public String getSummary() { + return summary; + } + + /** + * + * @param summary + * The summary + */ + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * + * @return + * The icon + */ + public String getIcon() { + return icon; + } + + /** + * + * @param icon + * The icon + */ + public void setIcon(String icon) { + this.icon = icon; + } + + /** + * + * @return + * The sunriseTime + */ + public Integer getSunriseTime() { + return sunriseTime; + } + + /** + * + * @param sunriseTime + * The sunriseTime + */ + public void setSunriseTime(Integer sunriseTime) { + this.sunriseTime = sunriseTime; + } + + /** + * + * @return + * The sunsetTime + */ + public Integer getSunsetTime() { + return sunsetTime; + } + + /** + * + * @param sunsetTime + * The sunsetTime + */ + public void setSunsetTime(Integer sunsetTime) { + this.sunsetTime = sunsetTime; + } + + /** + * + * @return + * The moonPhase + */ + public Double getMoonPhase() { + return moonPhase; + } + + /** + * + * @param moonPhase + * The moonPhase + */ + public void setMoonPhase(Double moonPhase) { + this.moonPhase = moonPhase; + } + + + + /** + * + * @return + * The temperatureMin + */ + public Double getTemperatureMin() { + return temperatureMin; + } + + /** + * + * @param temperatureMin + * The temperatureMin + */ + public void setTemperatureMin(Double temperatureMin) { + this.temperatureMin = temperatureMin; + } + + /** + * + * @return + * The temperatureMinTime + */ + public Integer getTemperatureMinTime() { + return temperatureMinTime; + } + + /** + * + * @param temperatureMinTime + * The temperatureMinTime + */ + public void setTemperatureMinTime(Integer temperatureMinTime) { + this.temperatureMinTime = temperatureMinTime; + } + + /** + * + * @return + * The temperatureMax + */ + public Double getTemperatureMax() { + return temperatureMax; + } + + /** + * + * @param temperatureMax + * The temperatureMax + */ + public void setTemperatureMax(Double temperatureMax) { + this.temperatureMax = temperatureMax; + } + + /** + * + * @return + * The temperatureMaxTime + */ + public Integer getTemperatureMaxTime() { + return temperatureMaxTime; + } + + /** + * + * @param temperatureMaxTime + * The temperatureMaxTime + */ + public void setTemperatureMaxTime(Integer temperatureMaxTime) { + this.temperatureMaxTime = temperatureMaxTime; + } + + /** + * + * @return + * The apparentTemperatureMin + */ + public Double getApparentTemperatureMin() { + return apparentTemperatureMin; + } + + /** + * + * @param apparentTemperatureMin + * The apparentTemperatureMin + */ + public void setApparentTemperatureMin(Double apparentTemperatureMin) { + this.apparentTemperatureMin = apparentTemperatureMin; + } + + /** + * + * @return + * The apparentTemperatureMinTime + */ + public Integer getApparentTemperatureMinTime() { + return apparentTemperatureMinTime; + } + + /** + * + * @param apparentTemperatureMinTime + * The apparentTemperatureMinTime + */ + public void setApparentTemperatureMinTime(Integer apparentTemperatureMinTime) { + this.apparentTemperatureMinTime = apparentTemperatureMinTime; + } + + /** + * + * @return + * The apparentTemperatureMax + */ + public Double getApparentTemperatureMax() { + return apparentTemperatureMax; + } + + /** + * + * @param apparentTemperatureMax + * The apparentTemperatureMax + */ + public void setApparentTemperatureMax(Double apparentTemperatureMax) { + this.apparentTemperatureMax = apparentTemperatureMax; + } + + /** + * + * @return + * The apparentTemperatureMaxTime + */ + public Integer getApparentTemperatureMaxTime() { + return apparentTemperatureMaxTime; + } + + /** + * + * @param apparentTemperatureMaxTime + * The apparentTemperatureMaxTime + */ + public void setApparentTemperatureMaxTime(Integer apparentTemperatureMaxTime) { + this.apparentTemperatureMaxTime = apparentTemperatureMaxTime; + } + + /** + * + * @return + * The dewPoint + */ + public Double getDewPoint() { + return dewPoint; + } + + /** + * + * @param dewPoint + * The dewPoint + */ + public void setDewPoint(Double dewPoint) { + this.dewPoint = dewPoint; + } + + /** + * + * @return + * The humidity + */ + public Double getHumidity() { + return humidity; + } + + /** + * + * @param humidity + * The humidity + */ + public void setHumidity(Double humidity) { + this.humidity = humidity; + } + + /** + * + * @return + * The windSpeed + */ + public Double getWindSpeed() { + return windSpeed; + } + + /** + * + * @param windSpeed + * The windSpeed + */ + public void setWindSpeed(Double windSpeed) { + this.windSpeed = windSpeed; + } + + /** + * + * @return + * The windBearing + */ + public Integer getWindBearing() { + return windBearing; + } + + /** + * + * @param windBearing + * The windBearing + */ + public void setWindBearing(Integer windBearing) { + this.windBearing = windBearing; + } + + /** + * + * @return + * The visibility + */ + public double getVisibility() { + return visibility; + } + + /** + * + * @param visibility + * The visibility + */ + public void setVisibility(double visibility) { + this.visibility = visibility; + } + + /** + * + * @return + * The cloudCover + */ + public Double getCloudCover() { + return cloudCover; + } + + /** + * + * @param cloudCover + * The cloudCover + */ + public void setCloudCover(Double cloudCover) { + this.cloudCover = cloudCover; + } + + /** + * + * @return + * The pressure + */ + public Double getPressure() { + return pressure; + } + + /** + * + * @param pressure + * The pressure + */ + public void setPressure(Double pressure) { + this.pressure = pressure; + } + + /** + * + * @return + * The ozone + */ + public Double getOzone() { + return ozone; + } + + /** + * + * @param ozone + * The ozone + */ + public void setOzone(Double ozone) { + this.ozone = ozone; + } + + /** + * + * @return + * The precipIntensityMaxTime + */ + public Integer getPrecipIntensityMaxTime() { + return precipIntensityMaxTime; + } + + /** + * + * @param precipIntensityMaxTime + * The precipIntensityMaxTime + */ + public void setPrecipIntensityMaxTime(Integer precipIntensityMaxTime) { + this.precipIntensityMaxTime = precipIntensityMaxTime; + } + + /** + * + * @return + * The precipType + */ + public String getPrecipType() { + return precipType; + } + + /** + * + * @param precipType + * The precipType + */ + public void setPrecipType(String precipType) { + this.precipType = precipType; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Flags.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Flags.java new file mode 100644 index 0000000..0a920f4 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Flags.java @@ -0,0 +1,140 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Flags { + + @SerializedName("sources") + @Expose + private List sources = new ArrayList(); + @SerializedName("darksky-stations") + @Expose + private List darkskyStations = new ArrayList(); + @SerializedName("lamp-stations") + @Expose + private List lampStations = new ArrayList(); + @SerializedName("isd-stations") + @Expose + private List isdStations = new ArrayList(); + @SerializedName("madis-stations") + @Expose + private List madisStations = new ArrayList(); + @SerializedName("units") + @Expose + private String units; + + /** + * + * @return + * The sources + */ + public List getSources() { + return sources; + } + + /** + * + * @param sources + * The sources + */ + public void setSources(List sources) { + this.sources = sources; + } + + /** + * + * @return + * The darkskyStations + */ + public List getDarkskyStations() { + return darkskyStations; + } + + /** + * + * @param darkskyStations + * The darksky-stations + */ + public void setDarkskyStations(List darkskyStations) { + this.darkskyStations = darkskyStations; + } + + /** + * + * @return + * The lampStations + */ + public List getLampStations() { + return lampStations; + } + + /** + * + * @param lampStations + * The lamp-stations + */ + public void setLampStations(List lampStations) { + this.lampStations = lampStations; + } + + /** + * + * @return + * The isdStations + */ + public List getIsdStations() { + return isdStations; + } + + /** + * + * @param isdStations + * The isd-stations + */ + public void setIsdStations(List isdStations) { + this.isdStations = isdStations; + } + + /** + * + * @return + * The madisStations + */ + public List getMadisStations() { + return madisStations; + } + + /** + * + * @param madisStations + * The madis-stations + */ + public void setMadisStations(List madisStations) { + this.madisStations = madisStations; + } + + /** + * + * @return + * The units + */ + public String getUnits() { + return units; + } + + /** + * + * @param units + * The units + */ + public void setUnits(String units) { + this.units = units; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Hourly.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Hourly.java new file mode 100644 index 0000000..9616cac --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Hourly.java @@ -0,0 +1,79 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Hourly { + + + @SerializedName("summary") + @Expose + private String summary; + @SerializedName("icon") + @Expose + private String icon; + @SerializedName("data") + @Expose + private List data = new ArrayList(); + + /** + * + * @return + * The summary + */ + public String getSummary() { + return summary; + } + + /** + * + * @param summary + * The summary + */ + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * + * @return + * The icon + */ + public String getIcon() { + return icon; + } + + /** + * + * @param icon + * The icon + */ + public void setIcon(String icon) { + this.icon = icon; + } + + /** + * + * @return + * The data + */ + public List getData() { + return data; + } + + /** + * + * @param data + * The data + */ + public void setData(List data) { + this.data = data; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Weather.java b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Weather.java new file mode 100644 index 0000000..0925855 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Forecast/Weather.java @@ -0,0 +1,182 @@ +package com.example.android.lately.Forecast; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Weather { + + @SerializedName("latitude") + @Expose + private Double latitude; + @SerializedName("longitude") + @Expose + private Double longitude; + @SerializedName("timezone") + @Expose + private String timezone; + @SerializedName("offset") + @Expose + private Integer offset; + @SerializedName("currently") + @Expose + private Currently currently; + @SerializedName("hourly") + @Expose + private Hourly hourly; + @SerializedName("daily") + @Expose + private Daily daily; + @SerializedName("flags") + @Expose + private Flags flags; + + /** + * + * @return + * The latitude + */ + public Double getLatitude() { + return latitude; + } + + /** + * + * @param latitude + * The latitude + */ + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + /** + * + * @return + * The longitude + */ + public Double getLongitude() { + return longitude; + } + + /** + * + * @param longitude + * The longitude + */ + public void setLongitude(Double longitude) { + this.longitude = longitude; + } + + /** + * + * @return + * The timezone + */ + public String getTimezone() { + return timezone; + } + + /** + * + * @param timezone + * The timezone + */ + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + /** + * + * @return + * The offset + */ + public Integer getOffset() { + return offset; + } + + /** + * + * @param offset + * The offset + */ + public void setOffset(Integer offset) { + this.offset = offset; + } + + /** + * + * @return + * The currently + */ + public Currently getCurrently() { + return currently; + } + + /** + * + * @param currently + * The currently + */ + public void setCurrently(Currently currently) { + this.currently = currently; + } + + /** + * + * @return + * The hourly + */ + public Hourly getHourly() { + return hourly; + } + + /** + * + * @param hourly + * The hourly + */ + public void setHourly(Hourly hourly) { + this.hourly = hourly; + } + + /** + * + * @return + * The daily + */ + public Daily getDaily() { + return daily; + } + + /** + * + * @param daily + * The daily + */ + public void setDaily(Daily daily) { + this.daily = daily; + } + + /** + * + * @return + * The flags + */ + public Flags getFlags() { + return flags; + } + + /** + * + * @param flags + * The flags + */ + public void setFlags(Flags flags) { + this.flags = flags; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/FoursquarePhotos.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/FoursquarePhotos.java new file mode 100644 index 0000000..2efa740 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/FoursquarePhotos.java @@ -0,0 +1,33 @@ +package com.example.android.lately.Foursquare.FoursquarePhotos; + +import com.example.android.lately.Foursquare.Meta; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class FoursquarePhotos { + @SerializedName("response") + @Expose + private Response response; + + + /** + * + * @return + * The response + */ + public Response getResponse() { + return response; + } + + /** + * + * @param response + * The response + */ + public void setResponse(Response response) { + this.response = response; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Item.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Item.java new file mode 100644 index 0000000..451da58 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Item.java @@ -0,0 +1,186 @@ +package com.example.android.lately.Foursquare.FoursquarePhotos; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Item { + + @SerializedName("id") + @Expose + private String id; + @SerializedName("createdAt") + @Expose + private Integer createdAt; + @SerializedName("prefix") + @Expose + private String prefix; + @SerializedName("suffix") + @Expose + private String suffix; + @SerializedName("width") + @Expose + private Integer width; + @SerializedName("height") + @Expose + private Integer height; + @SerializedName("user") + @Expose + private User user; + @SerializedName("visibility") + @Expose + private String visibility; + + /** + * + * @return + * The id + */ + public String getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(String id) { + this.id = id; + } + + /** + * + * @return + * The createdAt + */ + public Integer getCreatedAt() { + return createdAt; + } + + /** + * + * @param createdAt + * The createdAt + */ + public void setCreatedAt(Integer createdAt) { + this.createdAt = createdAt; + } + + + /** + * + * @return + * The prefix + */ + public String getPrefix() { + return prefix; + } + + /** + * + * @param prefix + * The prefix + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + /** + * + * @return + * The suffix + */ + public String getSuffix() { + return suffix; + } + + /** + * + * @param suffix + * The suffix + */ + public void setSuffix(String suffix) { + this.suffix = suffix; + } + + /** + * + * @return + * The width + */ + public Integer getWidth() { + return width; + } + + /** + * + * @param width + * The width + */ + public void setWidth(Integer width) { + this.width = width; + } + + /** + * + * @return + * The height + */ + public Integer getHeight() { + return height; + } + + /** + * + * @param height + * The height + */ + public void setHeight(Integer height) { + this.height = height; + } + + /** + * + * @return + * The user + */ + public User getUser() { + return user; + } + + /** + * + * @param user + * The user + */ + public void setUser(User user) { + this.user = user; + } + + /** + * + * @return + * The visibility + */ + public String getVisibility() { + return visibility; + } + + /** + * + * @param visibility + * The visibility + */ + public void setVisibility(String visibility) { + this.visibility = visibility; + } + + /** + * + * @return + * The checkin + */ +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Photo.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Photo.java new file mode 100644 index 0000000..2c246ba --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Photo.java @@ -0,0 +1,54 @@ +package com.example.android.lately.Foursquare.FoursquarePhotos; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Photo { + + @SerializedName("prefix") + @Expose + private String prefix; + @SerializedName("suffix") + @Expose + private String suffix; + + /** + * + * @return + * The prefix + */ + public String getPrefix() { + return prefix; + } + + /** + * + * @param prefix + * The prefix + */ + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + /** + * + * @return + * The suffix + */ + public String getSuffix() { + return suffix; + } + + /** + * + * @param suffix + * The suffix + */ + public void setSuffix(String suffix) { + this.suffix = suffix; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Photos.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Photos.java new file mode 100644 index 0000000..1826c34 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Photos.java @@ -0,0 +1,78 @@ +package com.example.android.lately.Foursquare.FoursquarePhotos; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Photos { + + + @SerializedName("count") + @Expose + private Integer count; + @SerializedName("items") + @Expose + private List items = new ArrayList(); + @SerializedName("dupesRemoved") + @Expose + private Integer dupesRemoved; + + /** + * + * @return + * The count + */ + public Integer getCount() { + return count; + } + + /** + * + * @param count + * The count + */ + public void setCount(Integer count) { + this.count = count; + } + + /** + * + * @return + * The items + */ + public List getItems() { + return items; + } + + /** + * + * @param items + * The items + */ + public void setItems(List items) { + this.items = items; + } + + /** + * + * @return + * The dupesRemoved + */ + public Integer getDupesRemoved() { + return dupesRemoved; + } + + /** + * + * @param dupesRemoved + * The dupesRemoved + */ + public void setDupesRemoved(Integer dupesRemoved) { + this.dupesRemoved = dupesRemoved; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Response.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Response.java new file mode 100644 index 0000000..4c78e92 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/Response.java @@ -0,0 +1,33 @@ +package com.example.android.lately.Foursquare.FoursquarePhotos; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Response { + + @SerializedName("photos") + @Expose + private Photos photos; + + /** + * + * @return + * The photos + */ + public Photos getPhotos() { + return photos; + } + + /** + * + * @param photos + * The photos + */ + public void setPhotos(Photos photos) { + this.photos = photos; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/User.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/User.java new file mode 100644 index 0000000..b2faf0e --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquarePhotos/User.java @@ -0,0 +1,117 @@ +package com.example.android.lately.Foursquare.FoursquarePhotos; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class User { + + + @SerializedName("id") + @Expose + private String id; + @SerializedName("firstName") + @Expose + private String firstName; + @SerializedName("lastName") + @Expose + private String lastName; + @SerializedName("gender") + @Expose + private String gender; + @SerializedName("photo") + @Expose + private Photo photo; + + /** + * + * @return + * The id + */ + public String getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(String id) { + this.id = id; + } + + /** + * + * @return + * The firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * + * @param firstName + * The firstName + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + * The lastName + */ + public String getLastName() { + return lastName; + } + + /** + * + * @param lastName + * The lastName + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + * The gender + */ + public String getGender() { + return gender; + } + + /** + * + * @param gender + * The gender + */ + public void setGender(String gender) { + this.gender = gender; + } + + /** + * + * @return + * The photo + */ + public Photo getPhoto() { + return photo; + } + + /** + * + * @param photo + * The photo + */ + public void setPhoto(Photo photo) { + this.photo = photo; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquareVenues.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquareVenues.java new file mode 100644 index 0000000..ece338a --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/FoursquareVenues.java @@ -0,0 +1,55 @@ +package com.example.android.lately.Foursquare; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class FoursquareVenues { + + + @SerializedName("meta") + @Expose + private Meta meta; + @SerializedName("response") + @Expose + private Response response; + + /** + * + * @return + * The meta + */ + public Meta getMeta() { + return meta; + } + + /** + * + * @param meta + * The meta + */ + public void setMeta(Meta meta) { + this.meta = meta; + } + + /** + * + * @return + * The response + */ + public Response getResponse() { + return response; + } + + /** + * + * @param response + * The response + */ + public void setResponse(Response response) { + this.response = response; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Location.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Location.java new file mode 100644 index 0000000..62308ed --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Location.java @@ -0,0 +1,224 @@ +package com.example.android.lately.Foursquare; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Location { + + @SerializedName("address") + @Expose + private String address; + @SerializedName("lat") + @Expose + private Double lat; + @SerializedName("lng") + @Expose + private Double lng; + @SerializedName("distance") + @Expose + private Long distance; + @SerializedName("postalCode") + @Expose + private String postalCode; + @SerializedName("cc") + @Expose + private String cc; + @SerializedName("city") + @Expose + private String city; + @SerializedName("state") + @Expose + private String state; + @SerializedName("country") + @Expose + private String country; + @SerializedName("formattedAddress") + @Expose + private List formattedAddress = new ArrayList(); + + /** + * + * @return + * The address + */ + public String getAddress() { + return address; + } + + /** + * + * @param address + * The address + */ + public void setAddress(String address) { + this.address = address; + } + + /** + * + * @return + * The lat + */ + public Double getLat() { + return lat; + } + + /** + * + * @param lat + * The lat + */ + public void setLat(Double lat) { + this.lat = lat; + } + + /** + * + * @return + * The lng + */ + public Double getLng() { + return lng; + } + + /** + * + * @param lng + * The lng + */ + public void setLng(Double lng) { + this.lng = lng; + } + + /** + * + * @return + * The distance + */ + public Long getDistance() { + return distance; + } + + /** + * + * @param distance + * The distance + */ + public void setDistance(Long distance) { + this.distance = distance; + } + + /** + * + * @return + * The postalCode + */ + public String getPostalCode() { + return postalCode; + } + + /** + * + * @param postalCode + * The postalCode + */ + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + /** + * + * @return + * The cc + */ + public String getCc() { + return cc; + } + + /** + * + * @param cc + * The cc + */ + public void setCc(String cc) { + this.cc = cc; + } + + /** + * + * @return + * The city + */ + public String getCity() { + return city; + } + + /** + * + * @param city + * The city + */ + public void setCity(String city) { + this.city = city; + } + + /** + * + * @return + * The state + */ + public String getState() { + return state; + } + + /** + * + * @param state + * The state + */ + public void setState(String state) { + this.state = state; + } + + /** + * + * @return + * The country + */ + public String getCountry() { + return country; + } + + /** + * + * @param country + * The country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * + * @return + * The formattedAddress + */ + public List getFormattedAddress() { + return formattedAddress; + } + + /** + * + * @param formattedAddress + * The formattedAddress + */ + public void setFormattedAddress(List formattedAddress) { + this.formattedAddress = formattedAddress; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Menu.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Menu.java new file mode 100644 index 0000000..a755605 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Menu.java @@ -0,0 +1,117 @@ +package com.example.android.lately.Foursquare; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Menu { + + @SerializedName("type") + @Expose + private String type; + @SerializedName("label") + @Expose + private String label; + @SerializedName("anchor") + @Expose + private String anchor; + @SerializedName("url") + @Expose + private String url; + @SerializedName("mobileUrl") + @Expose + private String mobileUrl; + + /** + * + * @return + * The type + */ + public String getType() { + return type; + } + + /** + * + * @param type + * The type + */ + public void setType(String type) { + this.type = type; + } + + /** + * + * @return + * The label + */ + public String getLabel() { + return label; + } + + /** + * + * @param label + * The label + */ + public void setLabel(String label) { + this.label = label; + } + + /** + * + * @return + * The anchor + */ + public String getAnchor() { + return anchor; + } + + /** + * + * @param anchor + * The anchor + */ + public void setAnchor(String anchor) { + this.anchor = anchor; + } + + /** + * + * @return + * The url + */ + public String getUrl() { + return url; + } + + /** + * + * @param url + * The url + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * + * @return + * The mobileUrl + */ + public String getMobileUrl() { + return mobileUrl; + } + + /** + * + * @param mobileUrl + * The mobileUrl + */ + public void setMobileUrl(String mobileUrl) { + this.mobileUrl = mobileUrl; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Meta.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Meta.java new file mode 100644 index 0000000..9993246 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Meta.java @@ -0,0 +1,31 @@ +package com.example.android.lately.Foursquare; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Meta { + @SerializedName("code") + @Expose + private Long code; + + /** + * + * @return + * The code + */ + public Long getCode() { + return code; + } + + /** + * + * @param code + * The code + */ + public void setCode(Long code) { + this.code = code; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Response.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Response.java new file mode 100644 index 0000000..9647e40 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Response.java @@ -0,0 +1,35 @@ +package com.example.android.lately.Foursquare; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Response { + + @SerializedName("venues") + @Expose + private List venues = new ArrayList(); + + /** + * + * @return + * The venues + */ + public List getVenues() { + return venues; + } + + /** + * + * @param venues + * The venues + */ + public void setVenues(List venues) { + this.venues = venues; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Venue.java b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Venue.java new file mode 100644 index 0000000..115a9c7 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Foursquare/Venue.java @@ -0,0 +1,252 @@ +package com.example.android.lately.Foursquare; + +import com.google.android.gms.games.stats.Stats; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Venue { + + private String id; + @SerializedName("name") + @Expose + private String name; + @SerializedName("location") + @Expose + private Location location; + @SerializedName("verified") + @Expose + private Boolean verified; + @SerializedName("stats") + @Expose + private Stats stats; + @SerializedName("url") + @Expose + private String url; + @SerializedName("hasMenu") + @Expose + private Boolean hasMenu; + @SerializedName("menu") + @Expose + private Menu menu; + @SerializedName("allowMenuUrlEdit") + @Expose + private Boolean allowMenuUrlEdit; + @SerializedName("referralId") + @Expose + private String referralId; + @SerializedName("venueChains") + @Expose + private List venueChains = new ArrayList(); + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * + * @return + * The name + */ + public String getName() { + return name; + } + + /** + * + * @param name + * The name + */ + public void setName(String name) { + this.name = name; + } + + /** + * + * @return + * The contact + */ + /** + * + * @return + * The location + */ + public Location getLocation() { + return location; + } + + /** + * + * @param location + * The location + */ + public void setLocation(Location location) { + this.location = location; + } + + /** + * + * @return + * The categories + */ + + /** + * + * @return + * The verified + */ + public Boolean getVerified() { + return verified; + } + + /** + * + * @param verified + * The verified + */ + public void setVerified(Boolean verified) { + this.verified = verified; + } + + /** + * + * @return + * The stats + */ + public Stats getStats() { + return stats; + } + + /** + * + * @param stats + * The stats + */ + public void setStats(Stats stats) { + this.stats = stats; + } + + /** + * + * @return + * The url + */ + public String getUrl() { + return url; + } + + /** + * + * @param url + * The url + */ + public void setUrl(String url) { + this.url = url; + } + + /** + * + * @return + * The hasMenu + */ + public Boolean getHasMenu() { + return hasMenu; + } + + /** + * + * @param hasMenu + * The hasMenu + */ + public void setHasMenu(Boolean hasMenu) { + this.hasMenu = hasMenu; + } + + /** + * + * @return + * The delivery + + /** + * + * @return + * The menu + */ + public Menu getMenu() { + return menu; + } + + /** + * + * @param menu + * The menu + */ + public void setMenu(Menu menu) { + this.menu = menu; + } + + /** + * + * @return + * The allowMenuUrlEdit + */ + public Boolean getAllowMenuUrlEdit() { + return allowMenuUrlEdit; + } + + /** + * + * @param allowMenuUrlEdit + * The allowMenuUrlEdit + */ + public void setAllowMenuUrlEdit(Boolean allowMenuUrlEdit) { + this.allowMenuUrlEdit = allowMenuUrlEdit; + } + + /** + * + * @return + * The specials + */ + public String getReferralId() { + return referralId; + } + + /** + * + * @param referralId + * The referralId + */ + public void setReferralId(String referralId) { + this.referralId = referralId; + } + + /** + * + * @return + * The venueChains + */ + public List getVenueChains() { + return venueChains; + } + + /** + * + * @param venueChains + * The venueChains + */ + public void setVenueChains(List venueChains) { + this.venueChains = venueChains; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/DetailsFragment.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/DetailsFragment.java new file mode 100644 index 0000000..4c56549 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/DetailsFragment.java @@ -0,0 +1,25 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.example.android.lately.R; + + +public class DetailsFragment extends Fragment { + + TextView mDetailsTest; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View view = inflater.inflate(R.layout.fragment_details, container, false); + mDetailsTest = (TextView) view.findViewById(R.id.detailsFragmentTextView); + mDetailsTest.setText("Java works\n\n\n\n\n\n bahaaahahahha"); + return view; + } +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/Fragment1.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/Fragment1.java new file mode 100644 index 0000000..4b5211e --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/Fragment1.java @@ -0,0 +1,99 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.EventCard; +import com.example.android.lately.Cards.FoursquareCard; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.Cards.RedditCard; +import com.example.android.lately.Cards.RedditComment; +import com.example.android.lately.Cards.SmallArticleCard; +import com.example.android.lately.Cards.WeatherCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class Fragment1 extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + + SwipeRefreshLayout mSwipeRefreshLayout; + + ArrayList mTestArray; + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipeOnRefresh); + mRecyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerView); + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + + RecyclerView(); + + mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { + @Override + public void onRefresh() { + mAdapter = new CardAdapter(mTestArray); + mRecyclerView.swapAdapter(mAdapter, false); + + + } + }); + + return rootView; + } + + public void RecyclerView(){ + + //Dummy ArrayList + mTestArray = new ArrayList(); +// RedditCard dummyReddit = new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3); +// FoursquareCard dummyfoursquare = new FoursquareCard("999 Success and Employement Way", "98", "Fortune Wealth Happiness", "10293i1jnd", "o9je92hoi",CardAdapter.TYPE_FOURSQUARE, CardAdapter.TAB_MAINPAGE, 4); + Singleton singleton = Singleton.getInstance(); +// singleton.addParentCard(dummyReddit,CardAdapter.TAB_MAINPAGE); +// singleton.addParentCard(dummyfoursquare,CardAdapter.TAB_MAINPAGE); + mTestArray.addAll(singleton.getArrayList(CardAdapter.TAB_MAINPAGE)); + +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); +// mTestArray.add(new RedditCard("Jhonny Bananas", new ArrayList(), "Content", 99, 613,"/r/beautiful", "99:99", "This Project rocks and we are proud", "1092120", CardAdapter.TYPE_REDDIT, CardAdapter.TAB_MAINPAGE, 3)); + + + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + Log.d("array_size", String.valueOf(Singleton.getInstance().getSize())); + mAdapter = new CardAdapter(mTestArray); + mRecyclerView.setAdapter(mAdapter); + } +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentAnimals.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentAnimals.java new file mode 100644 index 0000000..6afb1c6 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentAnimals.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentAnimals extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_ANIMALS); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentCareer.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentCareer.java new file mode 100644 index 0000000..80a3d33 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentCareer.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentCareer extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_CAREER); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentDancing.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentDancing.java new file mode 100644 index 0000000..bfe0f7d --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentDancing.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentDancing extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_DANCING); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentDating.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentDating.java new file mode 100644 index 0000000..583f691 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentDating.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentDating extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_DATING); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentFood.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentFood.java new file mode 100644 index 0000000..7932de8 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentFood.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentFood extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_FOOD); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentLanguage.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentLanguage.java new file mode 100644 index 0000000..c4d0489 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentLanguage.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentLanguage extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_LANGUAGE); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentNature.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentNature.java new file mode 100644 index 0000000..026735f --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentNature.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentNature extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_NATURE); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentPolitics.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentPolitics.java new file mode 100644 index 0000000..f005121 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentPolitics.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentPolitics extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_POLITICS); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentSports.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentSports.java new file mode 100644 index 0000000..d46adcb --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentSports.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentSports extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_SPORTS); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentTech.java b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentTech.java new file mode 100644 index 0000000..0b067ee --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Fragments/FragmentTech.java @@ -0,0 +1,56 @@ +package com.example.android.lately.Fragments; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; +import com.example.android.lately.R; +import com.example.android.lately.Singleton; + +import java.util.ArrayList; + + +public class FragmentTech extends Fragment { + + boolean mPortrait; + RecyclerView mRecyclerView; + CardAdapter mAdapter; + ArrayList mParentCardArrayList; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_fragment1, container, false); + + Singleton instance = Singleton.getInstance(); + instance.getArrayList(CardAdapter.TAB_TECH); + + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + RecyclerView(mParentCardArrayList); + return rootView; + } + + public void RecyclerView(ArrayList arrayList) { + //no clue what this does + mRecyclerView.setHasFixedSize(false); + LinearLayoutManager llm = new LinearLayoutManager(getActivity()); + llm.setOrientation(LinearLayoutManager.VERTICAL); + mRecyclerView.setLayoutManager(llm); + + mAdapter = new CardAdapter(arrayList); + mRecyclerView.setAdapter(mAdapter); + } + +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/LoginActivity.java b/Late.ly/app/src/main/java/com/example/android/lately/LoginActivity.java new file mode 100644 index 0000000..e0698c7 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/LoginActivity.java @@ -0,0 +1,233 @@ +package com.example.android.lately; + +import android.content.Intent; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.Signature; +import android.net.Uri; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.support.v7.widget.Toolbar; +import android.util.Base64; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + +import com.facebook.AccessToken; +import com.facebook.AccessTokenTracker; +import com.facebook.CallbackManager; +import com.facebook.FacebookCallback; +import com.facebook.FacebookException; +import com.facebook.FacebookSdk; +import com.facebook.Profile; +import com.facebook.ProfileTracker; +import com.facebook.login.LoginResult; +import com.facebook.login.widget.LoginButton; +import com.google.android.gms.appindexing.Action; +import com.google.android.gms.appindexing.AppIndex; +import com.google.android.gms.common.api.GoogleApiClient; +import com.facebook.login.LoginManager; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; + +public class LoginActivity extends AppCompatActivity { + private CallbackManager callbackManager; + private AccessTokenTracker accessTokenTracker; + private ProfileTracker profileTracker; + + //Facebook login button + private FacebookCallback callback = new FacebookCallback() { + + @Override + public void onSuccess(LoginResult loginResult) { + Profile profile = Profile.getCurrentProfile(); + nextActivity(profile); + } + + @Override + public void onCancel() { + } + + @Override + public void onError(FacebookException e) { + e.printStackTrace(); + } + }; + /** + * ATTENTION: This was auto-generated to implement the App Indexing API. + * See https://g.co/AppIndexing/AndroidStudio for more information. + */ + private GoogleApiClient client; + + @Override + protected void onCreate(Bundle savedInstanceState) { + FacebookSdk.sdkInitialize(getApplicationContext()); + + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_login); + //Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + //setSupportActionBar(toolbar); + + try { + PackageInfo info = getPackageManager().getPackageInfo( + "com.example.android.lately", + PackageManager.GET_SIGNATURES); + for (Signature signature : info.signatures) { + MessageDigest md = MessageDigest.getInstance("SHA"); + md.update(signature.toByteArray()); + Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); + } + } catch (PackageManager.NameNotFoundException e) { + + } catch (NoSuchAlgorithmException e) { + + } + + callbackManager = CallbackManager.Factory.create(); + accessTokenTracker = new AccessTokenTracker() { + @Override + protected void onCurrentAccessTokenChanged(AccessToken oldToken, AccessToken newToken) { + } + }; + + profileTracker = new ProfileTracker() { + @Override + protected void onCurrentProfileChanged(Profile oldProfile, Profile newProfile) { + nextActivity(newProfile); + } + }; + accessTokenTracker.startTracking(); + profileTracker.startTracking(); + + LoginButton loginButton = (LoginButton) findViewById(R.id.login_button); +// callback = new FacebookCallback() { +// @Override +// public void onSuccess(LoginResult loginResult) { +// AccessToken accessToken = loginResult.getAccessToken(); +// Profile profile = Profile.getCurrentProfile(); +// nextActivity(profile); +// Toast.makeText(getApplicationContext(), "Logging in...", Toast.LENGTH_SHORT).show(); +// +// } +// +// @Override +// public void onCancel() { +// Toast.makeText(LoginActivity.this, "onCancel", Toast.LENGTH_SHORT).show(); +// } +// +// @Override +// +// public void onError(FacebookException e) { +// Toast.makeText(LoginActivity.this, "onError", Toast.LENGTH_SHORT).show(); +// e.printStackTrace(); +// } +// }; + loginButton.setReadPermissions("user_friends", "user_about_me", "user_posts", "user_photos"); +// loginButton.registerCallback(callbackManager, callback); + + LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback() { + @Override + public void onSuccess(LoginResult loginResult) { + // App code + } + + @Override + public void onCancel() { + // App code + } + + @Override + public void onError(FacebookException exception) { + // App code + } + }); + LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile", "user_friends","user_posts")); + + + // ATTENTION: This was auto-generated to implement the App Indexing API. + // See https://g.co/AppIndexing/AndroidStudio for more information. + client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); + } + + + @Override + protected void onResume() { + super.onResume(); + //Facebook login + Profile profile = Profile.getCurrentProfile(); + nextActivity(profile); + + } + + @Override + protected void onPause() { + + super.onPause(); + } + + protected void onStop() { + super.onStop(); + // ATTENTION: This was auto-generated to implement the App Indexing API. + // See https://g.co/AppIndexing/AndroidStudio for more information. + Action viewAction = Action.newAction( + Action.TYPE_VIEW, // TODO: choose an action type. + "Login Page", // TODO: Define a title for the content shown. + // TODO: If you have web page content that matches this app activity's content, + // make sure this auto-generated web page URL is correct. + // Otherwise, set the URL to null. + Uri.parse("http://host/path"), + // TODO: Make sure this auto-generated app URL is correct. + Uri.parse("android-app://com.example.android.lately/http/host/path") + ); + AppIndex.AppIndexApi.end(client, viewAction); + //Facebook login + accessTokenTracker.stopTracking(); + profileTracker.stopTracking(); + // ATTENTION: This was auto-generated to implement the App Indexing API. + // See https://g.co/AppIndexing/AndroidStudio for more information. + client.disconnect(); + } + + @Override + protected void onActivityResult(int requestCode, int responseCode, Intent intent) { + super.onActivityResult(requestCode, responseCode, intent); + //Facebook login + callbackManager.onActivityResult(requestCode, responseCode, intent); + } + + private void nextActivity(Profile profile) { + if (profile != null) { + Intent main = new Intent(LoginActivity.this, MainActivity.class); + main.putExtra("name", profile.getFirstName()); + main.putExtra("surname", profile.getLastName()); + main.putExtra("imageUrl", profile.getProfilePictureUri(200, 200).toString()); + startActivity(main); + } + } + + @Override + public void onStart() { + super.onStart(); + + // ATTENTION: This was auto-generated to implement the App Indexing API. + // See https://g.co/AppIndexing/AndroidStudio for more information. + client.connect(); + Action viewAction = Action.newAction( + Action.TYPE_VIEW, // TODO: choose an action type. + "Login Page", // TODO: Define a title for the content shown. + // TODO: If you have web page content that matches this app activity's content, + // make sure this auto-generated web page URL is correct. + // Otherwise, set the URL to null. + Uri.parse("http://host/path"), + // TODO: Make sure this auto-generated app URL is correct. + Uri.parse("android-app://com.example.android.lately/http/host/path") + ); + AppIndex.AppIndexApi.start(client, viewAction); + } + + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/MainActivity.java b/Late.ly/app/src/main/java/com/example/android/lately/MainActivity.java new file mode 100644 index 0000000..d438136 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/MainActivity.java @@ -0,0 +1,946 @@ +package com.example.android.lately; + +import android.Manifest; +import android.app.Notification; +import android.app.NotificationManager; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.location.Location; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.AsyncTask; +import android.os.Bundle; +import android.support.design.widget.TabLayout; +import android.support.v4.app.ActivityCompat; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentTransaction; +import android.support.v4.app.NotificationCompat; +import android.support.v4.content.ContextCompat; +import android.support.v4.view.ViewPager; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.Toast; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.EventCard; +import com.example.android.lately.Cards.FacebookCard; +import com.example.android.lately.Cards.FoursquareCard; +import com.example.android.lately.Cards.RedditCard; +import com.example.android.lately.Cards.RedditComment; +import com.example.android.lately.Cards.WeatherCard; +import com.example.android.lately.Forecast.Weather; +import com.example.android.lately.Foursquare.FoursquarePhotos.FoursquarePhotos; +import com.example.android.lately.Foursquare.FoursquareVenues; +import com.example.android.lately.Fragments.DetailsFragment; +import com.example.android.lately.Meetup.MeetupEvents; +import com.example.android.lately.Meetup.MeetupPhotos.MeetupPhotos; +import com.example.android.lately.Reddit.RedditArticle.Comments.CommentProcessor; +import com.example.android.lately.Reddit.RedditArticle.RedditArticle; +import com.example.android.lately.Reddit.RedditArticle.RedditResult; +import com.facebook.AccessToken; +import com.facebook.GraphRequest; +import com.facebook.GraphResponse; +import com.facebook.HttpMethod; +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.location.LocationServices; + +import org.json.JSONException; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.TimeZone; + +import retrofit2.Call; +import retrofit2.Callback; +import retrofit2.Response; +import retrofit2.Retrofit; +import retrofit2.converter.gson.GsonConverterFactory; +import retrofit2.http.GET; +import retrofit2.http.Path; +import retrofit2.http.Query; + +public class MainActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { + + private GoogleApiClient mGoogleApiClient; + private Location mLastLocation; + Window mWindow; + Toolbar mMainToolbar; + boolean mPortrait; + ArrayList redditUrlList; + ArrayList venueIdList; + ArrayList mComments; + CommentAsyncTask commentAsyncTask; +// Singleton mSingletonArrayOfParentCards; + TabLayout mTabLayout; + + int mSports; + private static String mForecastUrl = "https://api.forecast.io/forecast/39a42687f8dbe7c14cd4f97d201af744/"; + private static String mRedditUrl = "https://www.reddit.com/r/"; + public static final String mFoursquareEndpoint = "https://api.foursquare.com/"; + public static final String FOURSQUARE_CLIENT_ID = "JLOYBXMM0G3SFCJASFGDZJTAHOMYOMUO2JDCF0YIOPPYN312"; + public static final String FOURSQUARE_CLIENT_SECRET = "PIWMY5DZACK0F5U0J4PIHRUJWVSLGX14R1CPZRNGJXTIGJ35"; + public static final String FOURSQUARE_VERSION_NUMBER = "20130815"; + public static final String mMeetupEndPoint = "https://api.meetup.com/"; + public static final String mMeetupKey = "152c38353e11216219776676c5c366a"; + public static final String mMeetupTime = ",1w"; + public static final String mMeetupSign = "true"; + public static final String mMeetupPage = "20"; + public static final String mMeetupRadius = "40"; + public String foursquarePhotoUrl; + public String meetupPhotoUrl; + public String facebookUsername; + public String facebookUserImage; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + facebookUsername = getIntent().getStringExtra("name") + " " + getIntent().getStringExtra("surname"); + facebookUserImage = getIntent().getStringExtra("imageUrl"); + +// mSingletonArrayOfParentCards = Singleton.getInstance(); + + mSports = 1; + + mGoogleApiClient = new GoogleApiClient.Builder(this) + .addApi(LocationServices.API) + .addConnectionCallbacks(this) + .addOnConnectionFailedListener(this) + .build(); + mGoogleApiClient.connect(); + + mWindow = this.getWindow(); + mWindow.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); + mWindow.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarker)); + + mMainToolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(mMainToolbar); + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark)); + + final TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); + mTabLayout = (TabLayout) findViewById(R.id.tab_layout); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark)); + + + //put in the selections into shared preferences and feed it into the creates tab + + ArrayList selection = new ArrayList<>(); + selection.add("Animals"); + selection.add("Tech"); + selection.add("Dancing"); + selection.add("Dating"); + selection.add("Dating"); + selection.add("Food"); + selection.add("Nature"); + selection.add("Politics"); + selection.add("Career"); + selection.add("Dancing"); + selection.add("Language"); + selection.add("Sports"); + selection.add("Politics"); + + createTabs(selection); + + tabLayout.setTabGravity(TabLayout.GRAVITY_CENTER); + tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE); + + final ViewPager viewPager = (ViewPager) findViewById(R.id.pager); + final TabAdapter adapter = new TabAdapter(getSupportFragmentManager(), tabLayout.getTabCount()); + viewPager.setAdapter(adapter); + viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); + viewPager.setOffscreenPageLimit(5); + + tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { + @Override + public void onTabSelected(TabLayout.Tab tab) { + viewPager.setCurrentItem(tab.getPosition()); +// if ("Sports".equals(tab.getTag()); + + switch (tab.getTag().toString()) { + case "Main": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark)); + mMainToolbar.setTitle("Main"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDark)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarker)); + break; + case "Animals": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkAnimals)); + mMainToolbar.setTitle("Animals"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkAnimals)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerAnimals)); + break; + case "Career": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkCareer)); + mMainToolbar.setTitle("Career"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkCareer)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerCareer)); + break; + case "Dancing": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkDancing)); + mMainToolbar.setTitle("Dancing"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkDancing)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerDancing)); + break; + case "Dating": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkDating)); + mMainToolbar.setTitle("Dating"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkDating)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerDating)); + break; + case "Food": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkFood)); + mMainToolbar.setTitle("Food"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkFood)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerFood)); + break; + case "Language": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkLanguage)); + mMainToolbar.setTitle("Language"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkLanguage)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerLanguage)); + break; + case "Nature": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkNature)); + mMainToolbar.setTitle("Nature"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkNature)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerNature)); + break; + case "Politics": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkPolitics)); + mMainToolbar.setTitle("Politics"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkPolitics)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerPolitics)); + break; + case "Sports": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkSports)); + mMainToolbar.setTitle("Sports"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkSports)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerSports)); + break; + case "Tech": + mMainToolbar.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkTech)); + mMainToolbar.setTitle("Tech"); + tabLayout.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDarkTech)); + mWindow.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDarkerTech)); + break; + default: + } + } + + @Override + public void onTabUnselected(TabLayout.Tab tab) { + + } + + @Override + public void onTabReselected(TabLayout.Tab tab) { + + } + }); + + int portrait = getResources().getConfiguration().orientation; + if (portrait == 1) { + mPortrait = true; + } else { + mPortrait = false; + } + + + + if (mPortrait) { + } else { + Fragment fragment = new DetailsFragment(); + FragmentManager fm = getSupportFragmentManager(); + FragmentTransaction transaction = fm.beginTransaction(); + transaction.replace(R.id.detailsFragmentContainer, fragment); + transaction.commit(); + } + + ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); + + NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); + boolean isConnected = activeNetwork != null && + activeNetwork.isConnectedOrConnecting(); + + NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this); + + if (isConnected) { + //connected notification + builder.setSmallIcon(android.R.drawable.presence_online); + builder.setContentTitle("Network Status"); + builder.setContentText("The network is up"); + + Notification notification = builder.build(); + NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + notificationManager.notify(12345, notification); + + } else { + builder.setSmallIcon(android.R.drawable.stat_notify_error); + builder.setContentTitle("Network Status"); + builder.setContentText("The network is down"); + + Notification notification = builder.build(); + NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + notificationManager.notify(12345, notification); + } + + } + + public void getForecastApi() { + String latitude = String.valueOf(mLastLocation.getLatitude()).substring(0, 7); + String longitude = String.valueOf(mLastLocation.getLongitude()).substring(0, 8); + String latlon = latitude + "," + longitude; + + Retrofit retrofit = new Retrofit.Builder() + .baseUrl(mForecastUrl) + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + WeatherRequest weatherRequest = retrofit.create(WeatherRequest.class); + Call result = weatherRequest.getWeather(latlon); + result.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + + //Getting current weather status + + String currentTemperature = String.valueOf((response.body().getCurrently().getTemperature()).intValue()); + String currentSummary = response.body().getCurrently().getSummary(); + String currentLocation = response.body().getTimezone(); + + SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy hha z, EEE"); + format.setTimeZone(TimeZone.getTimeZone("GMT" + response.body().getOffset())); + Date currentDate = new Date((long) (response.body().getCurrently().getTime() * 1000L)); + String formattedCurrentDate = format.format(currentDate); + + + //Getting next five days' weather + String[] nextFiveDaysDates = new String[5]; + String[] nextFiveDaysSummary = new String[5]; + String[] nextFiveDaysHighTemp = new String[5]; + String[] nextFiveDaysLowTemp = new String[5]; + for (int i = 0; i < 5; i++) { + Date nextDayTime = new Date((long) (response.body().getDaily().getData().get(i + 1).getTime() * 1000L)); + String formattedDate = format.format(nextDayTime); + //nextFiveDaysDates[i] = formattedDate; + //If you want to just extract day names(i.e. Tue), comment out the line above this and uncomment the below one. + nextFiveDaysDates[i] = formattedDate.substring(formattedDate.length()-3,formattedDate.length()); + + nextFiveDaysSummary[i] = response.body().getDaily().getData().get(i + 1).getSummary(); + nextFiveDaysHighTemp[i] = String.valueOf((response.body().getDaily().getData().get(i + 1).getTemperatureMax()).intValue()); + nextFiveDaysLowTemp[i] = String.valueOf((response.body().getDaily().getData().get(i + 1).getTemperatureMin()).intValue()); + } + WeatherCard weatherCard = new WeatherCard(currentTemperature, currentSummary, currentLocation, + formattedCurrentDate, nextFiveDaysDates, nextFiveDaysSummary, nextFiveDaysHighTemp, nextFiveDaysLowTemp, CardAdapter.TYPE_WEATHER, CardAdapter.TAB_MAINPAGE, 0); + + Singleton.getInstance().addParentCard(weatherCard, CardAdapter.TAB_MAINPAGE); + } + + @Override + public void onFailure(Call call, Throwable t) { + Toast.makeText(MainActivity.this, "Failed", Toast.LENGTH_SHORT).show(); + } + }); + } + + public void getRedditApi(final ArrayList tabTypes) { + Retrofit retrofit = new Retrofit.Builder() + .baseUrl(mRedditUrl) + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + redditUrlList = new ArrayList<>(); + ArrayList subredditSelections = new ArrayList<>(); + for (int l = 0; l result = redditRequest.getRedditFeed(subredditSelections.get(i)); + result.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + + List result = response.body().getData().getChildren(); + String articleAuthor, articleUrl, articleSubreddit, articleContent, articleTitle, articleTime; + int articleScore, articleNumOfComment, idNumber; + for (int i = 0; i < result.size(); i++) { + articleAuthor = result.get(i).getData().getAuthor(); + articleSubreddit = result.get(i).getData().getSubreddit(); + articleTitle = result.get(i).getData().getTitle(); + articleContent = result.get(i).getData().getSelftext(); + articleUrl = result.get(i).getData().getUrl(); + redditUrlList.add(articleUrl); + articleNumOfComment = result.get(i).getData().getNumComments(); + articleScore = result.get(i).getData().getScore(); + SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy hha, EEE"); + Date currentDate = new Date((long) (result.get(i).getData().getCreated() * 1000L)); + articleTime = format.format(currentDate); + articleSubreddit = result.get(i).getData().getSubreddit(); + idNumber = i + 1; + + //TODO Create object here. Type null for the comment parameter. + RedditCard redditCard = new RedditCard(articleAuthor,null,articleContent,articleNumOfComment,articleScore,articleSubreddit, + articleTime,articleTitle,articleUrl,CardAdapter.TYPE_REDDIT,CardAdapter.TAB_FOOD,Singleton.getInstance().getSize()); + Log.d("REDDIT",redditCard.getmTitle()); + Singleton.getInstance().addParentCard(redditCard, CardAdapter.TAB_MAINPAGE); + Singleton.getInstance().addParentCard(redditCard, CardAdapter.TAB_FOOD); + + } + String[] urlArray = redditUrlList.toArray(new String[0]); + commentAsyncTask = new CommentAsyncTask(); + commentAsyncTask.execute(urlArray); + } + + @Override + public void onFailure(Call call, Throwable t) { + t.printStackTrace(); + } + }); + } + } + + public class CommentAsyncTask extends AsyncTask { + @Override + protected Void doInBackground(String... params) { + String data = ""; + try { + for (int i = 0; i < params.length; i++) { + URL url = new URL(params[i]+"/.json"); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.connect(); + InputStream inStream = connection.getInputStream(); + data = getInputData(inStream); + CommentProcessor commentProcessor = new CommentProcessor(data); + mComments = new ArrayList<>(); + mComments = commentProcessor.fetchComments(); + + if(Singleton.getInstance().getArrayList(CardAdapter.TAB_MAINPAGE).get(i+1).getmCardType() == CardAdapter.TYPE_REDDIT) { + RedditCard redditCard = (RedditCard) Singleton.getInstance().getArrayList(CardAdapter.TAB_MAINPAGE).get(i + 1); + redditCard.setmComments(mComments); + } + } + } catch (Throwable e) { + e.printStackTrace(); + } + + return null; + } + + @Override + protected void onPreExecute() { + super.onPreExecute(); + } + + @Override + protected void onPostExecute(Void aVoid) { + super.onPostExecute(aVoid); + } + } + + public void getFoursquareApi(String latlon) { + + venueIdList = new ArrayList<>(); + + Retrofit retrofit = new Retrofit.Builder() + .baseUrl(mFoursquareEndpoint) + .addConverterFactory(GsonConverterFactory.create()) + .build(); + final FoursquareRequest foursquareRequest = retrofit.create(FoursquareRequest.class); + Call result = foursquareRequest.getVenues(FOURSQUARE_CLIENT_ID, FOURSQUARE_CLIENT_SECRET, FOURSQUARE_VERSION_NUMBER, latlon); + result.enqueue(new Callback() { + @Override + public void onResponse + (Call call, Response response) { + for (int i = 0; i < response.body().getResponse().getVenues().size(); i++) { + final String venueId = response.body().getResponse().getVenues().get(i).getId(); + final String venueName = response.body().getResponse().getVenues().get(i).getName(); + String streetAddress = response.body().getResponse().getVenues().get(i).getLocation().getAddress(); + String cityAddress = response.body().getResponse().getVenues().get(i).getLocation().getCity(); + String stateAddress = response.body().getResponse().getVenues().get(i).getLocation().getState(); + String zipcodeAddress = response.body().getResponse().getVenues().get(i).getLocation().getPostalCode(); + final String venueAddress = streetAddress + ", " + cityAddress + ", " + stateAddress + ", " + zipcodeAddress; + final String venueUrl = response.body().getResponse().getVenues().get(i).getUrl(); + + Call photos = foursquareRequest.getPhotoes(venueId, FOURSQUARE_CLIENT_ID, FOURSQUARE_CLIENT_SECRET, FOURSQUARE_VERSION_NUMBER); + photos.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + if(response.body().getResponse().getPhotos().getItems().size() != 0) { + String prefix = response.body().getResponse().getPhotos().getItems().get(0).getPrefix(); + String suffix = response.body().getResponse().getPhotos().getItems().get(0).getSuffix(); + int width = response.body().getResponse().getPhotos().getItems().get(0).getWidth(); + int height = response.body().getResponse().getPhotos().getItems().get(0).getHeight(); + foursquarePhotoUrl = prefix + width + "x" + height + suffix; + + //FoursquareCard foursquareCard = new FoursquareCard(venueAddress,venueId,venueName,venueUrl,foursquarePhotoUrl,CardAdapter.TYPE_FOURSQUARE,CardAdapter.TAB_MAINPAGE,Singleton.getInstance().getSize()); + FoursquareCard foursquareCard1 = new FoursquareCard(venueAddress,venueId,venueName,venueUrl,foursquarePhotoUrl,CardAdapter.TYPE_FOURSQUARE,CardAdapter.TAB_MAINPAGE,1); + Singleton.getInstance().addParentCard(foursquareCard1, CardAdapter.TAB_MAINPAGE); + } + } + + @Override + public void onFailure(Call call, Throwable t) { + t.printStackTrace(); + } + }); + } + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + } + + public void getMeetupApi(ArrayList tabTypes, String lat, String lon) { + Retrofit retrofit = new Retrofit.Builder() + .baseUrl(mMeetupEndPoint) + .addConverterFactory(GsonConverterFactory.create()) + .build(); + + ArrayList selections = new ArrayList<>(); + + for (int l = 0; l result = meetupRequest.getEvents(mMeetupRadius, mMeetupPage, mMeetupKey, mMeetupTime, selections.get(i), lat, lon); + result.enqueue(new Callback() { + @Override + public void onResponse(Call call, Response response) { + for (int j = 0; j < response.body().getResults().size(); j++) { + String eventId = response.body().getResults().get(j).getId(); + String eventName = response.body().getResults().get(j).getName(); + SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy hha, EEE"); + Date currentDate = new Date((long) (response.body().getResults().get(j).getTime() * 1000L)); + String eventTime = format.format(currentDate); + String groupName = response.body().getResults().get(j).getGroup().getName(); + String eventDescription = response.body().getResults().get(j).getDescription(); + String venueName = "Venue will be shown to members only"; + String venueAddress = "Members only"; + String groupUrl = response.body().getResults().get(j).getGroup().getUrlname(); + String eventUrl = response.body().getResults().get(j).getEventUrl(); + if (response.body().getResults().get(j).getVenue() != null) { + venueName = response.body().getResults().get(j).getVenue().getName(); + String venueStreetAddress = response.body().getResults().get(j).getVenue().getAddress1(); + String venueCityAddress = response.body().getResults().get(j).getVenue().getCity(); + String venueStateAddress = response.body().getResults().get(j).getVenue().getState(); + venueAddress = venueCityAddress + ", " + venueCityAddress + ", " + venueStateAddress; + } else { + venueAddress = "Unknown"; + } + + EventCard eventCard = new EventCard(eventName, eventDescription, eventUrl, groupName, "20", eventTime, venueAddress, venueName, + CardAdapter.TYPE_EVENT, CardAdapter.TAB_TECH,Singleton.getInstance().getArrayList(CardAdapter.TAB_MAINPAGE).size()); + Singleton.getInstance().addParentCard(eventCard, CardAdapter.TAB_MAINPAGE); + Singleton.getInstance().addParentCard(eventCard, CardAdapter.TAB_TECH); + Log.d("ADDED A CARD : ",eventCard.getEvent()+" "+eventCard.getVenueAddress()); + + } + } + + @Override + public void onFailure(Call call, Throwable t) { + + } + }); + } + } + + public void getFacebookFeed(){ + GraphRequest request = new GraphRequest( + AccessToken.getCurrentAccessToken(), + "/me/feed", + null, + HttpMethod.GET, + new GraphRequest.Callback() { + public void onCompleted(GraphResponse response) { + String obj = response.getJSONObject().toString(); + try { + for (int i = 0; i topics = new ArrayList(); + topics.add(CardAdapter.TAB_FOOD); + getForecastApi(); + getRedditApi(topics); //TODO This parameter is a place holder. We'll change it into the user topic int. + getFoursquareApi(latlon); + //getMeetupApi(new ArrayList(), latitude, longitude); //TODO This one also. + getFacebookFeed(); + + } else { + Toast.makeText(MainActivity.this, "Turn on GPS and try again", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(MainActivity.this, "No network connection", Toast.LENGTH_SHORT).show(); + } + } + + @Override + public void onConnectionSuspended(int i) { + + } + + @Override + public void onConnectionFailed(ConnectionResult connectionResult) { + + } + + public interface WeatherRequest { + @GET("{latlon}/") + Call getWeather(@Path("latlon") String latlon); + } + + public interface RedditRequest { + @GET("{subreddit}/.json") + Call getRedditFeed(@Path("subreddit") String subreddit); + } + + public interface FoursquareRequest { + @GET("v2/venues/search") + public Call getVenues(@Query("client_id") String clientId, @Query("client_secret") String clientSecret, @Query("v") String version, @Query("ll") String ll); + + @GET("v2/venues/{venueId}/photos") + public Call getPhotoes(@Path("venueId") String venueId, @Query("client_id") String clientId, @Query("client_secret") String clientSecret, @Query("v") String version); + + } + + public interface MeetupRequest { + @GET("2/open_events?sign=true") + public Call getEvents(@Query("radius") String radius, @Query("page") String page, @Query("key") String key, @Query("time") String time, @Query("category") String category, @Query("lat") String lat, @Query("lon") String lon); + + @GET("2/photos?&sign=true&photo-host=public") + public Call getPhotos(@Query("key") String key, @Query("group_urlname") String groupUrlname, @Query("page") String page); + + } + + public void createTabs(ArrayList selection) { + //// TODO: 3/10/16 change "contains" to TAB_BLAH + + TabLayout.Tab tabMain = mTabLayout.newTab(); + ImageView imageViewMain = new ImageView(this); + imageViewMain.setImageResource(R.drawable.ic_home); + tabMain.setTag("Main"); + imageViewMain.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); + tabMain.setCustomView(imageViewMain); + mTabLayout.addTab(tabMain); + View viewMain = (View) imageViewMain.getParent(); + LinearLayout.LayoutParams lpMain = (LinearLayout.LayoutParams) viewMain.getLayoutParams(); + viewMain.setPadding(0, 0, 0, 0); + viewMain.setLayoutParams(lpMain); + + + if (selection.contains("Animals")) { + TabLayout.Tab tabAnimals = mTabLayout.newTab(); + ImageView imageViewAnimals = new ImageView(this); + imageViewAnimals.setImageResource(R.drawable.animal_icon); + tabAnimals.setTag("Animals"); + imageViewAnimals.setBackgroundColor(getResources().getColor(R.color.colorPrimaryAnimals)); + tabAnimals.setCustomView(imageViewAnimals); + mTabLayout.addTab(tabAnimals); + View viewAnimals = (View) imageViewAnimals.getParent(); + LinearLayout.LayoutParams lpAnimals = (LinearLayout.LayoutParams) viewAnimals.getLayoutParams(); + viewAnimals.setPadding(0, 0, 0, 0); + viewAnimals.setLayoutParams(lpAnimals); + } + if (selection.contains("Career")) { + + TabLayout.Tab tabCareer = mTabLayout.newTab(); + ImageView imageViewCareer = new ImageView(this); + imageViewCareer.setImageResource(R.drawable.career_icon); + tabCareer.setTag("Career"); + imageViewCareer.setBackgroundColor(getResources().getColor(R.color.colorPrimaryCareer)); + tabCareer.setCustomView(imageViewCareer); + mTabLayout.addTab(tabCareer); + View viewCareer = (View) imageViewCareer.getParent(); + LinearLayout.LayoutParams lpCareer = (LinearLayout.LayoutParams) viewCareer.getLayoutParams(); + viewCareer.setPadding(0, 0, 0, 0); + viewCareer.setLayoutParams(lpCareer); + } + if (selection.contains("Dancing")) { + TabLayout.Tab tabDancing = mTabLayout.newTab(); + ImageView imageViewDancing = new ImageView(this); + imageViewDancing.setImageResource(R.drawable.dance_icon); + tabDancing.setTag("Dancing"); + imageViewDancing.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDancing)); + tabDancing.setCustomView(imageViewDancing); + mTabLayout.addTab(tabDancing); + View viewDancing = (View) imageViewDancing.getParent(); + LinearLayout.LayoutParams lpDancing = (LinearLayout.LayoutParams) viewDancing.getLayoutParams(); + viewDancing.setPadding(0, 0, 0, 0); + viewDancing.setLayoutParams(lpDancing); + } + if (selection.contains("Dating")) { + TabLayout.Tab tabDating = mTabLayout.newTab(); + ImageView imageViewDating = new ImageView(this); + imageViewDating.setImageResource(R.drawable.dating_icon); + tabDating.setTag("Dating"); + imageViewDating.setBackgroundColor(getResources().getColor(R.color.colorPrimaryDating)); + tabDating.setCustomView(imageViewDating); + mTabLayout.addTab(tabDating); + View viewDating = (View) imageViewDating.getParent(); + LinearLayout.LayoutParams lpDating = (LinearLayout.LayoutParams) viewDating.getLayoutParams(); + viewDating.setPadding(0, 0, 0, 0); + viewDating.setLayoutParams(lpDating); + } + if (selection.contains("Food")) { + TabLayout.Tab tabFood = mTabLayout.newTab(); + ImageView imageViewFood = new ImageView(this); + imageViewFood.setImageResource(R.drawable.food_icon); + tabFood.setTag("Food"); + imageViewFood.setBackgroundColor(getResources().getColor(R.color.colorPrimaryFood)); + tabFood.setCustomView(imageViewFood); + mTabLayout.addTab(tabFood); + View viewFood = (View) imageViewFood.getParent(); + LinearLayout.LayoutParams lpFood = (LinearLayout.LayoutParams) viewFood.getLayoutParams(); + viewFood.setPadding(0, 0, 0, 0); + viewFood.setLayoutParams(lpFood); + } + if (selection.contains("Language")) { + TabLayout.Tab tabLanguage = mTabLayout.newTab(); + ImageView imageViewLanguage = new ImageView(this); + imageViewLanguage.setImageResource(R.drawable.language_icon); + tabLanguage.setTag("Language"); + imageViewLanguage.setBackgroundColor(getResources().getColor(R.color.colorPrimaryLanguage)); + tabLanguage.setCustomView(imageViewLanguage); + mTabLayout.addTab(tabLanguage); + View viewLanguage = (View) imageViewLanguage.getParent(); + LinearLayout.LayoutParams lpLanguage = (LinearLayout.LayoutParams) viewLanguage.getLayoutParams(); + viewLanguage.setPadding(0, 0, 0, 0); + viewLanguage.setLayoutParams(lpLanguage); + } + if (selection.contains("Nature")) { + TabLayout.Tab tabNature = mTabLayout.newTab(); + ImageView imageViewNature = new ImageView(this); + imageViewNature.setImageResource(R.drawable.nature_icon); + tabNature.setTag("Nature"); + imageViewNature.setBackgroundColor(getResources().getColor(R.color.colorPrimaryNature)); + tabNature.setCustomView(imageViewNature); + mTabLayout.addTab(tabNature); + View viewNature = (View) imageViewNature.getParent(); + LinearLayout.LayoutParams lpNature = (LinearLayout.LayoutParams) viewNature.getLayoutParams(); + viewNature.setPadding(0, 0, 0, 0); + viewNature.setLayoutParams(lpNature); + } + if (selection.contains("Politics")) { + TabLayout.Tab tabPolitics = mTabLayout.newTab(); + ImageView imageViewPolitics = new ImageView(this); + imageViewPolitics.setImageResource(R.drawable.politics_icon); + tabPolitics.setTag("Politics"); + imageViewPolitics.setBackgroundColor(getResources().getColor(R.color.colorPrimaryPolitics)); + tabPolitics.setCustomView(imageViewPolitics); + mTabLayout.addTab(tabPolitics); + View viewPolitics = (View) imageViewPolitics.getParent(); + LinearLayout.LayoutParams lpPolitics = (LinearLayout.LayoutParams) viewPolitics.getLayoutParams(); + viewPolitics.setPadding(0, 0, 0, 0); + viewPolitics.setLayoutParams(lpPolitics); + } + if (selection.contains("Sports")) { + TabLayout.Tab tabSports = mTabLayout.newTab(); + ImageView imageViewSports = new ImageView(this); + imageViewSports.setImageResource(R.drawable.sports_icon); + tabSports.setTag(mSports); + imageViewSports.setBackgroundColor(getResources().getColor(R.color.colorPrimarySports)); + tabSports.setCustomView(imageViewSports); + mTabLayout.addTab(tabSports); + View viewSports = (View) imageViewSports.getParent(); + LinearLayout.LayoutParams lpSports = (LinearLayout.LayoutParams) viewSports.getLayoutParams(); + viewSports.setPadding(0, 0, 0, 0); + viewSports.setLayoutParams(lpSports); + } + if (selection.contains("Tech")) { + TabLayout.Tab tabTech = mTabLayout.newTab(); + ImageView imageViewTech = new ImageView(this); + imageViewTech.setImageResource(R.drawable.tech_icon); + tabTech.setTag("Tech"); + imageViewTech.setBackgroundColor(getResources().getColor(R.color.colorPrimaryTech)); + tabTech.setCustomView(imageViewTech); + mTabLayout.addTab(tabTech); + View viewTech = (View) imageViewTech.getParent(); + LinearLayout.LayoutParams lpTech = (LinearLayout.LayoutParams) viewTech.getLayoutParams(); + viewTech.setPadding(0, 0, 0, 0); + viewTech.setLayoutParams(lpTech); + } + + + } + + public String redditSwitcher(int TAB) { + switch (TAB) { + case CardAdapter.TAB_MAINPAGE: + return "AskReddit"; + case CardAdapter.TAB_POLITICS: + return "politics"; + case CardAdapter.TAB_TECH: + return "technology"; + case CardAdapter.TAB_CAREER: + return "financialindependance"; + case CardAdapter.TAB_FOOD: + return "food"; + case CardAdapter.TAB_DANCING: + return "Dance"; + case CardAdapter.TAB_ANIMALS: + return "Animals"; + case CardAdapter.TAB_LANGUAGE: + return "europe"; + case CardAdapter.TAB_NATURE: + return "nature"; + case CardAdapter.TAB_SPORTS: + return "sports"; + case CardAdapter.TAB_DATING: + return "Tinder"; + default: + return "AskReddit"; + } + } + + public String meetupSwitcher(int TAB) { + switch (TAB) { + case CardAdapter.TAB_MAINPAGE: + return "4"; + case CardAdapter.TAB_POLITICS: + return "13"; + case CardAdapter.TAB_TECH: + return "34"; + case CardAdapter.TAB_CAREER: + return "2"; + case CardAdapter.TAB_FOOD: + return "10"; + case CardAdapter.TAB_DANCING: + return "5"; + case CardAdapter.TAB_ANIMALS: + return "26"; + case CardAdapter.TAB_LANGUAGE: + return "16"; + case CardAdapter.TAB_NATURE: + return "23"; + case CardAdapter.TAB_SPORTS: + return "32"; + case CardAdapter.TAB_DATING: + return "30"; + default: + return "4"; + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + if (id == R.id.action_settings) { + Intent intent = new Intent(MainActivity.this, SelectionPage.class); + startActivity(intent); + return true; + + } + return super.onOptionsItemSelected(item); + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Group.java b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Group.java new file mode 100644 index 0000000..8881c17 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Group.java @@ -0,0 +1,160 @@ +package com.example.android.lately.Meetup; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Group { + + private String joinMode; + private Long created; + private String name; + private Double groupLon; + private Long id; + private String urlname; + private Double groupLat; + private String who; + + /** + * + * @return + * The joinMode + */ + public String getJoinMode() { + return joinMode; + } + + /** + * + * @param joinMode + * The join_mode + */ + public void setJoinMode(String joinMode) { + this.joinMode = joinMode; + } + + /** + * + * @return + * The created + */ + public Long getCreated() { + return created; + } + + /** + * + * @param created + * The created + */ + public void setCreated(Long created) { + this.created = created; + } + + /** + * + * @return + * The name + */ + public String getName() { + return name; + } + + /** + * + * @param name + * The name + */ + public void setName(String name) { + this.name = name; + } + + /** + * + * @return + * The groupLon + */ + public Double getGroupLon() { + return groupLon; + } + + /** + * + * @param groupLon + * The group_lon + */ + public void setGroupLon(Double groupLon) { + this.groupLon = groupLon; + } + + /** + * + * @return + * The id + */ + public Long getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + * The urlname + */ + public String getUrlname() { + return urlname; + } + + /** + * + * @param urlname + * The urlname + */ + public void setUrlname(String urlname) { + this.urlname = urlname; + } + + /** + * + * @return + * The groupLat + */ + public Double getGroupLat() { + return groupLat; + } + + /** + * + * @param groupLat + * The group_lat + */ + public void setGroupLat(Double groupLat) { + this.groupLat = groupLat; + } + + /** + * + * @return + * The who + */ + public String getWho() { + return who; + } + + /** + * + * @param who + * The who + */ + public void setWho(String who) { + this.who = who; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupEvents.java b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupEvents.java new file mode 100644 index 0000000..8ac7e1c --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupEvents.java @@ -0,0 +1,34 @@ +package com.example.android.lately.Meetup; + +import com.example.android.lately.Foursquare.Meta; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class MeetupEvents { + + private List results = new ArrayList(); + + /** + * + * @return + * The results + */ + public List getResults() { + return results; + } + + /** + * + * @param results + * The results + */ + public void setResults(List results) { + this.results = results; + } + + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupPhotos/MeetupPhotos.java b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupPhotos/MeetupPhotos.java new file mode 100644 index 0000000..4c07df2 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupPhotos/MeetupPhotos.java @@ -0,0 +1,37 @@ +package com.example.android.lately.Meetup.MeetupPhotos; + +import com.example.android.lately.Foursquare.Meta; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class MeetupPhotos { + + @SerializedName("results") + @Expose + private List results = new ArrayList(); + + /** + * + * @return + * The results + */ + public List getResults() { + return results; + } + + /** + * + * @param results + * The results + */ + public void setResults(List results) { + this.results = results; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupPhotos/Result.java b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupPhotos/Result.java new file mode 100644 index 0000000..756bf34 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/MeetupPhotos/Result.java @@ -0,0 +1,208 @@ +package com.example.android.lately.Meetup.MeetupPhotos; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +import java.lang.reflect.Member; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Result { + + + @SerializedName("utc_offset") + @Expose + private Integer utcOffset; + @SerializedName("site_link") + @Expose + private String siteLink; + @SerializedName("highres_link") + @Expose + private String highresLink; + @SerializedName("photo_id") + @Expose + private Integer photoId; + @SerializedName("created") + @Expose + private Integer created; + @SerializedName("caption") + @Expose + private String caption; + @SerializedName("photo_link") + @Expose + private String photoLink; + @SerializedName("updated") + @Expose + private Integer updated; + @SerializedName("thumb_link") + @Expose + private String thumbLink; + + /** + * + * @return + * The utcOffset + */ + public Integer getUtcOffset() { + return utcOffset; + } + + /** + * + * @param utcOffset + * The utc_offset + */ + public void setUtcOffset(Integer utcOffset) { + this.utcOffset = utcOffset; + } + + /** + * + * @return + * The siteLink + */ + public String getSiteLink() { + return siteLink; + } + + /** + * + * @param siteLink + * The site_link + */ + public void setSiteLink(String siteLink) { + this.siteLink = siteLink; + } + + /** + * + * @return + * The highresLink + */ + public String getHighresLink() { + return highresLink; + } + + /** + * + * @param highresLink + * The highres_link + */ + public void setHighresLink(String highresLink) { + this.highresLink = highresLink; + } + + /** + * + * @return + * The photoId + */ + public Integer getPhotoId() { + return photoId; + } + + /** + * + * @param photoId + * The photo_id + */ + public void setPhotoId(Integer photoId) { + this.photoId = photoId; + } + + /** + * + * @return + * The created + */ + public Integer getCreated() { + return created; + } + + /** + * + * @param created + * The created + */ + public void setCreated(Integer created) { + this.created = created; + } + + /** + * + * @return + * The member + */ + /** + * + * @return + * The caption + */ + public String getCaption() { + return caption; + } + + /** + * + * @param caption + * The caption + */ + public void setCaption(String caption) { + this.caption = caption; + } + + /** + * + * @return + * The photoLink + */ + public String getPhotoLink() { + return photoLink; + } + + /** + * + * @param photoLink + * The photo_link + */ + public void setPhotoLink(String photoLink) { + this.photoLink = photoLink; + } + + /** + * + * @return + * The updated + */ + public Integer getUpdated() { + return updated; + } + + /** + * + * @param updated + * The updated + */ + public void setUpdated(Integer updated) { + this.updated = updated; + } + + /** + * + * @return + * The thumbLink + */ + public String getThumbLink() { + return thumbLink; + } + + /** + * + * @param thumbLink + * The thumb_link + */ + public void setThumbLink(String thumbLink) { + this.thumbLink = thumbLink; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Result.java b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Result.java new file mode 100644 index 0000000..bd6b636 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Result.java @@ -0,0 +1,354 @@ +package com.example.android.lately.Meetup; + +import java.security.acl.*; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Result { + + + private Long utcOffset; + private Venue venue; + private Long headcount; + private Double distance; + private String visibility; + private Long waitlistCount; + private Long created; + private Long maybeRsvpCount; + private String description; + private String eventUrl; + private Long yesRsvpCount; + private Long duration; + private String name; + private String id; + private Long time; + private Long updated; + private Group group; + private String status; + + /** + * + * @return + * The utcOffset + */ + public Long getUtcOffset() { + return utcOffset; + } + + /** + * + * @param utcOffset + * The utc_offset + */ + public void setUtcOffset(Long utcOffset) { + this.utcOffset = utcOffset; + } + + /** + * + * @return + * The venue + */ + public Venue getVenue() { + return venue; + } + + /** + * + * @param venue + * The venue + */ + public void setVenue(Venue venue) { + this.venue = venue; + } + + /** + * + * @return + * The headcount + */ + public Long getHeadcount() { + return headcount; + } + + /** + * + * @param headcount + * The headcount + */ + public void setHeadcount(Long headcount) { + this.headcount = headcount; + } + + /** + * + * @return + * The distance + */ + public Double getDistance() { + return distance; + } + + /** + * + * @param distance + * The distance + */ + public void setDistance(Double distance) { + this.distance = distance; + } + + /** + * + * @return + * The visibility + */ + public String getVisibility() { + return visibility; + } + + /** + * + * @param visibility + * The visibility + */ + public void setVisibility(String visibility) { + this.visibility = visibility; + } + + /** + * + * @return + * The waitlistCount + */ + public Long getWaitlistCount() { + return waitlistCount; + } + + /** + * + * @param waitlistCount + * The waitlist_count + */ + public void setWaitlistCount(Long waitlistCount) { + this.waitlistCount = waitlistCount; + } + + /** + * + * @return + * The created + */ + public Long getCreated() { + return created; + } + + /** + * + * @param created + * The created + */ + public void setCreated(Long created) { + this.created = created; + } + + /** + * + * @return + * The maybeRsvpCount + */ + public Long getMaybeRsvpCount() { + return maybeRsvpCount; + } + + /** + * + * @param maybeRsvpCount + * The maybe_rsvp_count + */ + public void setMaybeRsvpCount(Long maybeRsvpCount) { + this.maybeRsvpCount = maybeRsvpCount; + } + + /** + * + * @return + * The description + */ + public String getDescription() { + return description; + } + + /** + * + * @param description + * The description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * + * @return + * The eventUrl + */ + public String getEventUrl() { + return eventUrl; + } + + /** + * + * @param eventUrl + * The event_url + */ + public void setEventUrl(String eventUrl) { + this.eventUrl = eventUrl; + } + + /** + * + * @return + * The yesRsvpCount + */ + public Long getYesRsvpCount() { + return yesRsvpCount; + } + + /** + * + * @param yesRsvpCount + * The yes_rsvp_count + */ + public void setYesRsvpCount(Long yesRsvpCount) { + this.yesRsvpCount = yesRsvpCount; + } + + /** + * + * @return + * The duration + */ + public Long getDuration() { + return duration; + } + + /** + * + * @param duration + * The duration + */ + public void setDuration(Long duration) { + this.duration = duration; + } + + /** + * + * @return + * The name + */ + public String getName() { + return name; + } + + /** + * + * @param name + * The name + */ + public void setName(String name) { + this.name = name; + } + + /** + * + * @return + * The id + */ + public String getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(String id) { + this.id = id; + } + + /** + * + * @return + * The time + */ + public Long getTime() { + return time; + } + + /** + * + * @param time + * The time + */ + public void setTime(Long time) { + this.time = time; + } + + /** + * + * @return + * The updated + */ + public Long getUpdated() { + return updated; + } + + /** + * + * @param updated + * The updated + */ + public void setUpdated(Long updated) { + this.updated = updated; + } + + /** + * + * @return + * The group + */ + public Group getGroup() { + return group; + } + + /** + * + * @param group + * The group + */ + public void setGroup(Group group) { + this.group = group; + } + + /** + * + * @return + * The status + */ + public String getStatus() { + return status; + } + + /** + * + * @param status + * The status + */ + public void setStatus(String status) { + this.status = status; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Venue.java b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Venue.java new file mode 100644 index 0000000..22b363c --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Meetup/Venue.java @@ -0,0 +1,197 @@ +package com.example.android.lately.Meetup; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class Venue { + private String country; + private String localizedCountryName; + private String city; + private String address1; + private String name; + private double lon; + private Long id; + private String state; + private double lat; + private Boolean repinned; + + /** + * + * @return + * The country + */ + public String getCountry() { + return country; + } + + /** + * + * @param country + * The country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * + * @return + * The localizedCountryName + */ + public String getLocalizedCountryName() { + return localizedCountryName; + } + + /** + * + * @param localizedCountryName + * The localized_country_name + */ + public void setLocalizedCountryName(String localizedCountryName) { + this.localizedCountryName = localizedCountryName; + } + + /** + * + * @return + * The city + */ + public String getCity() { + return city; + } + + /** + * + * @param city + * The city + */ + public void setCity(String city) { + this.city = city; + } + + /** + * + * @return + * The address1 + */ + public String getAddress1() { + return address1; + } + + /** + * + * @param address1 + * The address_1 + */ + public void setAddress1(String address1) { + this.address1 = address1; + } + + /** + * + * @return + * The name + */ + public String getName() { + return name; + } + + /** + * + * @param name + * The name + */ + public void setName(String name) { + this.name = name; + } + + /** + * + * @return + * The lon + */ + public double getLon() { + return lon; + } + + /** + * + * @param lon + * The lon + */ + public void setLon(double lon) { + this.lon = lon; + } + + /** + * + * @return + * The id + */ + public Long getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + * The state + */ + public String getState() { + return state; + } + + /** + * + * @param state + * The state + */ + public void setState(String state) { + this.state = state; + } + + /** + * + * @return + * The lat + */ + public double getLat() { + return lat; + } + + /** + * + * @param lat + * The lat + */ + public void setLat(double lat) { + this.lat = lat; + } + + /** + * + * @return + * The repinned + */ + public Boolean getRepinned() { + return repinned; + } + + /** + * + * @param repinned + * The repinned + */ + public void setRepinned(Boolean repinned) { + this.repinned = repinned; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/ArticleData.java b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/ArticleData.java new file mode 100644 index 0000000..34f2c99 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/ArticleData.java @@ -0,0 +1,89 @@ +package com.example.android.lately.Reddit.RedditArticle; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class ArticleData { + + private String subreddit; + private String author; + private Integer score; + private Integer num_comments; + private String url; + private String title; + private String selftext; + private String permalink; + private Double created; + + public Double getCreated() { + return created; + } + + public void setCreated(Double created) { + this.created = created; + } + + public String getSelftext() { + return selftext; + } + + public void setSelftext(String selftext) { + this.selftext = selftext; + } + + public String getPermalink() { + return permalink; + } + + public void setPermalink(String permalink) { + this.permalink = permalink; + } + + public String getSubreddit() { + return subreddit; + } + + public void setSubreddit(String subreddit) { + this.subreddit = subreddit; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Integer getScore() { + return score; + } + + public void setScore(Integer score) { + this.score = score; + } + + public Integer getNumComments() { + return num_comments; + } + + public void setNumComments(Integer numComments) { + this.num_comments = numComments; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/Comments/CommentProcessor.java b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/Comments/CommentProcessor.java new file mode 100644 index 0000000..8909ad8 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/Comments/CommentProcessor.java @@ -0,0 +1,103 @@ +package com.example.android.lately.Reddit.RedditArticle.Comments; + +import android.util.Log; + +import com.example.android.lately.Cards.RedditComment; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.w3c.dom.Comment; + +import java.util.ArrayList; + +/** + * Created by Wasabi on 3/10/2016. + */ +public class CommentProcessor { + private String jsonData; + + public CommentProcessor(String url) { + this.jsonData = url; + } + + public String getJsonData() { + return jsonData; + } + + public void setJsonData(String url) { + this.jsonData = url; + } + + // Load various details about the comment + private RedditComment loadComment(JSONObject data, int level){ + RedditComment comment=new RedditComment(null,null,-1,null,-1,-1,-1); + try{ + comment.setmContent(data.getString("body")); + comment.setmAuthor(data.getString("author")); + comment.setmScore(data.getInt("score")); + comment.setmLevel(level); + }catch(Exception e){ + Log.d("ERROR","Unable to parse comment : "+e); + } + return comment; + } + + // This is where the comment is actually loaded + // For each comment, its replies are recursively loaded + private void process(ArrayList comments + , JSONArray c, int level) + throws Exception { + for(int i=0;i comments, + JSONObject parent, int level){ + try{ + if(parent.get("replies").equals("")){ + // This means the comment has no replies + return; + } + JSONArray r=parent.getJSONObject("replies") + .getJSONObject("data") + .getJSONArray("children"); + process(comments, r, level); + }catch(Exception e){ + Log.d("ERROR", "addReplies : " + e); + } + } + + // Load the comments as an ArrayList, so that it can be + // easily passed to the ArrayAdapter + public ArrayList fetchComments(){ + ArrayList comments=new ArrayList(); + try{ + // Fetch the contents of the comments page + String raw=jsonData; + + JSONArray r=new JSONArray(raw) + .getJSONObject(1) + .getJSONObject("data") + .getJSONArray("children"); + + // All comments at this point are at level 0 + // (i.e., they are not replies) + process(comments, r, 0); + + }catch(Exception e){ + Log.d("ERROR","Could not connect: "+e); + } + return comments; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/Data.java b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/Data.java new file mode 100644 index 0000000..a98fc9b --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/Data.java @@ -0,0 +1,20 @@ +package com.example.android.lately.Reddit.RedditArticle; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class Data { + private List children = new ArrayList(); + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/RedditArticle.java b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/RedditArticle.java new file mode 100644 index 0000000..ecc0d2d --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/RedditArticle.java @@ -0,0 +1,15 @@ +package com.example.android.lately.Reddit.RedditArticle; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class RedditArticle { + private ArticleData data; + + public ArticleData getData() { + return data; + } + public void setData(ArticleData data) { + this.data = data; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/RedditResult.java b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/RedditResult.java new file mode 100644 index 0000000..a2d97ce --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Reddit/RedditArticle/RedditResult.java @@ -0,0 +1,17 @@ +package com.example.android.lately.Reddit.RedditArticle; + +/** + * Created by Wasabi on 3/9/2016. + */ +public class RedditResult { + + private Data data; + + public Data getData() { + return data; + } + + public void setData(Data data) { + this.data = data; + } +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/SelectionPage.java b/Late.ly/app/src/main/java/com/example/android/lately/SelectionPage.java new file mode 100644 index 0000000..f40a8b3 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/SelectionPage.java @@ -0,0 +1,234 @@ +package com.example.android.lately; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.CardView; +import android.view.View; + +import java.util.ArrayList; + +/** + * Created by perrycooperman on 3/9/16. + */ +public class SelectionPage extends AppCompatActivity { + + CardView vPolitics; + CardView vTech; + CardView vCareer; + CardView vFood; + CardView vDancing; + CardView vAnimals; + CardView vLanguage; + CardView vNature; + CardView vSports; + CardView vDating; + CardView vSubmit; + boolean mPolitics = false; + boolean mTech = false; + boolean mCareer = false; + boolean mFood = false; + boolean mDancing = false; + boolean mAnimals = false; + boolean mLanguage = false; + boolean mNature = false; + boolean mSports = false; + boolean mDating = false; + ArrayList mSelections; + + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.selection_page); + + + vPolitics = (CardView) findViewById(R.id.selectionpage_politics); + vTech = (CardView) findViewById(R.id.selectionpage_tech); + vCareer = (CardView) findViewById(R.id.selectionpage_career); + vFood = (CardView) findViewById(R.id.selectionpage_food); + vDancing = (CardView) findViewById(R.id.selectionpage_dancing); + vAnimals = (CardView) findViewById(R.id.selectionpage_animals); + vLanguage = (CardView) findViewById(R.id.selectionpage_language); + vNature = (CardView) findViewById(R.id.selectionpage_nature); + vSports = (CardView) findViewById(R.id.selectionpage_sports); + vDating = (CardView) findViewById(R.id.selectionpage_dating); + vSubmit = (CardView) findViewById(R.id.selectionpage_submit); + + + vPolitics.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mPolitics) { + mPolitics = false; + vPolitics.setCardBackgroundColor(R.color.colorSelection); + } else { + mPolitics = true; + vPolitics.setCardBackgroundColor(R.color.colorPrimaryPolitics); + } + } + }); + + vTech.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mTech) { + mTech = false; + vTech.setCardBackgroundColor(R.color.colorSelection); + } else { + mTech = true; + vTech.setCardBackgroundColor(R.color.colorPrimaryTech); + } + + } + }); + + vCareer.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mCareer) { + mCareer = false; + vCareer.setCardBackgroundColor(R.color.colorSelection); + } else { + mCareer = true; + vCareer.setCardBackgroundColor(R.color.colorPrimaryCareer); + } + + } + }); + + vFood.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mFood) { + mFood = false; + vFood.setCardBackgroundColor(R.color.colorSelection); + } else { + mFood = true; + vFood.setCardBackgroundColor(R.color.colorPrimaryFood); + } + + } + }); + + vDancing.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mDancing) { + mDancing = false; + vDancing.setCardBackgroundColor(R.color.colorSelection); + } else { + mDancing = true; + vDancing.setCardBackgroundColor(R.color.colorPrimaryDancing); + } + + } + }); + + vAnimals.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mAnimals) { + mAnimals = false; + vAnimals.setCardBackgroundColor(R.color.colorSelection); + } else { + mAnimals = true; + vAnimals.setCardBackgroundColor(R.color.colorPrimaryAnimals); + } + + } + }); + + vLanguage.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mLanguage) { + mLanguage = false; + vLanguage.setCardBackgroundColor(R.color.colorSelection); + } else { + mLanguage = true; + vLanguage.setCardBackgroundColor(R.color.colorPrimaryLanguage); + } + + } + }); + + vNature.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mNature) { + mNature = false; + vNature.setCardBackgroundColor(R.color.colorSelection); + } else { + mNature = true; + vNature.setCardBackgroundColor(R.color.colorPrimaryNature); + } + + } + }); + + vSports.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mSports) { + mSports = false; + vSports.setCardBackgroundColor(R.color.colorSelection); + } else { + mSports = true; + vSports.setCardBackgroundColor(R.color.colorPrimarySports); + } + + } + }); + + vDating.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mDating) { + mDating = false; + vDating.setCardBackgroundColor(R.color.colorSelection); + } else { + mDating = true; + vDating.setCardBackgroundColor(R.color.colorPrimaryDating); + } + + } + }); +//// TODO: 3/11/16 add arraylist in accordance to cardadapter and put to shared preferences +// vSubmit.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View v) { +// if (mPolitics) { +// mSelections.add() +// } +// if (mTech) { +// mSelections.add() +// } +// if (mCareer) { +// mSelections.add() +// } +// if (mFood) { +// mSelections.add() +// } +// if (mDancing) { +// mSelections.add() +// } +// if (mAnimals) { +// mSelections.add() +// } +// if (mLanguage) { +// mSelections.add() +// } +// if (mNature) { +// mSelections.add() +// } +// if (mSports) { +// mSelections.add() +// } +// if (mDating) { +// mSelections.add() +// } +// Intent intent = new Intent(SelectionPage.this, MainActivity.class); +// startActivity(intent); +// +// } +// }); + } +} \ No newline at end of file diff --git a/Late.ly/app/src/main/java/com/example/android/lately/Singleton.java b/Late.ly/app/src/main/java/com/example/android/lately/Singleton.java new file mode 100644 index 0000000..7930945 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/Singleton.java @@ -0,0 +1,144 @@ +package com.example.android.lately; + +import com.example.android.lately.Cards.CardAdapter; +import com.example.android.lately.Cards.ParentCard; + +import java.util.ArrayList; + +/** + * Created by ShowMe on 3/9/16. + */ +public class Singleton { + + ArrayList mMainPageArray = new ArrayList(); + ArrayList mPoliticsArray = new ArrayList(); + ArrayList mTechArray = new ArrayList(); + ArrayList mCareerArray = new ArrayList(); + ArrayList mFoodArray = new ArrayList(); + ArrayList mDancingArray = new ArrayList(); + ArrayList mAnimalsArray = new ArrayList(); + ArrayList mLanguageArray = new ArrayList(); + ArrayList mNatureArray = new ArrayList(); + ArrayList mSportsArray = new ArrayList(); + ArrayList mDatingArray = new ArrayList(); + + + + + //private static Singleton singleton = new Singleton(); + + public Singleton() { + } + + public ArrayList getArrayList(int TAB) { + switch (TAB){ + case CardAdapter.TAB_MAINPAGE: + return mMainPageArray; + case CardAdapter.TAB_POLITICS: + return mPoliticsArray; + case CardAdapter.TAB_TECH: + return mTechArray; + case CardAdapter.TAB_CAREER: + return mCareerArray; + case CardAdapter.TAB_FOOD: + return mFoodArray; + case CardAdapter.TAB_DANCING: + return mDancingArray; + case CardAdapter.TAB_ANIMALS: + return mAnimalsArray; + case CardAdapter.TAB_LANGUAGE: + return mLanguageArray; + case CardAdapter.TAB_NATURE: + return mNatureArray; + case CardAdapter.TAB_SPORTS: + return mSportsArray; + case CardAdapter.TAB_DATING: + return mDatingArray; + default: + return mMainPageArray; + } + } + + public ParentCard getParentCard(int TAB, int position){ + switch (TAB){ + case CardAdapter.TAB_MAINPAGE: + return mMainPageArray.get(position); + case CardAdapter.TAB_POLITICS: + return mPoliticsArray.get(position); + case CardAdapter.TAB_TECH: + return mTechArray.get(position); + case CardAdapter.TAB_CAREER: + return mCareerArray.get(position); + case CardAdapter.TAB_FOOD: + return mFoodArray.get(position); + case CardAdapter.TAB_DANCING: + return mDancingArray.get(position); + case CardAdapter.TAB_ANIMALS: + return mAnimalsArray.get(position); + case CardAdapter.TAB_LANGUAGE: + return mLanguageArray.get(position); + case CardAdapter.TAB_NATURE: + return mNatureArray.get(position); + case CardAdapter.TAB_SPORTS: + return mSportsArray.get(position); + case CardAdapter.TAB_DATING: + return mDatingArray.get(position); + default: + return mMainPageArray.get(position); + } + } + + public void addParentCard(ParentCard parentCard, int TAB){ + switch (TAB){ + case CardAdapter.TAB_MAINPAGE: + mMainPageArray.add(parentCard); + break; + case CardAdapter.TAB_POLITICS: + mPoliticsArray.add(parentCard); + break; + case CardAdapter.TAB_TECH: + mTechArray.add(parentCard); + break; + case CardAdapter.TAB_CAREER: + mCareerArray.add(parentCard); + break; + case CardAdapter.TAB_FOOD: + mFoodArray.add(parentCard); + break; + case CardAdapter.TAB_DANCING: + mDancingArray.add(parentCard); + break; + case CardAdapter.TAB_ANIMALS: + mAnimalsArray.add(parentCard); + break; + case CardAdapter.TAB_LANGUAGE: + mLanguageArray.add(parentCard); + break; + case CardAdapter.TAB_NATURE: + mNatureArray.add(parentCard); + break; + case CardAdapter.TAB_SPORTS: + mSportsArray.add(parentCard); + break; + case CardAdapter.TAB_DATING: + mDatingArray.add(parentCard); + break; + default: + mMainPageArray.add(parentCard); + } + } + + public int getSize(){ + return mMainPageArray.size(); + } + + public static Singleton singleton; + + public static Singleton getInstance() { + if(singleton == null){ + singleton = new Singleton(); + } + return singleton; + } + +} diff --git a/Late.ly/app/src/main/java/com/example/android/lately/TabAdapter.java b/Late.ly/app/src/main/java/com/example/android/lately/TabAdapter.java new file mode 100644 index 0000000..a984973 --- /dev/null +++ b/Late.ly/app/src/main/java/com/example/android/lately/TabAdapter.java @@ -0,0 +1,213 @@ +package com.example.android.lately; + +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentStatePagerAdapter; + +import com.example.android.lately.Fragments.Fragment1; +import com.example.android.lately.Fragments.FragmentAnimals; +import com.example.android.lately.Fragments.FragmentCareer; +import com.example.android.lately.Fragments.FragmentDancing; +import com.example.android.lately.Fragments.FragmentDating; +import com.example.android.lately.Fragments.FragmentFood; +import com.example.android.lately.Fragments.FragmentLanguage; +import com.example.android.lately.Fragments.FragmentNature; +import com.example.android.lately.Fragments.FragmentPolitics; +import com.example.android.lately.Fragments.FragmentSports; +import com.example.android.lately.Fragments.FragmentTech; + +import java.util.ArrayList; + +/** + * Created by ShowMe on 3/7/16. + */ +public class TabAdapter extends FragmentStatePagerAdapter { + + int mTabNumber; + ArrayList selections = new ArrayList(); +//selections. + + public TabAdapter(FragmentManager fm, int tabNumber) { + super(fm); + this.mTabNumber = tabNumber; + } + + +// ArrayList selections = new ArrayList(); +//get the arraylist of selections and feed it into here. + + @Override + public Fragment getItem(int position) { + + switch (position) { + case 0: + Fragment1 tab1 = new Fragment1(); + return tab1; + case 1: +// Fragment tab2 = getFragmentForCategory(selections); + Fragment tab2 = new Fragment1(); + + return tab2; + case 2: +// Fragment tab3 = getFragmentForCategory(selections); + Fragment tab3 = new Fragment1(); + + return tab3; + case 3: +// Fragment tab4 = getFragmentForCategory(selections); + Fragment tab4 = new Fragment1(); + + return tab4; + case 4: +// Fragment tab5 = getFragmentForCategory(selections); + Fragment tab5 = new Fragment1(); + + return tab5; + case 5: +// Fragment tab6 = getFragmentForCategory(selections); + Fragment tab6 = new Fragment1(); + + return tab6; + case 6: +// Fragment tab7 = getFragmentForCategory(selections); + Fragment tab7 = new Fragment1(); + + return tab7; + case 7: +// Fragment tab8 = getFragmentForCategory(selections); + Fragment tab8 = new Fragment1(); + + return tab8; + case 8: +// Fragment tab9 = getFragmentForCategory(selections); + Fragment tab9 = new Fragment1(); + + return tab9; + case 9: +// Fragment tab10 = getFragmentForCategory(selections); + Fragment tab10 = new Fragment1(); + + return tab10; + case 10: +// Fragment tab11 = getFragmentForCategory(selections); + Fragment tab11 = new Fragment1(); + + return tab11; + default: + return null; + + + + +// switch (position) { +// case 0: +// Fragment1 tab1 = new Fragment1(); +// return tab1; +// case 1: +// Fragment tab2 = getFragmentForCategory(Selections().get(0)); +// // Fragment tab2 = new Fragment1(); +// return tab2; +// case 2: +// Fragment tab3 = getFragmentForCategory(Selections().get(1)); +//// Fragment tab3 = new Fragment1(); +// +// return tab3; +// case 3: +// Fragment tab4 = getFragmentForCategory(Selections().get(2)); +//// Fragment tab4 = new Fragment1(); +// +// return tab4; +// case 4: +// Fragment tab5 = getFragmentForCategory(Selections().get(3)); +//// Fragment tab5 = new Fragment1(); +// +// return tab5; +// case 5: +// Fragment tab6 = getFragmentForCategory(Selections().get(4)); +//// Fragment tab6 = new Fragment1(); +// +// return tab6; +// case 6: +// Fragment tab7 = getFragmentForCategory(Selections().get(5)); +//// Fragment tab7 = new Fragment1(); +// +// return tab7; +// case 7: +// Fragment tab8 = getFragmentForCategory(Selections().get(6)); +//// Fragment tab8 = new Fragment1(); +// +// return tab8; +// case 8: +// Fragment tab9 = getFragmentForCategory(Selections().get(7)); +//// Fragment tab9 = new Fragment1(); +// +// return tab9; +// case 9: +// Fragment tab10 = getFragmentForCategory(Selections().get(8)); +//// Fragment tab10 = new Fragment1(); +// +// return tab10; +// case 10: +// Fragment tab11 = getFragmentForCategory(Selections().get(9)); +//// Fragment tab11 = new Fragment1(); +// +// return tab11; +// default: +// return null; + + + + + + + } + } +//// TODO: 3/11/16 cases similar to cardadapter + + @Override + public int getCount() { + return mTabNumber; + } + + public Fragment getFragmentForCategory(String category){ + Fragment fragment; + + + switch (category){ + case "Animals": + fragment = new FragmentAnimals(); + return fragment; + case "Career": + fragment = new FragmentCareer(); + return fragment; + case "Dancing": + fragment = new FragmentDancing(); + return fragment; + case "Dating": + fragment = new FragmentDating(); + return fragment; + case "Food": + fragment = new FragmentFood(); + return fragment; + case "Language": + fragment = new FragmentLanguage(); + return fragment; + case "Nature": + fragment = new FragmentNature(); + return fragment; + case "Politics": + fragment = new FragmentPolitics(); + return fragment; + case "Sports": + fragment = new FragmentSports(); + return fragment; + case "Tech": + fragment = new FragmentTech(); + return fragment; + + } + return null; + } + +} + diff --git a/Late.ly/app/src/main/res/drawable-hdpi/animals_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/animals_icon.png new file mode 100755 index 0000000..cfd4d43 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/animals_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/career_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/career_icon.png new file mode 100755 index 0000000..3c34e0a Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/career_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/dating_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/dating_icon.png new file mode 100755 index 0000000..2799e66 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/dating_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/food_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/food_icon.png new file mode 100755 index 0000000..c3e8d3d Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/food_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/ic_home.png b/Late.ly/app/src/main/res/drawable-hdpi/ic_home.png new file mode 100755 index 0000000..e0541ed Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/ic_home.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/language_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/language_icon.png new file mode 100755 index 0000000..a0d772f Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/language_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/nature_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/nature_icon.png new file mode 100755 index 0000000..db4f6d8 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/nature_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/politics_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/politics_icon.png new file mode 100755 index 0000000..ee5c321 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/politics_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/sports_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/sports_icon.png new file mode 100755 index 0000000..85b88f0 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/sports_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-hdpi/tech_icon.png b/Late.ly/app/src/main/res/drawable-hdpi/tech_icon.png new file mode 100755 index 0000000..3d44dbb Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-hdpi/tech_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/animal_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/animal_icon.png new file mode 100755 index 0000000..3759a57 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/animal_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/animals_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/animals_icon.png new file mode 100755 index 0000000..480ffb2 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/animals_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/career_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/career_icon.png new file mode 100755 index 0000000..52c2b9a Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/career_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/dating_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/dating_icon.png new file mode 100755 index 0000000..0af7ff5 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/dating_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/facebook.png b/Late.ly/app/src/main/res/drawable-mdpi/facebook.png new file mode 100644 index 0000000..2a0ca40 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/facebook.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/food_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/food_icon.png new file mode 100755 index 0000000..5cb9e49 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/food_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/foursquare.png b/Late.ly/app/src/main/res/drawable-mdpi/foursquare.png new file mode 100644 index 0000000..220b0e1 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/foursquare.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/ic_home.png b/Late.ly/app/src/main/res/drawable-mdpi/ic_home.png new file mode 100755 index 0000000..815942e Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/ic_home.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/language_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/language_icon.png new file mode 100755 index 0000000..7db84c1 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/language_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/nature_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/nature_icon.png new file mode 100755 index 0000000..b7397ee Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/nature_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/politics_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/politics_icon.png new file mode 100755 index 0000000..fd74594 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/politics_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/reddit.png b/Late.ly/app/src/main/res/drawable-mdpi/reddit.png new file mode 100644 index 0000000..62b5881 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/reddit.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/sports_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/sports_icon.png new file mode 100755 index 0000000..4308e86 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/sports_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-mdpi/tech_icon.png b/Late.ly/app/src/main/res/drawable-mdpi/tech_icon.png new file mode 100755 index 0000000..f560768 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-mdpi/tech_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/animal_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/animal_icon.png new file mode 100755 index 0000000..0ea132c Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/animal_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/animals_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/animals_icon.png new file mode 100755 index 0000000..0a63aef Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/animals_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/career_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/career_icon.png new file mode 100755 index 0000000..32bf23b Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/career_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/dance_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/dance_icon.png new file mode 100755 index 0000000..82fdffe Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/dance_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/dating_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/dating_icon.png new file mode 100755 index 0000000..49b1c41 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/dating_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/food_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/food_icon.png new file mode 100755 index 0000000..2bcf4aa Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/food_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/ic_home.png b/Late.ly/app/src/main/res/drawable-xhdpi/ic_home.png new file mode 100755 index 0000000..02e4747 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/ic_home.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/language_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/language_icon.png new file mode 100755 index 0000000..6017ae4 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/language_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/nature_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/nature_icon.png new file mode 100755 index 0000000..f3c6908 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/nature_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/politics_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/politics_icon.png new file mode 100755 index 0000000..b0ea8d5 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/politics_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/sports_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/sports_icon.png new file mode 100755 index 0000000..f7f0010 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/sports_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xhdpi/tech_icon.png b/Late.ly/app/src/main/res/drawable-xhdpi/tech_icon.png new file mode 100755 index 0000000..93c1584 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xhdpi/tech_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/animal_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/animal_icon.png new file mode 100755 index 0000000..78ab848 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/animal_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/animals_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/animals_icon.png new file mode 100755 index 0000000..582045a Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/animals_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/career_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/career_icon.png new file mode 100755 index 0000000..50179e4 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/career_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/dance_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/dance_icon.png new file mode 100755 index 0000000..5333b7b Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/dance_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/dating_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/dating_icon.png new file mode 100755 index 0000000..bb8e1ab Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/dating_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/food_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/food_icon.png new file mode 100755 index 0000000..3177905 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/food_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/ic_home.png b/Late.ly/app/src/main/res/drawable-xxhdpi/ic_home.png new file mode 100755 index 0000000..4c5c231 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/ic_home.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/language_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/language_icon.png new file mode 100755 index 0000000..4be309c Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/language_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/nature_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/nature_icon.png new file mode 100755 index 0000000..1e4c85e Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/nature_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/politics_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/politics_icon.png new file mode 100755 index 0000000..4eaa554 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/politics_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/sports_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/sports_icon.png new file mode 100755 index 0000000..6af5bb6 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/sports_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxhdpi/tech_icon.png b/Late.ly/app/src/main/res/drawable-xxhdpi/tech_icon.png new file mode 100755 index 0000000..f5dfc8f Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxhdpi/tech_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/animal_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/animal_icon.png new file mode 100755 index 0000000..8c9d68f Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/animal_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/animals_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/animals_icon.png new file mode 100755 index 0000000..5f261bb Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/animals_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/career_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/career_icon.png new file mode 100755 index 0000000..7415eb0 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/career_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/dance_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/dance_icon.png new file mode 100755 index 0000000..1d7cccc Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/dance_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/dating_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/dating_icon.png new file mode 100755 index 0000000..973af68 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/dating_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/food_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/food_icon.png new file mode 100755 index 0000000..4173d5d Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/food_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/ic_home.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/ic_home.png new file mode 100755 index 0000000..65e702e Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/ic_home.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/language_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/language_icon.png new file mode 100755 index 0000000..dc915b1 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/language_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/nature_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/nature_icon.png new file mode 100755 index 0000000..40203e4 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/nature_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/politics_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/politics_icon.png new file mode 100755 index 0000000..1ff90d4 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/politics_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/sports_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/sports_icon.png new file mode 100755 index 0000000..97414d5 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/sports_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable-xxxhdpi/tech_icon.png b/Late.ly/app/src/main/res/drawable-xxxhdpi/tech_icon.png new file mode 100755 index 0000000..e28de72 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable-xxxhdpi/tech_icon.png differ diff --git a/Late.ly/app/src/main/res/drawable/weight.png b/Late.ly/app/src/main/res/drawable/weight.png new file mode 100644 index 0000000..2b3b6d6 Binary files /dev/null and b/Late.ly/app/src/main/res/drawable/weight.png differ diff --git a/Late.ly/app/src/main/res/layout-land/activity_main.xml b/Late.ly/app/src/main/res/layout-land/activity_main.xml new file mode 100644 index 0000000..e6db651 --- /dev/null +++ b/Late.ly/app/src/main/res/layout-land/activity_main.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Late.ly/app/src/main/res/layout/activity_login.xml b/Late.ly/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..3327a96 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/Late.ly/app/src/main/res/layout/activity_main.xml b/Late.ly/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..381cb04 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,39 @@ + + + + + + + + + + diff --git a/Late.ly/app/src/main/res/layout/event_card.xml b/Late.ly/app/src/main/res/layout/event_card.xml new file mode 100644 index 0000000..22c5b0b --- /dev/null +++ b/Late.ly/app/src/main/res/layout/event_card.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/facebook_card.xml b/Late.ly/app/src/main/res/layout/facebook_card.xml new file mode 100644 index 0000000..2f67531 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/facebook_card.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/foursquare_card.xml b/Late.ly/app/src/main/res/layout/foursquare_card.xml new file mode 100644 index 0000000..ca1bd70 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/foursquare_card.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/fragment_details.xml b/Late.ly/app/src/main/res/layout/fragment_details.xml new file mode 100644 index 0000000..11422b0 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/fragment_details.xml @@ -0,0 +1,14 @@ + + + + + + diff --git a/Late.ly/app/src/main/res/layout/fragment_fragment1.xml b/Late.ly/app/src/main/res/layout/fragment_fragment1.xml new file mode 100644 index 0000000..3b1aaba --- /dev/null +++ b/Late.ly/app/src/main/res/layout/fragment_fragment1.xml @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/Late.ly/app/src/main/res/layout/large_picture_article.xml b/Late.ly/app/src/main/res/layout/large_picture_article.xml new file mode 100644 index 0000000..74f4702 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/large_picture_article.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/reddit_card.xml b/Late.ly/app/src/main/res/layout/reddit_card.xml new file mode 100644 index 0000000..8b0b763 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/reddit_card.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/reddit_comment_card.xml b/Late.ly/app/src/main/res/layout/reddit_comment_card.xml new file mode 100644 index 0000000..0da9167 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/reddit_comment_card.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/selection_page.xml b/Late.ly/app/src/main/res/layout/selection_page.xml new file mode 100644 index 0000000..78d65d2 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/selection_page.xml @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Late.ly/app/src/main/res/layout/small_picture_article.xml b/Late.ly/app/src/main/res/layout/small_picture_article.xml new file mode 100644 index 0000000..9d136ee --- /dev/null +++ b/Late.ly/app/src/main/res/layout/small_picture_article.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/layout/weather_card.xml b/Late.ly/app/src/main/res/layout/weather_card.xml new file mode 100644 index 0000000..99e0e89 --- /dev/null +++ b/Late.ly/app/src/main/res/layout/weather_card.xml @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/menu/main.xml b/Late.ly/app/src/main/res/menu/main.xml new file mode 100644 index 0000000..14c620c --- /dev/null +++ b/Late.ly/app/src/main/res/menu/main.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/Late.ly/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Late.ly/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..cde69bc Binary files /dev/null and b/Late.ly/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/Late.ly/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Late.ly/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c133a0c Binary files /dev/null and b/Late.ly/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/Late.ly/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Late.ly/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..bfa42f0 Binary files /dev/null and b/Late.ly/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/Late.ly/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Late.ly/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..324e72c Binary files /dev/null and b/Late.ly/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/Late.ly/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Late.ly/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..aee44e1 Binary files /dev/null and b/Late.ly/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/Late.ly/app/src/main/res/values-w820dp/dimens.xml b/Late.ly/app/src/main/res/values-w820dp/dimens.xml new file mode 100644 index 0000000..63fc816 --- /dev/null +++ b/Late.ly/app/src/main/res/values-w820dp/dimens.xml @@ -0,0 +1,6 @@ + + + 64dp + diff --git a/Late.ly/app/src/main/res/values/colors.xml b/Late.ly/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..facb714 --- /dev/null +++ b/Late.ly/app/src/main/res/values/colors.xml @@ -0,0 +1,70 @@ + + + #3F51B5 + #303F9F + #283593 + #FF4081 + + + #FFC107 + #FFA000 + #FF8F00 + #FF4081 + + + #03A9F4 + #0288D1 + #0277BD + #FF4081 + + + #9C27B0 + #7B1FA2 + #6A1B9A + #FF4081 + + + #F44336 + #D32F2F + #C62828 + #FF4081 + + + #4CAF50 + #388E3C + #1B5E20 + #FF4081 + + + #9E9E9E + #616161 + #424242 + #FF4081 + + + #CDDC39 + #AFB42B + #9E9D24 + #FF4081 + + + #2196F3 + #1976D2 + #1565C0 + #FF4081 + + + #009688 + #00796B + #00695C + #FF4081 + + #8BC34A + #689F38 + #558B2F + #FF4081 + + + #ffee00 + + diff --git a/Late.ly/app/src/main/res/values/dimens.xml b/Late.ly/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..02d4637 --- /dev/null +++ b/Late.ly/app/src/main/res/values/dimens.xml @@ -0,0 +1,6 @@ + + + 16dp + 16dp + + diff --git a/Late.ly/app/src/main/res/values/strings.xml b/Late.ly/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..971d1f5 --- /dev/null +++ b/Late.ly/app/src/main/res/values/strings.xml @@ -0,0 +1,23 @@ + + Late.ly + Frag 1 + Frag 2 + Frag 3 + Frag 4 + Frag 5 + POLITICS + TECH + CAREER + FOOD + DANCING + ANIMALS + LANGUAGE + NATURE + SPORTS + DATING + + + Hello blank fragment + lately-1245 + + diff --git a/Late.ly/app/src/main/res/values/styles.xml b/Late.ly/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..0eb88fe --- /dev/null +++ b/Late.ly/app/src/main/res/values/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/Late.ly/app/src/test/java/com/example/android/lately/ExampleUnitTest.java b/Late.ly/app/src/test/java/com/example/android/lately/ExampleUnitTest.java new file mode 100644 index 0000000..5f837bf --- /dev/null +++ b/Late.ly/app/src/test/java/com/example/android/lately/ExampleUnitTest.java @@ -0,0 +1,15 @@ +package com.example.android.lately; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * To work on unit tests, switch the Test Artifact in the Build Variants view. + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/Late.ly/build.gradle b/Late.ly/build.gradle new file mode 100644 index 0000000..34d407e --- /dev/null +++ b/Late.ly/build.gradle @@ -0,0 +1,24 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + jcenter() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.0' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +allprojects { + repositories { + jcenter() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/Late.ly/gradle.properties b/Late.ly/gradle.properties new file mode 100644 index 0000000..1d3591c --- /dev/null +++ b/Late.ly/gradle.properties @@ -0,0 +1,18 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true \ No newline at end of file diff --git a/Late.ly/gradle/wrapper/gradle-wrapper.jar b/Late.ly/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..05ef575 Binary files /dev/null and b/Late.ly/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Late.ly/gradle/wrapper/gradle-wrapper.properties b/Late.ly/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..f23df6e --- /dev/null +++ b/Late.ly/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Oct 21 11:34:03 PDT 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip diff --git a/Late.ly/gradlew b/Late.ly/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/Late.ly/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/Late.ly/gradlew.bat b/Late.ly/gradlew.bat new file mode 100644 index 0000000..aec9973 --- /dev/null +++ b/Late.ly/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/Late.ly/settings.gradle b/Late.ly/settings.gradle new file mode 100644 index 0000000..e7b4def --- /dev/null +++ b/Late.ly/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/README.md b/README.md index f2d0405..07db559 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,39 @@ -# ![](https://ga-dash.s3.amazonaws.com/production/assets/logo-9f88ae6c9c3871690e33280fcf557f33.png) Project Readme +Late.ly +=================== +Introduction +------------ +Late.ly is an advanced app developed to enhance the experience of the user and acts as a central hub for the latest and most relevant information for the user. At a glance access view is used for the most commonly accessed information. Late.ly centers around the user to provide an elevated mobile experience. -> Make sure to edit this file. You are required to provide a readme file describing what the app does, links to your Trello board, and any bugs that may exist! +---------- +Features Overview +------------- + +Supported social media platforms: + +> - Facebook +> - Reddit +> - Foursquare +> - Meetup + +Additional features: +> - Minimalism design +> - Weather (Forecast.io) +> - Cardviews +> - Status notifications +> - Phone status + +> **Note:** + +> - For full features access, additional network authentication is required. + + +Features Details +---------------------------------------- +Cardviews in the app displays pertinent information that caters to the user's preference. The initial launch of Late.ly will prompt the user to select topics or categories of interest which will then populate the tabs of the main screen. The application includes support for access to social media information from Facebook, Reddit, Meetup and Foursquare. A user account would be needed in order for the feed to be active for network tasks or syncs in the background. + +In addition to the customized user experience, the application also has built-in support for weather and the status of wi-fi on the device wrapped into a minimalist theme without sacrificing functionality. Late.ly aims to be the hub of the phone device! + + +User Interface +---------------------------------------------- + diff --git a/mainmenu_1024.png b/mainmenu_1024.png new file mode 100644 index 0000000..0f8f0e6 Binary files /dev/null and b/mainmenu_1024.png differ