|
|
@ -43,6 +43,7 @@ import com.android.volley.Request; |
|
|
|
import com.android.volley.Response; |
|
|
|
import com.android.volley.Response; |
|
|
|
import com.android.volley.VolleyError; |
|
|
|
import com.android.volley.VolleyError; |
|
|
|
import com.android.volley.toolbox.JsonObjectRequest; |
|
|
|
import com.android.volley.toolbox.JsonObjectRequest; |
|
|
|
|
|
|
|
import com.arlib.floatingsearchview.FloatingSearchView; |
|
|
|
import com.keylesspalace.tusky.entity.Account; |
|
|
|
import com.keylesspalace.tusky.entity.Account; |
|
|
|
import com.mikepenz.google_material_typeface_library.GoogleMaterial; |
|
|
|
import com.mikepenz.google_material_typeface_library.GoogleMaterial; |
|
|
|
import com.mikepenz.materialdrawer.AccountHeader; |
|
|
|
import com.mikepenz.materialdrawer.AccountHeader; |
|
|
@ -63,6 +64,7 @@ import org.json.JSONException; |
|
|
|
import org.json.JSONObject; |
|
|
|
import org.json.JSONObject; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Stack; |
|
|
|
import java.util.Stack; |
|
|
|
|
|
|
|
|
|
|
@ -90,8 +92,8 @@ public class MainActivity extends BaseActivity { |
|
|
|
// Fetch user info while we're doing other things.
|
|
|
|
// Fetch user info while we're doing other things.
|
|
|
|
fetchUserInfo(); |
|
|
|
fetchUserInfo(); |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn); |
|
|
|
floatingBtn.setOnClickListener(new View.OnClickListener() { |
|
|
|
floatingBtn.setOnClickListener(new View.OnClickListener() { |
|
|
@ -102,6 +104,8 @@ public class MainActivity extends BaseActivity { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final FloatingSearchView searchView = (FloatingSearchView) findViewById(R.id.floating_search_view); |
|
|
|
|
|
|
|
|
|
|
|
headerResult = new AccountHeaderBuilder() |
|
|
|
headerResult = new AccountHeaderBuilder() |
|
|
|
.withActivity(this) |
|
|
|
.withActivity(this) |
|
|
|
.withSelectionListEnabledForSingleProfile(false) |
|
|
|
.withSelectionListEnabledForSingleProfile(false) |
|
|
@ -123,7 +127,7 @@ public class MainActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
|
|
|
drawer = new DrawerBuilder() |
|
|
|
drawer = new DrawerBuilder() |
|
|
|
.withActivity(this) |
|
|
|
.withActivity(this) |
|
|
|
.withToolbar(toolbar) |
|
|
|
//.withToolbar(toolbar)
|
|
|
|
.withAccountHeader(headerResult) |
|
|
|
.withAccountHeader(headerResult) |
|
|
|
.withHasStableIds(true) |
|
|
|
.withHasStableIds(true) |
|
|
|
.withSelectedItem(-1) |
|
|
|
.withSelectedItem(-1) |
|
|
@ -175,6 +179,8 @@ public class MainActivity extends BaseActivity { |
|
|
|
}) |
|
|
|
}) |
|
|
|
.build(); |
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchView.attachNavigationDrawerToMenuButton(drawer.getDrawerLayout()); |
|
|
|
|
|
|
|
|
|
|
|
// 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 = { |
|
|
|