mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Make the drawer prettier
This commit is contained in:
parent
f8bb106b83
commit
ae78930808
14 changed files with 162 additions and 490 deletions
|
|
@ -35,7 +35,6 @@ import fr.free.nrw.commons.HandlerService;
|
|||
import fr.free.nrw.commons.Media;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.auth.AuthenticatedActivity;
|
||||
import fr.free.nrw.commons.hamburger.HamburgerMenuContainer;
|
||||
import fr.free.nrw.commons.media.MediaDetailPagerFragment;
|
||||
import fr.free.nrw.commons.settings.Prefs;
|
||||
import fr.free.nrw.commons.upload.UploadService;
|
||||
|
|
@ -48,8 +47,7 @@ public class ContributionsActivity
|
|||
AdapterView.OnItemClickListener,
|
||||
MediaDetailPagerFragment.MediaDetailProvider,
|
||||
FragmentManager.OnBackStackChangedListener,
|
||||
ContributionsListFragment.SourceRefresher,
|
||||
HamburgerMenuContainer {
|
||||
ContributionsListFragment.SourceRefresher {
|
||||
|
||||
private Cursor allContributions;
|
||||
private ContributionsListFragment contributionsList;
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
package fr.free.nrw.commons.hamburger;
|
||||
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
|
||||
public interface HamburgerMenuContainer {
|
||||
void setDrawerListener(ActionBarDrawerToggle listener);
|
||||
void toggleDrawer();
|
||||
boolean isDrawerVisible();
|
||||
}
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
package fr.free.nrw.commons.hamburger;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import fr.free.nrw.commons.AboutActivity;
|
||||
import fr.free.nrw.commons.BuildConfig;
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.WelcomeActivity;
|
||||
import fr.free.nrw.commons.auth.LoginActivity;
|
||||
import fr.free.nrw.commons.contributions.ContributionsActivity;
|
||||
import fr.free.nrw.commons.nearby.NearbyActivity;
|
||||
import fr.free.nrw.commons.settings.SettingsActivity;
|
||||
|
||||
|
||||
public class NavigationBaseFragment extends Fragment {
|
||||
@BindView(R.id.pictureOfTheDay)
|
||||
ImageView pictureOfTheDay;
|
||||
|
||||
@BindView(R.id.upload_item)
|
||||
LinearLayout uploadItem;
|
||||
|
||||
@BindView(R.id.nearby_item)
|
||||
LinearLayout nearbyItem;
|
||||
|
||||
@BindView(R.id.about_item)
|
||||
LinearLayout aboutItem;
|
||||
|
||||
@BindView(R.id.settings_item)
|
||||
LinearLayout settingsItem;
|
||||
|
||||
@BindView(R.id.feedback_item)
|
||||
LinearLayout feedbackItem;
|
||||
|
||||
@BindView(R.id.logout_item)
|
||||
LinearLayout logoutItem;
|
||||
|
||||
@BindView(R.id.introduction_item)
|
||||
LinearLayout introductionItem;
|
||||
|
||||
private DrawerLayout drawerLayout;
|
||||
private RelativeLayout drawerPane;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater,
|
||||
ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View hamburgerView = inflater.inflate(R.layout.navigation_drawer_menu, container, false);
|
||||
ButterKnife.bind(this, hamburgerView);
|
||||
showPictureOfTheDay();
|
||||
setupHamburgerMenu();
|
||||
return hamburgerView;
|
||||
}
|
||||
|
||||
private void showPictureOfTheDay() {
|
||||
pictureOfTheDay.setImageDrawable(getResources().getDrawable(R.drawable.commons_logo_large));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
private void setupHamburgerMenu() {
|
||||
ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(getActivity(),
|
||||
drawerLayout, R.string.ok, R.string.cancel);
|
||||
if (getActivity() instanceof HamburgerMenuContainer) {
|
||||
((HamburgerMenuContainer) getActivity()).setDrawerListener(drawerToggle);
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.upload_item)
|
||||
protected void onUploadItemClicked() {
|
||||
closeDrawer();
|
||||
ContributionsActivity.startYourself(getActivity());
|
||||
}
|
||||
|
||||
@OnClick(R.id.settings_item)
|
||||
protected void onSettingsItemClicked() {
|
||||
closeDrawer();
|
||||
SettingsActivity.startYourself(getActivity());
|
||||
}
|
||||
|
||||
@OnClick(R.id.about_item)
|
||||
protected void onAboutItemClicked() {
|
||||
closeDrawer();
|
||||
AboutActivity.startYourself(getActivity());
|
||||
}
|
||||
|
||||
@OnClick(R.id.nearby_item)
|
||||
protected void onNearbyItemClicked() {
|
||||
closeDrawer();
|
||||
NearbyActivity.startYourself(getActivity());
|
||||
}
|
||||
|
||||
@OnClick(R.id.introduction_item)
|
||||
protected void onInfoItemClicked() {
|
||||
closeDrawer();
|
||||
WelcomeActivity.startYourself(getActivity());
|
||||
}
|
||||
|
||||
@OnClick(R.id.feedback_item)
|
||||
protected void onFeedbackItemClicked() {
|
||||
closeDrawer();
|
||||
Intent feedbackIntent = new Intent(Intent.ACTION_SEND);
|
||||
feedbackIntent.setType("message/rfc822");
|
||||
feedbackIntent.putExtra(Intent.EXTRA_EMAIL,
|
||||
new String[]{CommonsApplication.FEEDBACK_EMAIL});
|
||||
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT,
|
||||
String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT,
|
||||
BuildConfig.VERSION_NAME));
|
||||
try {
|
||||
startActivity(feedbackIntent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.logout_item)
|
||||
protected void onLogoutItemClicked() {
|
||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());
|
||||
alertDialogBuilder.setMessage(R.string.logout_verification)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.yes,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
((CommonsApplication)getActivity().getApplicationContext())
|
||||
.clearApplicationData(getContext());
|
||||
Intent nearbyIntent = new Intent
|
||||
(getActivity(), LoginActivity.class);
|
||||
nearbyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
nearbyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(nearbyIntent);
|
||||
getActivity().finish();
|
||||
}
|
||||
});
|
||||
alertDialogBuilder.setNegativeButton(R.string.no,
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = alertDialogBuilder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
private void closeDrawer() {
|
||||
if (drawerLayout != null) {
|
||||
drawerLayout.closeDrawer(drawerPane);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDrawerLayout(DrawerLayout drawerLayout, RelativeLayout drawerPane) {
|
||||
this.drawerLayout = drawerLayout;
|
||||
this.drawerPane = drawerPane;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +1,52 @@
|
|||
package fr.free.nrw.commons.theme;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Toast;
|
||||
|
||||
import butterknife.BindView;
|
||||
import fr.free.nrw.commons.AboutActivity;
|
||||
import fr.free.nrw.commons.BuildConfig;
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.hamburger.HamburgerMenuContainer;
|
||||
import fr.free.nrw.commons.hamburger.NavigationBaseFragment;
|
||||
import fr.free.nrw.commons.utils.FragmentUtils;
|
||||
import fr.free.nrw.commons.WelcomeActivity;
|
||||
import fr.free.nrw.commons.auth.LoginActivity;
|
||||
import fr.free.nrw.commons.contributions.ContributionsActivity;
|
||||
import fr.free.nrw.commons.nearby.NearbyActivity;
|
||||
import fr.free.nrw.commons.settings.SettingsActivity;
|
||||
|
||||
import static android.support.v4.view.GravityCompat.START;
|
||||
public class NavigationBaseActivity extends BaseActivity
|
||||
implements NavigationView.OnNavigationItemSelectedListener {
|
||||
|
||||
public class NavigationBaseActivity extends BaseActivity implements HamburgerMenuContainer {
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
@BindView(R.id.navigation_view)
|
||||
NavigationView navigationView;
|
||||
|
||||
@BindView(R.id.drawer_layout)
|
||||
DrawerLayout drawerLayout;
|
||||
|
||||
@BindView(R.id.drawer_pane)
|
||||
RelativeLayout drawerPane;
|
||||
|
||||
private ActionBarDrawerToggle toggle;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
public void initDrawer() {
|
||||
initSubviews();
|
||||
NavigationBaseFragment baseFragment = new NavigationBaseFragment();
|
||||
baseFragment.setDrawerLayout(drawerLayout, drawerPane);
|
||||
FragmentUtils.addAndCommitFragmentWithImmediateExecution(getSupportFragmentManager(),
|
||||
R.id.drawer_fragment,
|
||||
baseFragment);
|
||||
}
|
||||
navigationView.setNavigationItemSelectedListener(this);
|
||||
|
||||
public void initSubviews() {
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
toggle = new ActionBarDrawerToggle(this,
|
||||
drawerLayout,
|
||||
toolbar,
|
||||
R.string.navigation_drawer_open,
|
||||
R.string.navigation_drawer_close);
|
||||
drawerLayout.setDrawerListener(toggle);
|
||||
toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar,
|
||||
R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||
drawerLayout.addDrawerListener(toggle);
|
||||
toggle.setDrawerIndicatorEnabled(true);
|
||||
toggle.syncState();
|
||||
setDrawerPaneWidth();
|
||||
|
|
@ -74,28 +70,77 @@ public class NavigationBaseActivity extends BaseActivity implements HamburgerMen
|
|||
}
|
||||
|
||||
private void setDrawerPaneWidth() {
|
||||
ViewGroup.LayoutParams params = drawerPane.getLayoutParams();
|
||||
ViewGroup.LayoutParams params = navigationView.getLayoutParams();
|
||||
// set width to lowerBound of 80% of the screen size
|
||||
params.width = (getResources().getDisplayMetrics().widthPixels * 70) / 100;
|
||||
drawerPane.setLayoutParams(params);
|
||||
navigationView.setLayoutParams(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDrawerListener(ActionBarDrawerToggle listener) {
|
||||
drawerLayout.setDrawerListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleDrawer() {
|
||||
if (drawerLayout.isDrawerVisible(START)) {
|
||||
drawerLayout.closeDrawer(START);
|
||||
} else {
|
||||
drawerLayout.openDrawer(START);
|
||||
public boolean onNavigationItemSelected(@NonNull final MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_home:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
ContributionsActivity.startYourself(this);
|
||||
return true;
|
||||
case R.id.action_nearby:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
NearbyActivity.startYourself(this);
|
||||
return true;
|
||||
case R.id.action_about:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
AboutActivity.startYourself(this);
|
||||
return true;
|
||||
case R.id.action_settings:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
SettingsActivity.startYourself(this);
|
||||
return true;
|
||||
case R.id.action_introduction:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
WelcomeActivity.startYourself(this);
|
||||
return true;
|
||||
case R.id.action_feedback:
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
Intent feedbackIntent = new Intent(Intent.ACTION_SEND);
|
||||
feedbackIntent.setType("message/rfc822");
|
||||
feedbackIntent.putExtra(Intent.EXTRA_EMAIL,
|
||||
new String[]{CommonsApplication.FEEDBACK_EMAIL});
|
||||
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT,
|
||||
String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT,
|
||||
BuildConfig.VERSION_NAME));
|
||||
try {
|
||||
startActivity(feedbackIntent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Toast.makeText(this, R.string.no_email_client, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
return true;
|
||||
case R.id.action_logout:
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage(R.string.logout_verification)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
((CommonsApplication) getApplicationContext())
|
||||
.clearApplicationData(NavigationBaseActivity.this);
|
||||
Intent nearbyIntent = new Intent(
|
||||
NavigationBaseActivity.this, LoginActivity.class);
|
||||
nearbyIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
nearbyIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(nearbyIntent);
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.cancel();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDrawerVisible() {
|
||||
return drawerLayout.isDrawerVisible(START);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/hamburger_item_pressed_color" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:state_enabled="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
</selector>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -89,17 +90,12 @@
|
|||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/drawer_pane"
|
||||
android:layout_width="320dp"
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/drawer_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -32,17 +33,12 @@
|
|||
</FrameLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/drawer_pane"
|
||||
android:layout_width="320dp"
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/drawer_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -35,17 +36,12 @@
|
|||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/drawer_pane"
|
||||
android:layout_width="320dp"
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/drawer_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -24,17 +25,12 @@
|
|||
android:layout_below="@id/toolbar"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/drawer_pane"
|
||||
android:layout_width="320dp"
|
||||
<android.support.design.widget.NavigationView
|
||||
android:id="@+id/navigation_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start"
|
||||
android:background="@android:color/white">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/drawer_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</RelativeLayout>
|
||||
app:headerLayout="@layout/drawer_header"
|
||||
app:menu="@menu/drawer"/>
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
8
app/src/main/res/layout/drawer_header.xml
Normal file
8
app/src/main/res/layout/drawer_header.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/pictureOfTheDay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="172dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/commons_logo_large"/>
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/darker_gray">
|
||||
<ImageView
|
||||
android:id="@+id/pictureOfTheDay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_height="140dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@android:color/black"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/upload_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_home_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_home"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/nearby_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_location_on_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_nearby"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/about_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_info_outline_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_about"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_settings_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_settings"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/introduction_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_info_outline_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_info"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/feedback_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_feedback_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_feedback"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/logout_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:background="@drawable/hamburger_item_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:src="@drawable/ic_exit_to_app_black_24dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:text="@string/navigation_item_logout"
|
||||
android:letterSpacing="0.02"
|
||||
android:textColor="@color/main_background_dark"
|
||||
android:textSize="@dimen/hamburger_menu_item" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
38
app/src/main/res/menu/drawer.xml
Normal file
38
app/src/main/res/menu/drawer.xml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_home"
|
||||
android:icon="@drawable/ic_home_black_24dp"
|
||||
android:title="@string/navigation_item_home"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_nearby"
|
||||
android:icon="@drawable/ic_location_on_black_24dp"
|
||||
android:title="@string/navigation_item_nearby"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_about"
|
||||
android:icon="@drawable/ic_info_outline_black_24dp"
|
||||
android:title="@string/navigation_item_about"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:icon="@drawable/ic_settings_black_24dp"
|
||||
android:title="@string/navigation_item_settings"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_introduction"
|
||||
android:icon="@drawable/ic_info_outline_black_24dp"
|
||||
android:title="@string/navigation_item_info"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_feedback"
|
||||
android:icon="@drawable/ic_feedback_black_24dp"
|
||||
android:title="@string/navigation_item_feedback"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_logout"
|
||||
android:icon="@drawable/ic_exit_to_app_black_24dp"
|
||||
android:title="@string/navigation_item_logout"/>
|
||||
|
||||
</menu>
|
||||
|
|
@ -21,6 +21,4 @@
|
|||
<color name="button_background_light">#B0000000</color>
|
||||
<color name="upload_overlay_background_dark">#77000000</color>
|
||||
<color name="upload_overlay_background_light">#44000000</color>
|
||||
|
||||
<color name="hamburger_item_pressed_color">#f5f5f5</color>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,5 @@
|
|||
<dimen name="tiny_margin">4dp</dimen>
|
||||
<dimen name="small_margin">8dp</dimen>
|
||||
<dimen name="bottom_peak_height">240dp</dimen>
|
||||
<dimen name="hamburger_menu_item">18sp</dimen>
|
||||
<dimen name="overflow_button_dimen">48dp</dimen>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue