|
|
@ -23,12 +23,14 @@ import android.content.SharedPreferences; |
|
|
|
import android.graphics.drawable.Drawable; |
|
|
|
import android.graphics.drawable.Drawable; |
|
|
|
import android.os.SystemClock; |
|
|
|
import android.os.SystemClock; |
|
|
|
import android.preference.PreferenceManager; |
|
|
|
import android.preference.PreferenceManager; |
|
|
|
|
|
|
|
import android.support.design.widget.FloatingActionButton; |
|
|
|
import android.support.design.widget.TabLayout; |
|
|
|
import android.support.design.widget.TabLayout; |
|
|
|
import android.support.v4.view.ViewPager; |
|
|
|
import android.support.v4.view.ViewPager; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.support.v7.widget.Toolbar; |
|
|
|
import android.support.v7.widget.Toolbar; |
|
|
|
import android.view.Menu; |
|
|
|
import android.view.Menu; |
|
|
|
import android.view.MenuItem; |
|
|
|
import android.view.MenuItem; |
|
|
|
|
|
|
|
import android.view.View; |
|
|
|
|
|
|
|
|
|
|
|
import com.android.volley.AuthFailureError; |
|
|
|
import com.android.volley.AuthFailureError; |
|
|
|
import com.android.volley.Request; |
|
|
|
import com.android.volley.Request; |
|
|
@ -62,6 +64,15 @@ public class MainActivity extends BaseActivity { |
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); |
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); |
|
|
|
setSupportActionBar(toolbar); |
|
|
|
setSupportActionBar(toolbar); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn); |
|
|
|
|
|
|
|
floatingBtn.setOnClickListener(new View.OnClickListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void onClick(View v) { |
|
|
|
|
|
|
|
Intent intent = new Intent(getApplicationContext(), ComposeActivity.class); |
|
|
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Setup the tabs and timeline pager.
|
|
|
|
// Setup the tabs and timeline pager.
|
|
|
|
TimelinePagerAdapter adapter = new TimelinePagerAdapter(getSupportFragmentManager()); |
|
|
|
TimelinePagerAdapter adapter = new TimelinePagerAdapter(getSupportFragmentManager()); |
|
|
|
String[] pageTitles = { |
|
|
|
String[] pageTitles = { |
|
|
@ -170,11 +181,6 @@ public class MainActivity extends BaseActivity { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
|
switch (item.getItemId()) { |
|
|
|
switch (item.getItemId()) { |
|
|
|
case R.id.action_compose: { |
|
|
|
|
|
|
|
Intent intent = new Intent(this, ComposeActivity.class); |
|
|
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case R.id.action_view_profile: { |
|
|
|
case R.id.action_view_profile: { |
|
|
|
Intent intent = new Intent(this, AccountActivity.class); |
|
|
|
Intent intent = new Intent(this, AccountActivity.class); |
|
|
|
intent.putExtra("id", loggedInAccountId); |
|
|
|
intent.putExtra("id", loggedInAccountId); |
|
|
|