From 31a7b66d7c6c04a7ee7cccbe5d6ed059cd3a054e Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 14:09:15 +0100 Subject: show grey footer in navigation drawer, if there's enough place --- app/src/main/res/layout/f_drawer_main.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') diff --git a/app/src/main/res/layout/f_drawer_main.xml b/app/src/main/res/layout/f_drawer_main.xml index bd7e66ae..bf418bc0 100644 --- a/app/src/main/res/layout/f_drawer_main.xml +++ b/app/src/main/res/layout/f_drawer_main.xml @@ -116,6 +116,12 @@ app:text="@string/about_fragment_title" app:icon="@drawable/ic_about_36" /> + -- cgit v1.2.3 From 5e457e95683241501846d0d0403533a293307a88 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 14:16:05 +0100 Subject: ensure advanced settings subtitle is shown after orientation change or after moving back from sub fragment --- .../base/fragments/NavigationDrawerFragment.java | 1 - .../leap/bitmaskclient/base/fragments/SettingsFragment.java | 13 +++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java index e9881094..cc3ecca6 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java @@ -275,7 +275,6 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen advancedSettings.setOnClickListener(v -> { closeDrawer(); Fragment fragment = new SettingsFragment(); - setActionBarTitle(advanced_settings); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); }); } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java index 7157d1cc..ae2a1052 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java @@ -10,6 +10,9 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.annotation.StringRes; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -30,6 +33,7 @@ import se.leap.bitmaskclient.firewall.FirewallManager; import static android.content.Context.MODE_PRIVATE; import static android.view.View.GONE; import static android.view.View.VISIBLE; +import static se.leap.bitmaskclient.R.string.advanced_settings; import static se.leap.bitmaskclient.base.MainActivity.ACTION_SHOW_VPN_FRAGMENT; import static se.leap.bitmaskclient.base.models.Constants.SHARED_PREFERENCES; import static se.leap.bitmaskclient.base.models.Constants.USE_BRIDGES; @@ -70,6 +74,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh initUseSnowflakeEntry(view); initFirewallEntry(view); initTetheringEntry(view); + setActionBarTitle(advanced_settings); return view; } @@ -242,4 +247,12 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh initFirewallEntry(getView()); } } + + private void setActionBarTitle(@StringRes int stringId) { + ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); + if (actionBar != null) { + actionBar.setSubtitle(stringId); + } + } + } -- cgit v1.2.3 From 63b83310a1d24003286b3610f3ae138d12784c00 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 14:32:29 +0100 Subject: fix location selection buttons on tablets --- app/src/main/res/layout-xlarge-port/f_eip.xml | 3 +-- app/src/main/res/layout-xlarge/f_eip.xml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/src/main/res/layout-xlarge-port/f_eip.xml b/app/src/main/res/layout-xlarge-port/f_eip.xml index 839753e6..214c0c9a 100644 --- a/app/src/main/res/layout-xlarge-port/f_eip.xml +++ b/app/src/main/res/layout-xlarge-port/f_eip.xml @@ -105,7 +105,7 @@ - diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml index 34d74805..c6850844 100644 --- a/app/src/main/res/layout-xlarge/f_eip.xml +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -109,7 +109,7 @@ Date: Thu, 25 Nov 2021 14:33:57 +0100 Subject: tweak connection state font size on EipFragment --- app/src/main/res/layout-port/f_eip.xml | 3 ++- app/src/main/res/layout-xlarge-port/f_eip.xml | 7 ++++--- app/src/main/res/layout-xlarge/f_eip.xml | 3 ++- app/src/main/res/layout/f_eip.xml | 3 ++- 4 files changed, 10 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml index a261c8ea..d99d9da9 100644 --- a/app/src/main/res/layout-port/f_eip.xml +++ b/app/src/main/res/layout-port/f_eip.xml @@ -64,10 +64,11 @@ app:layout_constraintBottom_toTopOf="@+id/sub_description" android:padding="@dimen/activity_margin" android:textAppearance="@android:style/TextAppearance.Large" + android:textSize="30sp" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" - tools:text="CONNETION" + tools:text="Connection secure" android:gravity="center" android:maxLines="1" /> diff --git a/app/src/main/res/layout-xlarge-port/f_eip.xml b/app/src/main/res/layout-xlarge-port/f_eip.xml index 214c0c9a..c3d3fd36 100644 --- a/app/src/main/res/layout-xlarge-port/f_eip.xml +++ b/app/src/main/res/layout-xlarge-port/f_eip.xml @@ -63,7 +63,7 @@ app:layout_constraintEnd_toStartOf="@+id/guideline_vertical_right" app:layout_constraintStart_toStartOf="@+id/guideline_vertical_left" app:layout_constraintTop_toTopOf="@+id/guideline_horizontal_top" - app:layout_constraintVertical_bias="0.4" /> + app:layout_constraintVertical_bias="0.425" /> @@ -92,7 +93,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toTopOf="@+id/gateway_location_button" android:padding="@dimen/activity_margin" - android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" + android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" diff --git a/app/src/main/res/layout-xlarge/f_eip.xml b/app/src/main/res/layout-xlarge/f_eip.xml index c6850844..4042933e 100644 --- a/app/src/main/res/layout-xlarge/f_eip.xml +++ b/app/src/main/res/layout-xlarge/f_eip.xml @@ -79,6 +79,7 @@ app:layout_constraintBottom_toTopOf="@+id/sub_description" android:padding="@dimen/stdpadding" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" + android:textSize="45sp" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" @@ -95,7 +96,7 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toTopOf="@+id/gateway_location_button" android:padding="@dimen/stdpadding" - android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium" + android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index b5af785d..c6c48d69 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -96,10 +96,11 @@ android:paddingRight="@dimen/stdpadding" android:paddingEnd="@dimen/stdpadding" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" + android:textSize="30sp" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" - tools:text="CONNETION SECURE" + tools:text="Connection secure" /> Date: Thu, 25 Nov 2021 14:34:29 +0100 Subject: remove top padding for first header in settings fragment --- app/src/main/res/layout/f_settings.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/src/main/res/layout/f_settings.xml b/app/src/main/res/layout/f_settings.xml index a4d86fa6..ada74e12 100644 --- a/app/src/main/res/layout/f_settings.xml +++ b/app/src/main/res/layout/f_settings.xml @@ -17,7 +17,6 @@ android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.AppCompat.Title" android:text="@string/vpn_settings" - android:paddingTop="@dimen/activity_margin" /> Date: Thu, 25 Nov 2021 14:41:39 +0100 Subject: use darker yellow for location status indicator --- .../java/se/leap/bitmaskclient/base/views/LocationIndicator.java | 8 ++++---- app/src/main/res/layout/v_location_status_indicator.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/views/LocationIndicator.java b/app/src/main/java/se/leap/bitmaskclient/base/views/LocationIndicator.java index 8245893d..72ad03f9 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/views/LocationIndicator.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/views/LocationIndicator.java @@ -63,10 +63,10 @@ public class LocationIndicator extends LinearLayout { level3_2.setBackgroundColor(getColor(getContext(), R.color.green200)); break; case AVERAGE: - level1.setBackgroundColor(getColor(getContext(), R.color.yellow200)); - level1_2.setBackgroundColor(getColor(getContext(), R.color.yellow200)); - level2.setBackgroundColor(getColor(getContext(), R.color.yellow200)); - level2_2.setBackgroundColor(getColor(getContext(), R.color.yellow200)); + level1.setBackgroundColor(getColor(getContext(), R.color.amber200)); + level1_2.setBackgroundColor(getColor(getContext(), R.color.amber200)); + level2.setBackgroundColor(getColor(getContext(), R.color.amber200)); + level2_2.setBackgroundColor(getColor(getContext(), R.color.amber200)); level3.setBackgroundColor(getColor(getContext(), R.color.black800_high_transparent)); level3_2.setBackgroundColor(getColor(getContext(), R.color.black800_high_transparent)); break; diff --git a/app/src/main/res/layout/v_location_status_indicator.xml b/app/src/main/res/layout/v_location_status_indicator.xml index 548a965f..a8ba905e 100644 --- a/app/src/main/res/layout/v_location_status_indicator.xml +++ b/app/src/main/res/layout/v_location_status_indicator.xml @@ -130,7 +130,7 @@ android:id="@+id/level2" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/yellow200" + android:background="@color/amber200" android:visibility="visible" app:layout_constraintRight_toLeftOf="@+id/guideline_vertical_third" app:layout_constraintLeft_toRightOf="@id/guideline_vertical_second" @@ -146,7 +146,7 @@ android:id="@+id/level2_2" android:layout_width="0dp" android:layout_height="0dp" - android:background="@color/yellow200" + android:background="@color/amber200" android:visibility="visible" app:layout_constraintRight_toLeftOf="@+id/guideline_vertical_fourth" app:layout_constraintLeft_toRightOf="@id/guideline_vertical_third" -- cgit v1.2.3 From 57ce0635f310d1a4cd4e81b01455d8a70978003b Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 15:10:19 +0100 Subject: ensure that action bar subtitle remains after orientation changes for all fragments --- .../bitmaskclient/base/fragments/AboutFragment.java | 3 +++ .../base/fragments/ExcludeAppsFragment.java | 13 ++----------- .../base/fragments/GatewaySelectionFragment.java | 2 ++ .../bitmaskclient/base/fragments/LogFragment.java | 4 ++++ .../base/fragments/NavigationDrawerFragment.java | 14 -------------- .../base/fragments/SettingsFragment.java | 13 ++----------- .../se/leap/bitmaskclient/base/utils/ViewHelper.java | 19 +++++++++++++++++++ 7 files changed, 32 insertions(+), 36 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java index dbdd008a..646637b9 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/AboutFragment.java @@ -17,6 +17,8 @@ import se.leap.bitmaskclient.BuildConfig; import se.leap.bitmaskclient.R; import static android.view.View.VISIBLE; +import static se.leap.bitmaskclient.R.string.about_fragment_title; +import static se.leap.bitmaskclient.base.utils.ViewHelper.setActionBarTitle; public class AboutFragment extends Fragment { @@ -34,6 +36,7 @@ public class AboutFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.f_about, container, false); unbinder = ButterKnife.bind(this, view); + setActionBarTitle(this, about_fragment_title); return view; } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java index f5d7f286..1574dbb0 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/ExcludeAppsFragment.java @@ -26,9 +26,6 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.SearchView; -import androidx.annotation.StringRes; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatTextView; import androidx.fragment.app.Fragment; @@ -41,6 +38,7 @@ import java.util.Vector; import de.blinkt.openvpn.VpnProfile; import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.utils.PreferenceHelper; +import se.leap.bitmaskclient.base.utils.ViewHelper; import se.leap.bitmaskclient.base.views.SimpleCheckBox; import static se.leap.bitmaskclient.R.string.exclude_apps_fragment_title; @@ -314,18 +312,11 @@ public class ExcludeAppsFragment extends Fragment implements AdapterView.OnItemC mListView.setOnItemClickListener(this); mListView.setEmptyView(v.findViewById(R.id.loading_container)); - setActionBarTitle(exclude_apps_fragment_title); + ViewHelper.setActionBarTitle(this, exclude_apps_fragment_title); new Thread(() -> mListAdapter.populateList(getActivity())).start(); return v; } - private void setActionBarTitle(@StringRes int stringId) { - ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); - if (actionBar != null) { - actionBar.setSubtitle(stringId); - } - } - } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java index e3845164..72cca644 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/GatewaySelectionFragment.java @@ -58,6 +58,7 @@ import static se.leap.bitmaskclient.base.MainActivity.ACTION_SHOW_VPN_FRAGMENT; import static se.leap.bitmaskclient.base.models.Constants.LOCATION; import static se.leap.bitmaskclient.base.models.Constants.SHARED_PREFERENCES; import static se.leap.bitmaskclient.base.models.Constants.USE_BRIDGES; +import static se.leap.bitmaskclient.base.utils.ViewHelper.setActionBarTitle; interface LocationListSelectionListener { void onLocationManuallySelected(Location location); @@ -103,6 +104,7 @@ public class GatewaySelectionFragment extends Fragment implements Observer, Loca super.onViewCreated(view, savedInstanceState); initRecyclerView(); initRecommendedLocationEntry(); + setActionBarTitle(this, R.string.gateway_selection_title); } @Override diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java index a5a5e555..6f0f29ef 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/LogFragment.java @@ -60,6 +60,8 @@ import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.models.Constants; import static de.blinkt.openvpn.core.OpenVPNService.humanReadableByteCount; +import static se.leap.bitmaskclient.R.string.log_fragment_title; +import static se.leap.bitmaskclient.base.utils.ViewHelper.setActionBarTitle; public class LogFragment extends ListFragment implements StateListener, SeekBar.OnSeekBarChangeListener, RadioGroup.OnCheckedChangeListener, VpnStatus.ByteCountListener { public static final String TAG = LogFragment.class.getSimpleName(); @@ -530,6 +532,8 @@ public class LogFragment extends ListFragment implements StateListener, SeekBar. mConnectStatus = v.findViewById(R.id.speedStatus); if (mShowOptionsLayout) mOptionsLayout.setVisibility(View.VISIBLE); + + setActionBarTitle(this, log_fragment_title); return v; } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java index cc3ecca6..9f210bd5 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java @@ -54,16 +54,12 @@ import se.leap.bitmaskclient.base.models.ProviderObservable; import se.leap.bitmaskclient.base.views.IconSwitchEntry; import se.leap.bitmaskclient.base.views.IconTextEntry; import se.leap.bitmaskclient.eip.EipStatus; -import se.leap.bitmaskclient.firewall.FirewallManager; import se.leap.bitmaskclient.providersetup.ProviderListActivity; import se.leap.bitmaskclient.tethering.TetheringObservable; import static android.content.Context.MODE_PRIVATE; import static android.view.View.GONE; import static android.view.View.VISIBLE; -import static se.leap.bitmaskclient.R.string.about_fragment_title; -import static se.leap.bitmaskclient.R.string.advanced_settings; -import static se.leap.bitmaskclient.R.string.log_fragment_title; import static se.leap.bitmaskclient.base.BitmaskApp.getRefWatcher; import static se.leap.bitmaskclient.base.models.Constants.DONATION_URL; import static se.leap.bitmaskclient.base.models.Constants.ENABLE_DONATION; @@ -320,7 +316,6 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen FragmentManagerEnhanced fragmentManager = new FragmentManagerEnhanced(getActivity().getSupportFragmentManager()); closeDrawer(); Fragment fragment = new GatewaySelectionFragment(); - setActionBarTitle(R.string.gateway_selection_title); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); }); } @@ -344,7 +339,6 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen log.setOnClickListener((buttonView) -> { closeDrawer(); Fragment fragment = new LogFragment(); - setActionBarTitle(log_fragment_title); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); }); } @@ -355,7 +349,6 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen about.setOnClickListener((buttonView) -> { closeDrawer(); Fragment fragment = new AboutFragment(); - setActionBarTitle(about_fragment_title); fragmentManager.replace(R.id.main_container, fragment, MainActivity.TAG); }); } @@ -481,13 +474,6 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen return ((AppCompatActivity) getActivity()).getSupportActionBar(); } - private void setActionBarTitle(@StringRes int resId) { - ActionBar actionBar = getActionBar(); - if (actionBar != null) { - actionBar.setSubtitle(resId); - } - } - private void hideActionBarSubTitle() { ActionBar actionBar = getActionBar(); if (actionBar != null) { diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java index ae2a1052..a38314d1 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java @@ -10,9 +10,6 @@ import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.StringRes; -import androidx.appcompat.app.ActionBar; -import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; @@ -46,6 +43,7 @@ import static se.leap.bitmaskclient.base.utils.PreferenceHelper.hasSnowflakePref import static se.leap.bitmaskclient.base.utils.PreferenceHelper.preferUDP; import static se.leap.bitmaskclient.base.utils.PreferenceHelper.useBridges; import static se.leap.bitmaskclient.base.utils.PreferenceHelper.useSnowflake; +import static se.leap.bitmaskclient.base.utils.ViewHelper.setActionBarTitle; public class SettingsFragment extends Fragment implements SharedPreferences.OnSharedPreferenceChangeListener { @@ -74,7 +72,7 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh initUseSnowflakeEntry(view); initFirewallEntry(view); initTetheringEntry(view); - setActionBarTitle(advanced_settings); + setActionBarTitle(this, advanced_settings); return view; } @@ -248,11 +246,4 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh } } - private void setActionBarTitle(@StringRes int stringId) { - ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); - if (actionBar != null) { - actionBar.setSubtitle(stringId); - } - } - } diff --git a/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java b/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java index 23ca40e5..7410172f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/utils/ViewHelper.java @@ -3,6 +3,10 @@ package se.leap.bitmaskclient.base.utils; import android.content.Context; import androidx.annotation.DimenRes; +import androidx.annotation.StringRes; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; /** * Created by cyberta on 29.06.18. @@ -14,4 +18,19 @@ public class ViewHelper { return context.getResources().getDimensionPixelSize(dimension); } + /** + * Sets the subtitle of an activities action bar. The activity needs to be an AppCompatActivity. + * @param fragment + * @param stringId + */ + public static void setActionBarTitle(Fragment fragment, @StringRes int stringId) { + AppCompatActivity appCompatActivity = (AppCompatActivity) fragment.getActivity(); + if (appCompatActivity != null) { + ActionBar actionBar = appCompatActivity.getSupportActionBar(); + if (actionBar != null) { + actionBar.setSubtitle(stringId); + } + } + } + } -- cgit v1.2.3 From 37abb77b42eb63892b042e5fd158fd80e0a0ccf0 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 15:37:35 +0100 Subject: shrink text size on location selection button, if there's not enough space on small screens --- app/src/main/res/layout/v_location_button.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/res/layout/v_location_button.xml b/app/src/main/res/layout/v_location_button.xml index 8cba9d70..11410c62 100644 --- a/app/src/main/res/layout/v_location_button.xml +++ b/app/src/main/res/layout/v_location_button.xml @@ -1,6 +1,7 @@ @@ -42,7 +43,10 @@ android:maxLines="1" android:ellipsize="end" android:layout_height="wrap_content" - android:layout_width="wrap_content" + android:layout_width="match_parent" + app:autoSizeTextType="uniform" + android:gravity="center_vertical" + app:autoSizeMinTextSize="15sp" android:layout_toEndOf="@id/recommended_icn" android:layout_toRightOf="@+id/recommended_icn" android:layout_toLeftOf="@+id/bridge_icn" -- cgit v1.2.3 From 53f418cef621eb680bbfd7502004a0125eb3e09e Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 15:38:33 +0100 Subject: adapt wording for hiding connection details, fixes #9051 --- .../providersetup/activities/ConfigWizardBaseActivity.java | 5 +---- app/src/main/res/layout-xlarge/v_loading_screen.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java index a4104e30..29900ad3 100644 --- a/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/providersetup/activities/ConfigWizardBaseActivity.java @@ -9,7 +9,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; -import android.widget.Button; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.RelativeLayout; @@ -22,7 +21,6 @@ import androidx.appcompat.widget.AppCompatTextView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.Guideline; import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -31,7 +29,6 @@ import java.util.Observable; import java.util.Observer; import butterknife.BindView; -import se.leap.bitmaskclient.BuildConfig; import se.leap.bitmaskclient.R; import se.leap.bitmaskclient.base.models.Provider; import se.leap.bitmaskclient.base.views.ProviderHeaderView; @@ -270,7 +267,7 @@ public abstract class ConfigWizardBaseActivity extends ButterKnifeActivity imple logsContainer.setVisibility(VISIBLE); connectionDetailContainer.setVisibility(VISIBLE); connectionDetailsTitle.setVisibility(VISIBLE); - connectionDetailBtn.setText(R.string.hide_connection_details); + connectionDetailBtn.setText(R.string.hide); } }); connectionDetailHeaderContainer.setVisibility(VISIBLE); diff --git a/app/src/main/res/layout-xlarge/v_loading_screen.xml b/app/src/main/res/layout-xlarge/v_loading_screen.xml index 24b44f9a..2ecb8f42 100644 --- a/app/src/main/res/layout-xlarge/v_loading_screen.xml +++ b/app/src/main/res/layout-xlarge/v_loading_screen.xml @@ -80,7 +80,7 @@ android:maxLines="1" android:ellipsize="end" android:visibility="visible" - tools:text="@string/hide_connection_details" + tools:text="@string/hide" /> Informs about usage of bridges while configuring %s. Starting bridges failed. Do you want to retry or continue with an unobfuscated secure connection to configure %s? Retry unobfuscated - Hide connection details + Hide %s has no internet connection. Please check your WiFi and cellular data settings. Censorship circumvention Use Snowflake -- cgit v1.2.3 From 0e66d01eb7d24eef1e429eed3cfc046a9abce311 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 15:40:25 +0100 Subject: reduce connection state font size again a little bit --- app/src/main/res/layout-port/f_eip.xml | 2 +- app/src/main/res/layout/f_eip.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/res/layout-port/f_eip.xml b/app/src/main/res/layout-port/f_eip.xml index d99d9da9..99004387 100644 --- a/app/src/main/res/layout-port/f_eip.xml +++ b/app/src/main/res/layout-port/f_eip.xml @@ -64,7 +64,7 @@ app:layout_constraintBottom_toTopOf="@+id/sub_description" android:padding="@dimen/activity_margin" android:textAppearance="@android:style/TextAppearance.Large" - android:textSize="30sp" + android:textSize="26sp" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" diff --git a/app/src/main/res/layout/f_eip.xml b/app/src/main/res/layout/f_eip.xml index c6c48d69..fa2d4ded 100644 --- a/app/src/main/res/layout/f_eip.xml +++ b/app/src/main/res/layout/f_eip.xml @@ -96,7 +96,7 @@ android:paddingRight="@dimen/stdpadding" android:paddingEnd="@dimen/stdpadding" android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" - android:textSize="30sp" + android:textSize="26sp" android:textStyle="bold" android:textColor="@color/colorEipFragmentFont" app:layout_constraintDimensionRatio="1:1" -- cgit v1.2.3 From 4a914df3468534b585de466b5754782d47758de0 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Thu, 25 Nov 2021 17:12:16 +0100 Subject: =?UTF-8?q?replace=20sofiapro=20regular=20font,=20fixes=20broken?= =?UTF-8?q?=20'=C3=9F'=20char?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/font/sofiapro_regular.otf | Bin 140748 -> 0 bytes app/src/main/res/font/sofiapro_regular.ttf | Bin 0 -> 97164 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/src/main/res/font/sofiapro_regular.otf create mode 100644 app/src/main/res/font/sofiapro_regular.ttf (limited to 'app') diff --git a/app/src/main/res/font/sofiapro_regular.otf b/app/src/main/res/font/sofiapro_regular.otf deleted file mode 100644 index 66d25156..00000000 Binary files a/app/src/main/res/font/sofiapro_regular.otf and /dev/null differ diff --git a/app/src/main/res/font/sofiapro_regular.ttf b/app/src/main/res/font/sofiapro_regular.ttf new file mode 100644 index 00000000..d7e5f95b Binary files /dev/null and b/app/src/main/res/font/sofiapro_regular.ttf differ -- cgit v1.2.3