mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
Merge branch 'master' into featuredImages
This commit is contained in:
commit
463673f942
343 changed files with 11434 additions and 3062 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue