Merge branch 'master' into featuredImages

This commit is contained in:
Vivek Maskara 2018-03-24 12:46:38 +05:30 committed by GitHub
commit 463673f942
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
343 changed files with 11434 additions and 3062 deletions

View file

@ -4,10 +4,10 @@ import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import dagger.android.support.DaggerAppCompatActivity;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.di.CommonsDaggerAppCompatActivity;
public abstract class BaseActivity extends DaggerAppCompatActivity {
public abstract class BaseActivity extends CommonsDaggerAppCompatActivity {
boolean currentTheme;
@Override

View file

@ -5,6 +5,7 @@ import android.accounts.AccountManager;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout;
@ -22,6 +23,7 @@ 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.Utils;
import fr.free.nrw.commons.WelcomeActivity;
import fr.free.nrw.commons.auth.AccountUtil;
import fr.free.nrw.commons.auth.LoginActivity;
@ -87,8 +89,11 @@ public abstract class NavigationBaseActivity extends BaseActivity
private void setDrawerPaneWidth() {
ViewGroup.LayoutParams params = navigationView.getLayoutParams();
// set width to lowerBound of 80% of the screen size
params.width = (getResources().getDisplayMetrics().widthPixels * 70) / 100;
// set width to lowerBound of 70% of the screen size in portrait mode
// set width to lowerBound of 50% of the screen size in landscape mode
int percentageWidth = getResources().getInteger(R.integer.drawer_width);
params.width = (getResources().getDisplayMetrics().widthPixels * percentageWidth) / 100;
navigationView.setLayoutParams(params);
}
@ -120,8 +125,9 @@ public abstract class NavigationBaseActivity extends BaseActivity
return true;
case R.id.action_feedback:
drawerLayout.closeDrawer(navigationView);
Intent feedbackIntent = new Intent(Intent.ACTION_SEND);
Intent feedbackIntent = new Intent(Intent.ACTION_SENDTO);
feedbackIntent.setType("message/rfc822");
feedbackIntent.setData(Uri.parse("mailto:"));
feedbackIntent.putExtra(Intent.EXTRA_EMAIL,
new String[]{CommonsApplication.FEEDBACK_EMAIL});
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT,
@ -147,7 +153,7 @@ public abstract class NavigationBaseActivity extends BaseActivity
return true;
case R.id.action_notifications:
drawerLayout.closeDrawer(navigationView);
startActivityWithFlags(this, NotificationActivity.class, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
NotificationActivity.startYourself(this);
return true;
case R.id.action_featured_images:
drawerLayout.closeDrawer(navigationView);