summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-02-22 17:00:40 +0100
committerFup Duck <fupduck@sacknagel.com>2018-02-22 17:00:40 +0100
commit6a683c605aa5bb5ce72f8ea46a4b6bcae0f9e98a (patch)
tree559e558c652643a4393712877b98287e432ba28c
parentaf3ac0476f2b6320cd3e3ff8e17453d50bbace08 (diff)
8868 - fix lollipop ui issues
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/ConfigWizardBaseActivity.java20
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/EipFragment.java5
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/StartActivity.java4
-rw-r--r--app/src/main/res/layout-xlarge/eip_service_fragment.xml9
-rw-r--r--app/src/main/res/layout/eip_service_fragment.xml9
5 files changed, 35 insertions, 12 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/ConfigWizardBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/ConfigWizardBaseActivity.java
index ea328216..f0e2de85 100644
--- a/app/src/main/java/se/leap/bitmaskclient/ConfigWizardBaseActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/ConfigWizardBaseActivity.java
@@ -1,16 +1,19 @@
package se.leap.bitmaskclient;
import android.content.SharedPreferences;
+import android.graphics.PorterDuff;
+import android.os.Build;
import android.os.Bundle;
-import android.os.PersistableBundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
+import android.support.v4.content.ContextCompat;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
+import android.widget.ProgressBar;
import butterknife.InjectView;
@@ -38,6 +41,9 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity {
@InjectView(R.id.loading_screen)
protected LinearLayout loadingScreen;
+ @InjectView(R.id.progressbar)
+ protected ProgressBar progressBar;
+
@InjectView(R.id.progressbar_description)
protected AppCompatTextView progressbarText;
@@ -59,6 +65,7 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity {
super.setContentView(view);
if (provider != null)
setProviderHeaderText(provider.getName());
+ setProgressbarColorForPreLollipop();
}
@Override
@@ -66,6 +73,7 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity {
super.setContentView(layoutResID);
if (provider != null)
setProviderHeaderText(provider.getName());
+ setProgressbarColorForPreLollipop();
}
@Override
@@ -73,8 +81,18 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity {
super.setContentView(view, params);
if (provider != null)
setProviderHeaderText(provider.getName());
+ setProgressbarColorForPreLollipop();
}
+ private void setProgressbarColorForPreLollipop() {
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
+ progressBar.getIndeterminateDrawable().setColorFilter(
+ ContextCompat.getColor(this, R.color.colorPrimary),
+ PorterDuff.Mode.SRC_IN);
+ }
+ }
+
+
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java
index 8d1fa03a..08622453 100644
--- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java
@@ -31,6 +31,7 @@ import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.AppCompatImageView;
+import android.support.v7.widget.AppCompatTextView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -84,10 +85,10 @@ public class EipFragment extends Fragment implements Observer {
Button mainButton;
@InjectView(R.id.routed_text)
- TextView routedText;
+ AppCompatTextView routedText;
@InjectView(R.id.vpn_route)
- TextView vpnRoute;
+ AppCompatTextView vpnRoute;
private EipStatus eipStatus;
diff --git a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
index b7180f5f..6bbdeb4f 100644
--- a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
@@ -13,12 +13,10 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import de.blinkt.openvpn.core.VpnStatus;
-import se.leap.bitmaskclient.eip.EIP;
import se.leap.bitmaskclient.eip.EipCommand;
import se.leap.bitmaskclient.userstatus.User;
import static se.leap.bitmaskclient.Constants.APP_ACTION_CONFIGURE_ALWAYS_ON_PROFILE;
-import static se.leap.bitmaskclient.Constants.EIP_ACTION_START;
import static se.leap.bitmaskclient.Constants.EIP_RESTART_ON_BOOT;
import static se.leap.bitmaskclient.Constants.PREFERENCES_APP_VERSION;
import static se.leap.bitmaskclient.Constants.PROVIDER_EIP_DEFINITION;
@@ -32,7 +30,7 @@ import static se.leap.bitmaskclient.MainActivity.ACTION_SHOW_VPN_FRAGMENT;
* and acts and calls another activity accordingly.
*
*/
-public class StartActivity extends Activity {
+public class StartActivity extends Activity{
public static final String TAG = StartActivity.class.getSimpleName();
@Retention(RetentionPolicy.SOURCE)
diff --git a/app/src/main/res/layout-xlarge/eip_service_fragment.xml b/app/src/main/res/layout-xlarge/eip_service_fragment.xml
index b7af5797..c09bda2d 100644
--- a/app/src/main/res/layout-xlarge/eip_service_fragment.xml
+++ b/app/src/main/res/layout-xlarge/eip_service_fragment.xml
@@ -54,7 +54,7 @@
app:srcCompat="@drawable/ic_colorsquare" />
- <TextView
+ <android.support.v7.widget.AppCompatTextView
android:id="@+id/eipLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -65,6 +65,7 @@
android:layout_marginRight="@dimen/stdpadding"
android:text="@string/eip_service_label"
android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -97,7 +98,7 @@
style="@style/BitmaskButtonBlack"
/>
- <TextView
+ <android.support.v7.widget.AppCompatTextView
android:id="@+id/routed_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -107,12 +108,13 @@
android:layout_marginLeft="@dimen/stdpadding"
android:layout_marginRight="@dimen/stdpadding"
android:text="@string/vpn_securely_routed"
+ android:gravity="center"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/eipLabel" />
- <TextView
+ <android.support.v7.widget.AppCompatTextView
android:id="@+id/vpn_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -120,6 +122,7 @@
android:layout_marginStart="@dimen/stdpadding"
android:layout_marginLeft="@dimen/stdpadding"
android:layout_marginRight="@dimen/stdpadding"
+ android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/routed_text" />
diff --git a/app/src/main/res/layout/eip_service_fragment.xml b/app/src/main/res/layout/eip_service_fragment.xml
index 814ec310..30b94de9 100644
--- a/app/src/main/res/layout/eip_service_fragment.xml
+++ b/app/src/main/res/layout/eip_service_fragment.xml
@@ -52,7 +52,7 @@
app:srcCompat="@drawable/ic_colorsquare" />
- <TextView
+ <android.support.v7.widget.AppCompatTextView
android:id="@+id/eipLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -63,6 +63,7 @@
android:layout_marginRight="@dimen/stdpadding"
android:text="@string/eip_service_label"
android:textAppearance="?android:attr/textAppearanceMedium"
+ android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -97,7 +98,7 @@
style="@style/BitmaskButtonBlack"
/>
- <TextView
+ <android.support.v7.widget.AppCompatTextView
android:id="@+id/routed_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -107,12 +108,13 @@
android:layout_marginLeft="@dimen/stdpadding"
android:layout_marginRight="@dimen/stdpadding"
android:text="@string/vpn_securely_routed"
+ android:gravity="center"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/eipLabel" />
- <TextView
+ <android.support.v7.widget.AppCompatTextView
android:id="@+id/vpn_route"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -120,6 +122,7 @@
android:layout_marginStart="@dimen/stdpadding"
android:layout_marginLeft="@dimen/stdpadding"
android:layout_marginRight="@dimen/stdpadding"
+ android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/routed_text" />