From bcf0a5482643f6d00b15db364d7c5544e25f7414 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 8 Apr 2018 14:09:01 +0200 Subject: make camera feature optional --- .../java/de/pixart/messenger/ui/XmppActivity.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/XmppActivity.java') diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java index 8bfe7d2fa..5e2e4856b 100644 --- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java +++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java @@ -94,14 +94,13 @@ public abstract class XmppActivity extends AppCompatActivity { public boolean xmppConnectionServiceBound = false; protected boolean registeredListeners = false; - protected int mPrimaryBackgroundColor; - protected int mSecondaryBackgroundColor; protected int mColorRed; protected int mColorWarningButton; protected int mColorWhite; protected int mColorOrange; protected int mColorGreen; - protected int mPrimaryColor; + + private boolean isCameraFeatureAvailable = false; protected boolean mUseSubject = true; @@ -410,14 +409,12 @@ public abstract class XmppActivity extends AppCompatActivity { super.onCreate(savedInstanceState); metrics = getResources().getDisplayMetrics(); ExceptionHelper.init(getApplicationContext()); + this.isCameraFeatureAvailable = getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA); mColorRed = ContextCompat.getColor(this, R.color.red800); mColorWarningButton = ContextCompat.getColor(this, R.color.warning_button); mColorWhite = ContextCompat.getColor(this, R.color.white70); mColorOrange = ContextCompat.getColor(this, R.color.orange500); mColorGreen = ContextCompat.getColor(this, R.color.realgreen); - mPrimaryColor = ContextCompat.getColor(this, R.color.primary); - mPrimaryBackgroundColor = ContextCompat.getColor(this, R.color.grey50); - mSecondaryBackgroundColor = ContextCompat.getColor(this, R.color.grey200); this.mTheme = findTheme(); setTheme(this.mTheme); this.mUsingEnterKey = usingEnterKey(); @@ -428,10 +425,13 @@ public abstract class XmppActivity extends AppCompatActivity { } } - // todo theme -// public boolean isDarkTheme() { -// return this.mTheme == R.style.ConversationsTheme_Dark; -// } + protected boolean isCameraFeatureAvailable() { + return this.isCameraFeatureAvailable; + } + + public boolean isDarkTheme() { + return this.mTheme == R.style.ConversationsTheme_Dark; + } public int getThemeResource(int r_attr_name, int r_drawable_def) { int[] attrs = { r_attr_name }; -- cgit v1.2.3