Drawer settings > First shot

- Remove bottom navigation view
- Add drawer layout
- Fix toolbar icon sizes
- Add settings activity in drawer layout
This commit is contained in:
Tanguy Herbron 2018-05-21 04:20:38 +02:00
parent 984956e535
commit 067ce01183
13 changed files with 227 additions and 207 deletions

View File

@ -1,17 +1,27 @@
package com.nauk.moodl.Activities; package com.nauk.moodl.Activities;
import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout; import android.support.design.widget.AppBarLayout;
import android.support.design.widget.BottomNavigationView; import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import com.nauk.moodl.Activities.DetailsActivityFragments.Home;
import com.nauk.moodl.Activities.HomeActivityFragments.MarketCapitalization;
import com.nauk.moodl.Activities.HomeActivityFragments.Summary;
import com.nauk.moodl.Activities.HomeActivityFragments.Watchlist;
import com.nauk.moodl.HomeActivityPagerAdapter; import com.nauk.moodl.HomeActivityPagerAdapter;
import com.nauk.moodl.LayoutManagers.CustomViewPager; import com.nauk.moodl.LayoutManagers.CustomViewPager;
import com.nauk.moodl.R; import com.nauk.moodl.R;
@ -26,31 +36,11 @@ import com.nauk.moodl.R;
public class HomeActivity extends AppCompatActivity { public class HomeActivity extends AppCompatActivity {
private BottomNavigationView bottomNavigationView; private DrawerLayout drawerLayout;
private CustomViewPager viewPager; private Fragment watchlistFragment;
private Fragment holdingsFragment;
private Fragment marketFragment;
private BottomNavigationView.OnNavigationItemSelectedListener onNavigationItemSelectedListener private Fragment currentFragment;
= new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
item.setChecked(true);
switch (item.getItemId())
{
case R.id.navigation_watchlist:
viewPager.setCurrentItem(0);
break;
case R.id.navigation_currencies_list:
viewPager.setCurrentItem(1);
break;
case R.id.navigation_market_cap:
viewPager.setCurrentItem(2);
break;
}
return false;
}
};
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -63,43 +53,81 @@ public class HomeActivity extends AppCompatActivity {
setContentView(R.layout.activity_currency_summary); setContentView(R.layout.activity_currency_summary);
viewPager = findViewById(R.id.viewPager); watchlistFragment = new Watchlist();
final HomeActivityPagerAdapter adapter = new HomeActivityPagerAdapter(getSupportFragmentManager(), 3); holdingsFragment = new Summary();
marketFragment = new MarketCapitalization();
viewPager.setAdapter(adapter); getSupportFragmentManager().beginTransaction()
viewPager.setOffscreenPageLimit(2); .add(R.id.content_frame, watchlistFragment)
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { .addToBackStack(null)
.add(R.id.content_frame, marketFragment)
.addToBackStack(null)
.add(R.id.content_frame, holdingsFragment)
.addToBackStack(null)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit();
drawerLayout = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
showFragment(holdingsFragment);
navigationView.setCheckedItem(R.id.navigation_currencies_list);
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override @Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { public boolean onNavigationItemSelected(@NonNull MenuItem item) {
if(!bottomNavigationView.getMenu().getItem(position).isChecked())
switch (item.getItemId())
{ {
bottomNavigationView.getMenu().getItem(position).setChecked(true); case R.id.navigation_watchlist:
showFragment(watchlistFragment);
break;
case R.id.navigation_currencies_list:
showFragment(holdingsFragment);
break;
case R.id.navigation_market_cap:
showFragment(marketFragment);
break;
case R.id.navigation_settings:
Intent settingIntent = new Intent(getApplicationContext(), SettingsActivity.class);
startActivity(settingIntent);
break;
} }
item.setChecked(true);
drawerLayout.closeDrawers();
if(position % 2 == 0) return false;
{
((AppBarLayout) findViewById(R.id.app_bar)).setExpanded(false, true);
}
}
@Override
public void onPageSelected(int position) {
}
@Override
public void onPageScrollStateChanged(int state) {
} }
}); });
//Objects initialization //Objects initialization
//Layouts setup //Layouts setup
}
bottomNavigationView = findViewById(R.id.navigationSummary); private void showFragment(Fragment fragment) {
bottomNavigationView.setOnNavigationItemSelectedListener(onNavigationItemSelectedListener); FragmentManager fragmentManager = getSupportFragmentManager();
bottomNavigationView.setSelectedItemId(R.id.navigation_currencies_list);
if(currentFragment != null)
{
fragmentManager.beginTransaction()
.hide(currentFragment)
.show(fragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit();
}
else
{
fragmentManager.beginTransaction()
.show(fragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit();
}
currentFragment = fragment;
} }
@Override @Override

View File

@ -5,6 +5,8 @@ import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.text.SpannableString; import android.text.SpannableString;
import android.util.Log; import android.util.Log;
@ -73,13 +75,33 @@ public class MarketCapitalization extends Fragment {
setupRefreshLayout(); setupRefreshLayout();
setupSettingsButton(); setupDrawerButton();
updateMarketCap(true); updateMarketCap(true);
return view; return view;
} }
private void setupDrawerButton()
{
ImageButton drawerButton = view.findViewById(R.id.drawer_button);
drawerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DrawerLayout drawerLayout = getActivity().findViewById(R.id.drawer_layout);
if(drawerLayout.isDrawerOpen(GravityCompat.START))
{
drawerLayout.closeDrawers();
}
else
{
drawerLayout.openDrawer(GravityCompat.START);
}
}
});
}
private void setupRefreshLayout() private void setupRefreshLayout()
{ {
refreshLayout = view.findViewById(R.id.swiperefreshmarketcap); refreshLayout = view.findViewById(R.id.swiperefreshmarketcap);
@ -95,19 +117,6 @@ public class MarketCapitalization extends Fragment {
); );
} }
private void setupSettingsButton()
{
ImageButton settingsButton = view.findViewById(R.id.settings_button);
settingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent settingIntent = new Intent(getActivity(), SettingsActivity.class);
startActivity(settingIntent);
}
});
}
@Override @Override
public void onResume() public void onResume()
{ {
@ -263,13 +272,11 @@ public class MarketCapitalization extends Fragment {
{ {
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
refreshLayout.setEnabled(false); refreshLayout.setEnabled(false);
((CustomViewPager) view.getParent().getParent().getParent().getParent().getParent()).setPagingEnabled(false);
break; break;
case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_MOVE:
break; break;
default: default:
refreshLayout.setEnabled(true); refreshLayout.setEnabled(true);
((CustomViewPager) view.getParent().getParent().getParent().getParent().getParent()).setPagingEnabled(true);
break; break;
} }

View File

@ -13,6 +13,8 @@ import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.graphics.Palette; import android.support.v7.graphics.Palette;
import android.util.Log; import android.util.Log;
@ -114,15 +116,35 @@ public class Summary extends Fragment {
setupAddCurrencyButton(fragmentView); setupAddCurrencyButton(fragmentView);
setupSettingsButton(fragmentView);
updateAll(true); updateAll(true);
setupDrawerButton(fragmentView);
generateSplashScreen(); generateSplashScreen();
return fragmentView; return fragmentView;
} }
private void setupDrawerButton(View view)
{
ImageButton drawerButton = view.findViewById(R.id.drawer_button);
drawerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DrawerLayout drawerLayout = getActivity().findViewById(R.id.drawer_layout);
if(drawerLayout.isDrawerOpen(GravityCompat.START))
{
drawerLayout.closeDrawers();
}
else
{
drawerLayout.openDrawer(GravityCompat.START);
}
}
});
}
private void initiateUpdateRunnable() private void initiateUpdateRunnable()
{ {
updateRunnable = new Runnable() { updateRunnable = new Runnable() {
@ -204,20 +226,6 @@ public class Summary extends Fragment {
}); });
} }
private void setupSettingsButton(View fragmentView)
{
ImageButton settingsButton = fragmentView.findViewById(R.id.settings_button);
settingsButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent settingIntent = new Intent(getActivity(), SettingsActivity.class);
startActivity(settingIntent);
}
});
}
private void generateSplashScreen() private void generateSplashScreen()
{ {
LinearLayout loadingLayout = new LinearLayout(getActivity()); LinearLayout loadingLayout = new LinearLayout(getActivity());
@ -291,14 +299,14 @@ public class Summary extends Fragment {
private void showErrorSnackbar() private void showErrorSnackbar()
{ {
Snackbar.make(getActivity().findViewById(R.id.snackbar_placer), "Error while updating data", Snackbar.LENGTH_LONG) /*Snackbar.make(getActivity().findViewById(R.id.snackbar_placer), "Error while updating data", Snackbar.LENGTH_LONG)
.setAction("Update", new View.OnClickListener() { .setAction("Update", new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
} }
}) })
.show(); .show();*/
} }
private void resetCounters() private void resetCounters()
@ -640,7 +648,7 @@ public class Summary extends Fragment {
{ {
private void generateSnackBarError(String error) private void generateSnackBarError(String error)
{ {
View view = getActivity().findViewById(R.id.snackbar_placer); /*View view = getActivity().findViewById(R.id.snackbar_placer);
switch (error) switch (error)
{ {
@ -673,7 +681,7 @@ public class Summary extends Fragment {
Log.d("moodl", error); Log.d("moodl", error);
updateAll(false); updateAll(false);
} }*/
} }
@Override @Override

View File

@ -3,45 +3,31 @@ package com.nauk.moodl.Activities.HomeActivityFragments;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.graphics.Palette; import android.support.v7.graphics.Palette;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.animation.Animation;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.nauk.moodl.Activities.CurrencyDetailsActivity;
import com.nauk.moodl.Activities.CurrencySelectionActivity; import com.nauk.moodl.Activities.CurrencySelectionActivity;
import com.nauk.moodl.Activities.HomeActivity; import com.nauk.moodl.Activities.HomeActivity;
import com.nauk.moodl.Activities.SettingsActivity; import com.nauk.moodl.Activities.SettingsActivity;
import com.nauk.moodl.DataManagers.BalanceManager; import com.nauk.moodl.DataManagers.BalanceManager;
import com.nauk.moodl.DataManagers.CurrencyData.Currency; import com.nauk.moodl.DataManagers.CurrencyData.Currency;
import com.nauk.moodl.DataManagers.CurrencyData.CurrencyCardview; import com.nauk.moodl.DataManagers.CurrencyData.CurrencyCardview;
import com.nauk.moodl.DataManagers.CurrencyData.CurrencyDataChart;
import com.nauk.moodl.DataManagers.CurrencyData.CurrencyDetailsList; import com.nauk.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
import com.nauk.moodl.DataManagers.CurrencyData.CurrencyTickerList; import com.nauk.moodl.DataManagers.CurrencyData.CurrencyTickerList;
import com.nauk.moodl.DataManagers.DatabaseManager;
import com.nauk.moodl.DataManagers.PreferencesManager; import com.nauk.moodl.DataManagers.PreferencesManager;
import com.nauk.moodl.DataManagers.WatchlistManager; import com.nauk.moodl.DataManagers.WatchlistManager;
import com.nauk.moodl.PlaceholderManager;
import com.nauk.moodl.R; import com.nauk.moodl.R;
import org.json.JSONException; import org.json.JSONException;
@ -50,16 +36,9 @@ import org.json.JSONObject;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import static com.nauk.moodl.MoodlBox.collapseH;
import static com.nauk.moodl.MoodlBox.collapseW; import static com.nauk.moodl.MoodlBox.collapseW;
import static com.nauk.moodl.MoodlBox.expandH;
import static com.nauk.moodl.MoodlBox.expandW; import static com.nauk.moodl.MoodlBox.expandW;
import static com.nauk.moodl.MoodlBox.getVerticalExpandAnimation;
import static com.nauk.moodl.MoodlBox.numberConformer;
import static java.lang.Math.abs; import static java.lang.Math.abs;
/** /**
@ -117,7 +96,7 @@ public class Watchlist extends Fragment {
setupAddWatchlistButton(); setupAddWatchlistButton();
setupSettingsButton(); setupDrawerButton();
setupEditButton(); setupEditButton();
@ -130,13 +109,13 @@ public class Watchlist extends Fragment {
editButton.setOnClickListener(new View.OnClickListener() { editButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
LinearLayout watchlistLayout = Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist);
if(editModeEnabled) if(editModeEnabled)
{ {
editModeEnabled = false; editModeEnabled = false;
LinearLayout watchlistLayout = Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist); for(int i = 0; i < watchlistLayout.getChildCount(); i++)
for(int i = 0; i < ((LinearLayout) Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist)).getChildCount(); i++)
{ {
View watchlistElement = watchlistLayout.getChildAt(i); View watchlistElement = watchlistLayout.getChildAt(i);
@ -148,9 +127,7 @@ public class Watchlist extends Fragment {
{ {
editModeEnabled = true; editModeEnabled = true;
LinearLayout watchlistLayout = Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist); for(int i = 0; i < watchlistLayout.getChildCount(); i++)
for(int i = 0; i < ((LinearLayout) Watchlist.this.view.findViewById(R.id.linearLayoutWatchlist)).getChildCount(); i++)
{ {
View watchlistElement = watchlistLayout.getChildAt(i); View watchlistElement = watchlistLayout.getChildAt(i);
@ -175,14 +152,22 @@ public class Watchlist extends Fragment {
}); });
} }
private void setupSettingsButton() private void setupDrawerButton()
{ {
ImageButton settingsButton = view.findViewById(R.id.settings_button); ImageButton drawerButton = view.findViewById(R.id.drawer_button);
settingsButton.setOnClickListener(new View.OnClickListener() { drawerButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
Intent settingIntent = new Intent(getActivity(), SettingsActivity.class); DrawerLayout drawerLayout = getActivity().findViewById(R.id.drawer_layout);
startActivity(settingIntent);
if(drawerLayout.isDrawerOpen(GravityCompat.START))
{
drawerLayout.closeDrawers();
}
else
{
drawerLayout.openDrawer(GravityCompat.START);
}
} }
}); });
} }

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
</vector>

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp" android:width="26dp"
android:height="36dp" android:height="26dp"
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path

View File

@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="36dp" android:width="24dp"
android:height="36dp" android:height="24dp"
android:viewportWidth="24.0" android:viewportWidth="24.0"
android:viewportHeight="24.0"> android:viewportHeight="24.0">
<path <path
android:fillColor="@color/buttonColor" android:fillColor="#FF000000"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/> android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector> </vector>

View File

@ -1,45 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:context="com.nauk.moodl.Activities.HomeActivity"> tools:context="com.nauk.moodl.Activities.HomeActivity">
<LinearLayout <FrameLayout
android:id="@+id/masterLayout" android:id="@+id/content_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" android:layout_gravity="start"
android:layout_marginBottom="56dp" app:menu="@menu/summary_navigation_drawer"/>
android:orientation="vertical"
android:background="@color/summary_background">
<android.support.design.widget.CoordinatorLayout </android.support.v4.widget.DrawerLayout>
android:id="@+id/snackbar_placer"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.nauk.moodl.LayoutManagers.CustomViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigationSummary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_alignParentBottom="true"
app:menu="@menu/navigation_home"
android:layout_gravity="bottom" />
</android.support.constraint.ConstraintLayout>

View File

@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true">
android:layout_marginBottom="56dp">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -24,6 +23,16 @@
app:layout_collapseMode="pin" app:layout_collapseMode="pin"
android:layout_margin="10dp"> android:layout_margin="10dp">
<ImageButton
android:id="@+id/drawer_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/action_settings"
android:background="@drawable/ic_drawer_white_24dp"
android:visibility="visible"
android:layout_gravity="start|center_vertical"
android:contentDescription="Drawer"/>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -34,16 +43,6 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textStyle="bold"/> android:textStyle="bold"/>
<ImageButton
android:id="@+id/settings_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/action_settings"
android:background="@drawable/ic_settings_black_24dp"
android:visibility="visible"
android:layout_gravity="end"
android:contentDescription="Settings"/>
</FrameLayout> </FrameLayout>
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>

View File

@ -53,14 +53,14 @@
android:layout_margin="10dp"> android:layout_margin="10dp">
<ImageButton <ImageButton
android:id="@+id/settings_button" android:id="@+id/drawer_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/action_settings" android:text="@string/action_settings"
android:background="@drawable/ic_drawer_white_24dp"
android:visibility="visible" android:visibility="visible"
android:layout_gravity="end" android:layout_gravity="start|center_vertical"
android:background="@drawable/ic_settings_black_24dp" android:contentDescription="Drawer"/>
android:contentDescription="Settings"/>
</FrameLayout> </FrameLayout>

View File

@ -3,8 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true" android:fitsSystemWindows="true">
android:layout_marginBottom="56dp">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -25,14 +24,14 @@
android:layout_margin="10dp"> android:layout_margin="10dp">
<ImageButton <ImageButton
android:id="@+id/edit_button" android:id="@+id/drawer_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/action_edit_mode" android:text="@string/action_settings"
android:background="@drawable/ic_mode_edit_white_24dp" android:background="@drawable/ic_drawer_white_24dp"
android:visibility="visible" android:visibility="visible"
android:layout_gravity="start" android:layout_gravity="start|center_vertical"
android:contentDescription="Edit mode"/> android:contentDescription="Drawer"/>
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
@ -45,14 +44,14 @@
android:textStyle="bold"/> android:textStyle="bold"/>
<ImageButton <ImageButton
android:id="@+id/settings_button" android:id="@+id/edit_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/action_settings" android:text="@string/action_edit_mode"
android:background="@drawable/ic_settings_black_24dp" android:background="@drawable/ic_mode_edit_white_24dp"
android:visibility="visible" android:visibility="visible"
android:layout_gravity="end" android:layout_gravity="end|center_vertical"
android:contentDescription="Settings"/> android:contentDescription="Edit mode"/>
</FrameLayout> </FrameLayout>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/navigation_watchlist"
android:icon="@drawable/ic_remove_red_eye_black_24dp"
android:title="@string/title_watchlist" />
<item
android:id="@+id/navigation_currencies_list"
android:icon="@drawable/ic_view_list_black_24dp"
android:title="@string/title_home" />
<item
android:id="@+id/navigation_market_cap"
android:icon="@drawable/ic_pie_chart_black_24dp"
android:title="@string/title_market_cap" />
</menu>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:checkableBehavior="single">
<item
android:id="@+id/navigation_currencies_list"
android:icon="@drawable/ic_view_list_black_24dp"
android:title="@string/title_home" />
<item
android:id="@+id/navigation_watchlist"
android:icon="@drawable/ic_remove_red_eye_black_24dp"
android:title="@string/title_watchlist" />
<item
android:id="@+id/navigation_market_cap"
android:icon="@drawable/ic_pie_chart_black_24dp"
android:title="@string/title_market_cap" />
<item
android:id="@+id/navigation_settings"
android:icon="@drawable/ic_settings_black_24dp"
android:title="@string/title_activity_settings" />
</group>
</menu>