package xyz.gsora.toot;

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import butterknife.BindView;
import butterknife.ButterKnife;

import java.util.Locale;

public class UserTimeline extends AppCompatActivity {

    private static final String TAG = UserTimeline.class.getSimpleName();

    private static String systemLocale;

    @BindView(R.id.statuses_list)
    RecyclerView statusList;
    @BindView(R.id.newToot)
    FloatingActionButton newTootFAB;

    MenuItem toot_settings_button;
    StatusesListAdapter adpt;
    LinearLayoutManager llm;

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

        systemLocale = Locale.getDefault().getLanguage();

        final Mocker m = new Mocker(this);
        llm = new LinearLayoutManager(getApplicationContext());

        /*CoolDivider dividerItemDecoration = new CoolDivider(statusList.getContext(),
                llm.getOrientation(),
                72,
                R.id.avatar);*/

        statusList.setLayoutManager(llm);
        //statusList.addItemDecoration(dividerItemDecoration);
        adpt = new StatusesListAdapter(m.getMockStatuses(), this.getApplicationContext(), systemLocale);
        statusList.setAdapter(adpt);

        // Setup FAB action
        newTootFAB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(UserTimeline.this, SendToot.class);
                startActivity(i);
            }
        });
    }

    // add the settings button
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.settings_menu_timeline, menu);
        toot_settings_button = menu.findItem(R.id.toot_settings_button);

        return super.onCreateOptionsMenu(menu);
    }

    public void tappedView(View v) {
        Log.d(TAG, "tapped " + v.toString());
    }
}

@@ -288,33 +288,8 @@
 ew;%0A
-import android.util.Log;%0A
 impo
@@ -1225,288 +1225,48 @@
 );%0A%0A
-        /*CoolDivider dividerItemDecoration = new CoolDivider(statusList.getContext(),%0A                llm.getOrientation(),%0A                72,%0A                R.id.avatar);*/%0A%0A        statusList.setLayoutManager(llm);%0A        //statusList.addItemDecoration(dividerItemDecoration
+%0A        statusList.setLayoutManager(llm
 );%0A 
@@ -1477,98 +1477,16 @@
 ner(
-new View.OnClickListener() %7B%0A            @Override%0A            public void onClick
 (View v)
  %7B%0A 
@@ -1473,32 +1473,35 @@
 istener((View v)
+ -%3E
  %7B%0A             
@@ -1599,22 +1599,8 @@
 i);%0A
-            %7D%0A
     
@@ -1914,97 +1914,7 @@
    %7D
-%0A%0A    public void tappedView(View v) %7B%0A        Log.d(TAG, %22tapped %22 + v.toString());%0A    %7D
 %0A%7D%0A

remove unused debug method, plus now we have some more lambda!