package ca.ualberta.cmput301f17t08.habitrabbit;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

/**
 * Created by yuxuanzhao on 2017-11-07.
 */

public class FeedActivity extends AppCompatActivity {


    private ArrayList<HabitEvent> feedList;
    private feedAdapter cAdapt;
    private RecyclerView feedRecyclerView;








    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.feed);



        feedRecyclerView = (RecyclerView) findViewById(R.id.feed_recycle);
        feedRecyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.VERTICAL, false));

        feedList = LoginManager.getInstance().getCurrentUser().getHistory();

        ArrayList<Integer> frequency = new ArrayList<Integer>(Arrays.asList(new Integer[]{1,0,1,0,1,0,1}));
        Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("America/Edmonton"));
        Date now = calendar.getTime();

        for(int counter=0; counter < 2; counter++){
            feedList.add(counter,new HabitEvent(new Habit("singing","hdkhfajk",now,frequency),now,"what the hell",null,null));
        }
        cAdapt = new feedAdapter(LoginManager.getInstance().getCurrentUser().getUsername(),feedList);
        feedRecyclerView.setAdapter(cAdapt);


    }

    public void showMenu(View v){
        Intent intent = new Intent(this, MenuActivity.class);
        startActivity(intent);
    }



}

@@ -511,17 +511,16 @@
 vity %7B%0A%0A
-%0A
     priv
@@ -632,22 +632,16 @@
 View;%0A%0A%0A
-%0A%0A%0A%0A%0A%0A
     @Ove
@@ -786,19 +786,16 @@
 .feed);%0A
-%0A%0A%0A
         
@@ -991,17 +991,16 @@
 alse));%0A
-%0A
         
@@ -1313,197 +1313,8 @@
 );%0A%0A
-        for(int counter=0; counter %3C 2; counter++)%7B%0A            feedList.add(counter,new HabitEvent(new Habit(%22singing%22,%22hdkhfajk%22,now,frequency),now,%22what the hell%22,null,null));%0A        %7D%0A
     
@@ -1456,18 +1456,16 @@
 Adapt);%0A
-%0A%0A
     %7D%0A%0A 
@@ -1594,15 +1594,12 @@
 t);%0A
+
     %7D%0A
-%0A%0A%0A
 %7D%0A

remove spacing