diff options
Diffstat (limited to 'app/src/main')
31 files changed, 887 insertions, 214 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2ffb54f4..6a1d40aa 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -90,7 +90,8 @@ <activity android:name=".MainActivity" - android:label="@string/title_activity_main" /> + android:label="@string/title_activity_main" + android:launchMode="singleTop" /> <activity android:name=".ProviderListActivity" diff --git a/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java b/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java index 9826b89b..6738a6bb 100644 --- a/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/AbstractProviderDetailActivity.java @@ -55,7 +55,7 @@ public abstract class AbstractProviderDetailActivity extends ConfigWizardBaseAct options.setAdapter(new ArrayAdapter<>( this, - android.R.layout.simple_list_item_activated_1, + R.layout.single_list_item, android.R.id.text1, optionsList.toArray(new String[optionsList.size()]) )); diff --git a/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java b/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java index f9e45b79..15fd85f8 100644 --- a/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java +++ b/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java @@ -1,7 +1,7 @@ package se.leap.bitmaskclient; -import android.app.Application; import android.content.Context; +import android.support.multidex.MultiDexApplication; import com.squareup.leakcanary.LeakCanary; import com.squareup.leakcanary.RefWatcher; @@ -10,7 +10,7 @@ import com.squareup.leakcanary.RefWatcher; * Created by cyberta on 24.10.17. */ -public class BitmaskApp extends Application { +public class BitmaskApp extends MultiDexApplication { private RefWatcher refWatcher; diff --git a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java index a86afd78..3a433d17 100644 --- a/app/src/main/java/se/leap/bitmaskclient/EipFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/EipFragment.java @@ -82,10 +82,12 @@ import static se.leap.bitmaskclient.ProviderAPI.DOWNLOAD_CERTIFICATE; public class EipFragment extends Fragment implements Observer { - public static String TAG = EipFragment.class.getSimpleName(); + public final static String TAG = EipFragment.class.getSimpleName(); protected static final String IS_CONNECTED = TAG + ".is_connected"; public static final String START_EIP_ON_BOOT = "start on boot"; + public static final String ASK_TO_CANCEL_VPN = "ask_to_cancel_vpn"; + private SharedPreferences preferences; private Provider provider; @@ -134,6 +136,7 @@ public class EipFragment extends Fragment implements Observer { }; + @Override public void onAttach(Context context) { super.onAttach(context); Bundle arguments = getArguments(); @@ -167,8 +170,12 @@ public class EipFragment extends Fragment implements Observer { ButterKnife.inject(this, view); Bundle arguments = getArguments(); - if (arguments != null && arguments.containsKey(START_EIP_ON_BOOT) && arguments.getBoolean(START_EIP_ON_BOOT)) { - startEipFromScratch(); + if (arguments != null) { + if (arguments.containsKey(START_EIP_ON_BOOT) && arguments.getBoolean(START_EIP_ON_BOOT)) { + startEipFromScratch(); + } else if (arguments.containsKey(ASK_TO_CANCEL_VPN) && arguments.getBoolean(ASK_TO_CANCEL_VPN)) { + askToStopEIP(); + } } return view; } diff --git a/app/src/main/java/se/leap/bitmaskclient/MainActivity.java b/app/src/main/java/se/leap/bitmaskclient/MainActivity.java index d3865559..9c047bc9 100644 --- a/app/src/main/java/se/leap/bitmaskclient/MainActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/MainActivity.java @@ -17,6 +17,7 @@ import static se.leap.bitmaskclient.Constants.REQUEST_CODE_CONFIGURE_LEAP; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_LOG_IN; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_SWITCH_PROVIDER; import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; +import static se.leap.bitmaskclient.EipFragment.ASK_TO_CANCEL_VPN; public class MainActivity extends AppCompatActivity { @@ -66,13 +67,25 @@ public class MainActivity extends AppCompatActivity { return; } + Fragment fragment = null; switch (intent.getAction()) { case ACTION_SHOW_VPN_FRAGMENT: - showEipFragment(); + fragment = new EipFragment(); + if (intent.hasExtra(ASK_TO_CANCEL_VPN)) { + Bundle bundle = new Bundle(); + bundle.putBoolean(ASK_TO_CANCEL_VPN, true); + fragment.setArguments(bundle); + } break; default: break; } + + if (fragment != null) { + new FragmentManagerEnhanced(getSupportFragmentManager()).beginTransaction() + .replace(R.id.container, fragment) + .commit(); + } } @Override @@ -91,6 +104,7 @@ public class MainActivity extends AppCompatActivity { ConfigHelper.storeProviderInPreferences(preferences, provider); navigationDrawerFragment.refresh(); + switch (requestCode) { case REQUEST_CODE_SWITCH_PROVIDER: EipCommand.stopVPN(this); @@ -100,13 +114,9 @@ public class MainActivity extends AppCompatActivity { case REQUEST_CODE_LOG_IN: EipCommand.startVPN(this); break; - } - showEipFragment(); } - } - private void showEipFragment() { Fragment fragment = new EipFragment(); Bundle arguments = new Bundle(); arguments.putParcelable(PROVIDER_KEY, provider); @@ -115,5 +125,4 @@ public class MainActivity extends AppCompatActivity { .replace(R.id.container, fragment) .commit(); } - } diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderListBaseActivity.java b/app/src/main/java/se/leap/bitmaskclient/ProviderListBaseActivity.java index c89e7a49..b2daff82 100644 --- a/app/src/main/java/se/leap/bitmaskclient/ProviderListBaseActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/ProviderListBaseActivity.java @@ -178,7 +178,7 @@ public abstract class ProviderListBaseActivity extends ConfigWizardBaseActivity } private void setUpInitialUI() { - setContentView(R.layout.configuration_wizard_activity); + setContentView(R.layout.provider_list_activity); setProviderHeaderText(R.string.setup_provider); hideProgressBar(); } diff --git a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java index 616264f9..8607575e 100644 --- a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java @@ -15,6 +15,7 @@ import java.lang.annotation.RetentionPolicy; import de.blinkt.openvpn.core.VpnStatus; import se.leap.bitmaskclient.userstatus.User; +import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP; import static se.leap.bitmaskclient.Constants.APP_ACTION_CONFIGURE_ALWAYS_ON_PROFILE; import static se.leap.bitmaskclient.Constants.PREFERENCES_APP_VERSION; import static se.leap.bitmaskclient.Constants.REQUEST_CODE_CONFIGURE_LEAP; @@ -186,6 +187,7 @@ public class StartActivity extends Activity { private void showMainActivity() { Intent intent = new Intent(this, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setAction(MainActivity.ACTION_SHOW_VPN_FRAGMENT); startActivity(intent); finish(); diff --git a/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java b/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java index 5b089524..459f337b 100644 --- a/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java +++ b/app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java @@ -44,6 +44,8 @@ import static android.text.TextUtils.isEmpty; import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_NONETWORK; import static de.blinkt.openvpn.core.ConnectionStatus.LEVEL_WAITING_FOR_USER_INPUT; import static se.leap.bitmaskclient.Constants.EIP_ACTION_STOP_BLOCKING_VPN; +import static se.leap.bitmaskclient.EipFragment.ASK_TO_CANCEL_VPN; +import static se.leap.bitmaskclient.MainActivity.ACTION_SHOW_VPN_FRAGMENT; /** * Created by cyberta on 14.01.18. @@ -86,7 +88,7 @@ public class VpnNotificationManager { VoidVpnService.NOTIFICATION_CHANNEL_NEWSTATUS_ID, PRIORITY_MAX, 0, - getDashboardIntent(), + getMainActivityIntent(), actionBuilder.build()); } @@ -122,7 +124,7 @@ public class VpnNotificationManager { if (status == LEVEL_WAITING_FOR_USER_INPUT) contentIntent = getUserInputIntent(msg); else - contentIntent = getDashboardIntent(); + contentIntent = getMainActivityIntent(); int priority; if (OpenVPNService.NOTIFICATION_CHANNEL_NEWSTATUS_ID.equals(notificationChannelNewstatusId)) { @@ -254,11 +256,9 @@ public class VpnNotificationManager { lastNotificationChannel = notificationChannelNewstatusId; } - private PendingIntent getDashboardIntent() { - Intent startDashboard = new Intent(context, Dashboard.class); - startDashboard.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | - Intent.FLAG_ACTIVITY_SINGLE_TOP); - return PendingIntent.getActivity(context, 0, startDashboard, PendingIntent.FLAG_CANCEL_CURRENT); + private PendingIntent getMainActivityIntent() { + Intent startActivity = new Intent(context, StartActivity.class); + return PendingIntent.getActivity(context, 0, startActivity, PendingIntent.FLAG_CANCEL_CURRENT); } private PendingIntent getStopVoidVpnIntent() { @@ -268,10 +268,10 @@ public class VpnNotificationManager { } private PendingIntent getDisconnectIntent() { - Intent disconnectVPN = new Intent(context, Dashboard.class); - disconnectVPN.setAction(Intent.ACTION_MAIN); //needs to be set that actual action can get triggered - disconnectVPN.putExtra(Dashboard.ACTION_ASK_TO_CANCEL_VPN, true); - disconnectVPN.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); + Intent disconnectVPN = new Intent(context, MainActivity.class); + disconnectVPN.setAction(ACTION_SHOW_VPN_FRAGMENT); + disconnectVPN.putExtra(ASK_TO_CANCEL_VPN, true); + disconnectVPN.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); return PendingIntent.getActivity(context, 0, disconnectVPN, PendingIntent.FLAG_CANCEL_CURRENT); } diff --git a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java index 64d1bb72..9d5d4341 100644 --- a/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java @@ -120,7 +120,7 @@ public class NavigationDrawerFragment extends Fragment { mDrawerSettingsListView.setAdapter(new ArrayAdapter<String>( actionBar.getThemedContext(), - android.R.layout.simple_list_item_activated_1, + R.layout.single_list_item, android.R.id.text1, new String[]{ getString(R.string.switch_provider_menu_option), @@ -137,7 +137,7 @@ public class NavigationDrawerFragment extends Fragment { }); accountListAdapter = new ArrayAdapter<>(actionBar.getThemedContext(), - android.R.layout.simple_list_item_activated_1, + R.layout.single_list_item, android.R.id.text1); createListAdapterData(); diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java index e53d81d9..cec917f7 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/EIP.java @@ -27,6 +27,8 @@ import android.util.Log; import org.json.JSONException; import org.json.JSONObject; +import java.lang.ref.WeakReference; + import de.blinkt.openvpn.LaunchVPN; import se.leap.bitmaskclient.OnBootReceiver; @@ -60,12 +62,12 @@ public final class EIP extends IntentService { public final static String TAG = EIP.class.getSimpleName(); public final static String SERVICE_API_PATH = "config/eip-service.json"; - private static ResultReceiver mReceiver; - private static SharedPreferences preferences; + private WeakReference<ResultReceiver> mReceiverRef = new WeakReference<>(null); + private SharedPreferences preferences; - private static JSONObject eipDefinition; + private JSONObject eipDefinition; private GatewaysManager gatewaysManager = new GatewaysManager(); - private static Gateway gateway; + private Gateway gateway; public EIP() { super(TAG); @@ -83,7 +85,9 @@ public final class EIP extends IntentService { @Override protected void onHandleIntent(Intent intent) { String action = intent.getAction(); - mReceiver = intent.getParcelableExtra(EIP_RECEIVER); + if (intent.getParcelableExtra(EIP_RECEIVER) != null) { + mReceiverRef = new WeakReference<>((ResultReceiver) intent.getParcelableExtra(EIP_RECEIVER)); + } if (action == null) { return; @@ -246,8 +250,8 @@ public final class EIP extends IntentService { private void tellToReceiverOrBroadcast(String action, int resultCode) { Bundle resultData = new Bundle(); resultData.putString(EIP_REQUEST, action); - if (mReceiver != null) { - mReceiver.send(resultCode, resultData); + if (mReceiverRef.get() != null) { + mReceiverRef.get().send(resultCode, resultData); } else { broadcastEvent(resultCode, resultData); } diff --git a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java index 70da20ac..2d8b5c6f 100644 --- a/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/userstatus/UserStatusFragment.java @@ -3,6 +3,7 @@ package se.leap.bitmaskclient.userstatus; import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -25,7 +26,7 @@ import se.leap.bitmaskclient.R; public class UserStatusFragment extends Fragment implements Observer { - public static String TAG = UserStatusFragment.class.getSimpleName(); + public final static String TAG = UserStatusFragment.class.getSimpleName(); private ProviderAPIResultReceiver providerAPI_result_receiver; private Provider provider; @@ -88,7 +89,8 @@ public class UserStatusFragment extends Fragment implements Observer { android.util.Log.d(TAG, status.toString()); if(status.isLoggedIn()) logOut(); - //else if(status.isLoggedOut()) + else if(status.isLoggedOut()) + Log.w(TAG, "implement login from here?"); //MainActivity.sessionDialog(Bundle.EMPTY); else if(status.inProgress()) cancelLoginOrSignup(); diff --git a/app/src/main/res/layout-sw600dp-port/a_provider_credentials.xml b/app/src/main/res/layout-sw600dp-port/a_provider_credentials.xml new file mode 100644 index 00000000..4555343c --- /dev/null +++ b/app/src/main/res/layout-sw600dp-port/a_provider_credentials.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + style="@style/BitmaskActivity" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ProviderCredentialsBaseActivity"> + + <android.support.v7.widget.AppCompatImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:srcCompat="@drawable/ic_colorsquare" + android:scaleType="centerCrop" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.2" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.8" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_top" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.275" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_bottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.725" /> + + <LinearLayout + android:id="@+id/content" + android:orientation="vertical" + style="@style/BitmaskActivity" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/stdpadding" + android:padding="@dimen/stdpadding" + android:background="@color/colorBackground" + app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_right" + app:layout_constraintHeight_min="411dp" + app:layout_constraintStart_toStartOf="@+id/guideline_left" + app:layout_constraintTop_toTopOf="@+id/guideline_top" + app:layout_constraintWidth_min="731dp" + > + + <include layout="@layout/loading_screen" /> + + <include + layout="@layout/provider_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + + <ScrollView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:isScrollContainer="true" + > + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <include + layout="@layout/provider_credentials" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <android.support.v7.widget.AppCompatButton + android:id="@+id/button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:text="@string/login_button" /> + + </LinearLayout> + </ScrollView> + </LinearLayout> +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout-sw600dp-port/a_provider_detail.xml b/app/src/main/res/layout-sw600dp-port/a_provider_detail.xml new file mode 100644 index 00000000..bdafa45a --- /dev/null +++ b/app/src/main/res/layout-sw600dp-port/a_provider_detail.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/provider_list_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ProviderDetailActivity" + style="@style/BitmaskActivity"> + + <android.support.v7.widget.AppCompatImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:srcCompat="@drawable/ic_colorsquare" + android:scaleType="centerCrop" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.2" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.8" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_top" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.275" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_bottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.725" /> + + <LinearLayout + android:orientation="vertical" + android:padding="@dimen/stdpadding" + style="@style/BitmaskActivity" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/stdpadding" + android:background="@color/colorBackground" + app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_right" + app:layout_constraintHeight_min="411dp" + app:layout_constraintStart_toStartOf="@+id/guideline_left" + app:layout_constraintTop_toTopOf="@+id/guideline_top" + app:layout_constraintWidth_min="731dp"> + + <include layout="@layout/loading_screen" /> + + <LinearLayout + android:id="@+id/content" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <include + layout="@layout/provider_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <android.support.v7.widget.AppCompatTextView + android:id="@+id/provider_detail_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_marginTop="@dimen/standard_margin" + android:layout_marginBottom="@dimen/standard_margin" + /> + + <ListView + android:id="@+id/provider_detail_options" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/list_view_margin_top" + android:drawSelectorOnTop="false" + /> + + </LinearLayout> + </LinearLayout> +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout-sw600dp-port/provider_list_activity.xml b/app/src/main/res/layout-sw600dp-port/provider_list_activity.xml new file mode 100644 index 00000000..f02398c5 --- /dev/null +++ b/app/src/main/res/layout-sw600dp-port/provider_list_activity.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/provider_list_layout" + style="@style/BitmaskActivity" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ProviderListActivity"> + + <android.support.v7.widget.AppCompatImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:srcCompat="@drawable/ic_colorsquare" + android:scaleType="centerCrop" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.2" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.8" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_top" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.275" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_bottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.725" /> + + <LinearLayout + android:orientation="vertical" + android:padding="@dimen/stdpadding" + style="@style/BitmaskActivity" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/stdpadding" + android:background="@color/colorBackground" + app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_right" + app:layout_constraintHeight_min="411dp" + app:layout_constraintStart_toStartOf="@+id/guideline_left" + app:layout_constraintTop_toTopOf="@+id/guideline_top" + app:layout_constraintWidth_min="731dp"> + + <include layout="@layout/loading_screen" /> + + <LinearLayout + android:id="@+id/content" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <include layout="@layout/provider_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <ListView + android:id="@+id/provider_list" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawSelectorOnTop="false" + android:layout_marginTop="@dimen/list_view_margin_top" + /> + + </LinearLayout> + </LinearLayout> +</android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout-xlarge/a_provider_credentials.xml b/app/src/main/res/layout-xlarge/a_provider_credentials.xml new file mode 100644 index 00000000..82abb5cb --- /dev/null +++ b/app/src/main/res/layout-xlarge/a_provider_credentials.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + style="@style/BitmaskActivity" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ProviderCredentialsBaseActivity"> + + <android.support.v7.widget.AppCompatImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:srcCompat="@drawable/ic_colorsquare" + android:scaleType="centerCrop" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.2" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.8" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_top" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.15" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_bottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.85" /> + + <LinearLayout + android:id="@+id/content" + android:orientation="vertical" + style="@style/BitmaskActivity" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/stdpadding" + android:padding="@dimen/stdpadding" + android:background="@color/colorBackground" + app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_right" + app:layout_constraintHeight_min="411dp" + app:layout_constraintStart_toStartOf="@+id/guideline_left" + app:layout_constraintTop_toTopOf="@+id/guideline_top" + app:layout_constraintWidth_min="731dp"> + + <include layout="@layout/loading_screen" /> + + <include + layout="@layout/provider_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + + <ScrollView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:isScrollContainer="true" + > + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <include + layout="@layout/provider_credentials" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <android.support.v7.widget.AppCompatButton + android:id="@+id/button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:text="@string/login_button" /> + + </LinearLayout> + </ScrollView> + </LinearLayout> +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/a_provider_detail.xml b/app/src/main/res/layout-xlarge/a_provider_detail.xml index 31538f9f..18098079 100644 --- a/app/src/main/res/layout-xlarge/a_provider_detail.xml +++ b/app/src/main/res/layout-xlarge/a_provider_detail.xml @@ -1,32 +1,94 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/provider_list_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - style="@style/BitmaskActivity" > + tools:context=".ProviderDetailActivity" + style="@style/BitmaskActivity"> - <include layout="@layout/loading_screen" /> + <android.support.v7.widget.AppCompatImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:srcCompat="@drawable/ic_colorsquare" + android:scaleType="centerCrop" + /> - <android.support.v7.widget.AppCompatTextView - android:id="@+id/provider_detail_name" + <android.support.constraint.Guideline + android:id="@+id/guideline_left" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="24sp" - android:textAppearance="?android:attr/textAppearanceMedium" /> + android:orientation="vertical" + app:layout_constraintGuide_percent="0.2" /> - <android.support.v7.widget.AppCompatTextView - android:id="@+id/provider_detail_description" + <android.support.constraint.Guideline + android:id="@+id/guideline_right" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="18sp" - android:textStyle="normal" - android:textAppearance="?android:attr/textAppearanceSmall" /> + android:orientation="vertical" + app:layout_constraintGuide_percent="0.8" /> - <ListView - android:id="@+id/provider_detail_options" - android:layout_width="match_parent" + <android.support.constraint.Guideline + android:id="@+id/guideline_top" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/standard_margin" - /> + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.15" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_bottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.85" /> + + <LinearLayout + android:orientation="vertical" + android:padding="@dimen/stdpadding" + style="@style/BitmaskActivity" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/stdpadding" + android:background="@color/colorBackground" + app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_right" + app:layout_constraintHeight_min="411dp" + app:layout_constraintStart_toStartOf="@+id/guideline_left" + app:layout_constraintTop_toTopOf="@+id/guideline_top" + app:layout_constraintWidth_min="731dp"> + + <include layout="@layout/loading_screen" /> + + <LinearLayout + android:id="@+id/content" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <include + layout="@layout/provider_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <android.support.v7.widget.AppCompatTextView + android:id="@+id/provider_detail_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal" + android:textAppearance="?android:attr/textAppearanceMedium" + android:layout_marginTop="@dimen/standard_margin" + android:layout_marginBottom="@dimen/standard_margin" + /> + + <ListView + android:id="@+id/provider_detail_options" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/list_view_margin_top" + android:drawSelectorOnTop="false" + /> -</LinearLayout>
\ No newline at end of file + </LinearLayout> + </LinearLayout> +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/configuration_wizard_activity.xml b/app/src/main/res/layout-xlarge/configuration_wizard_activity.xml deleted file mode 100644 index 581b0c9a..00000000 --- a/app/src/main/res/layout-xlarge/configuration_wizard_activity.xml +++ /dev/null @@ -1,34 +0,0 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:id="@+id/configuration_wizard_layout" - android:layout_width="match_parent" - android:layout_height="match_parent" - tools:context=".ProviderListActivity" - style="@style/BitmaskActivity" > - - <ListView - android:id="@+id/provider_list" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:drawSelectorOnTop="false" /> - - <ProgressBar - android:id="@+id/progressbar_configuration_wizard" - style="?android:attr/progressBarStyleHorizontal" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:max="3" /> - - <TextView - android:id="@+id/progressbar_description" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:fadingEdge="horizontal" - android:singleLine="true" - android:text="@string/configuring_provider" - android:textSize="24sp" - android:textAppearance="?android:attr/textAppearanceMedium" - android:layout_centerHorizontal="true" - android:textColor="@android:color/holo_blue_bright" /> - -</RelativeLayout> 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 c99d83bc..497d2c0b 100644 --- a/app/src/main/res/layout-xlarge/eip_service_fragment.xml +++ b/app/src/main/res/layout-xlarge/eip_service_fragment.xml @@ -1,58 +1,152 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="10dp" - android:layout_marginLeft="20dp" - android:layout_marginStart="20dp" + android:layout_height="match_parent" android:id="@+id/eipServiceFragment" > + <android.support.constraint.Guideline + android:id="@+id/guideline_horizontal_top" + android:layout_width="0dp" + android:layout_height="0dp" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintGuide_percent="0.3" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_vertical_left" + android:layout_width="0dp" + android:layout_height="0dp" + android:orientation="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintGuide_percent="0.3" + /> + + + <android.support.constraint.Guideline + android:id="@+id/guideline_horizontal_bottom" + android:layout_width="0dp" + android:layout_height="0dp" + android:orientation="horizontal" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintGuide_percent="0.7" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_vertical_right" + android:layout_width="0dp" + android:layout_height="0dp" + android:orientation="vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintGuide_percent="0.7" + /> + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/background" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="fitXY" + app:srcCompat="@drawable/ic_colorsquare" /> + + <TextView android:id="@+id/eipLabel" - android:layout_centerHorizontal="true" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="10dp" - android:layout_marginStart="10dp" - android:layout_marginTop="12dp" - android:layout_marginBottom="30dp" + android:layout_marginEnd="@dimen/stdpadding" + android:layout_marginStart="@dimen/stdpadding" + android:layout_marginTop="@dimen/stdpadding" + android:layout_marginLeft="@dimen/stdpadding" + android:layout_marginRight="@dimen/stdpadding" android:text="@string/eip_service_label" - android:textSize="46sp" android:textAppearance="?android:attr/textAppearanceMedium" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/cirle" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="@dimen/stdpadding" + android:layout_marginEnd="@dimen/stdpadding" + android:layout_marginStart="@dimen/stdpadding" + android:layout_marginTop="@dimen/stdpadding" + android:layout_marginLeft="@dimen/stdpadding" + android:layout_marginRight="@dimen/stdpadding" + app:layout_constraintBottom_toTopOf="@+id/guideline_horizontal_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_vertical_right" + app:layout_constraintHorizontal_bias="1.0" + app:layout_constraintStart_toStartOf="@+id/guideline_vertical_left" + app:layout_constraintTop_toTopOf="@+id/guideline_horizontal_top" + app:layout_constraintVertical_bias="0.0" + app:srcCompat="@drawable/black_circle" /> + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/key" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="@dimen/stdpadding" + android:layout_marginEnd="@dimen/stdpadding" + android:layout_marginStart="@dimen/stdpadding" + android:layout_marginTop="@dimen/stdpadding" + android:layout_marginLeft="@dimen/stdpadding" + android:layout_marginRight="@dimen/stdpadding" + app:layout_constraintBottom_toBottomOf="@+id/cirle" + app:layout_constraintEnd_toEndOf="@+id/cirle" + app:layout_constraintStart_toStartOf="@+id/cirle" + app:layout_constraintTop_toTopOf="@+id/cirle" + app:srcCompat="@drawable/vpn_connected" /> + + + <android.support.v7.widget.AppCompatButton + android:id="@+id/vpn_main_button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/stdpadding" + android:layout_marginEnd="@dimen/stdpadding" + android:layout_marginStart="@dimen/stdpadding" + android:layout_marginTop="@dimen/stdpadding" + android:layout_marginLeft="@dimen/stdpadding" + android:layout_marginRight="@dimen/stdpadding" + app:layout_constraintBottom_toBottomOf="@+id/background" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + android:text="@string/vpn.button.turn.on" + style="@style/BitmaskButtonBlack" /> + <TextView + android:id="@+id/routed_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/stdpadding" + android:layout_marginStart="@dimen/stdpadding" + android:layout_marginTop="@dimen/stdpadding" + android:layout_marginLeft="@dimen/stdpadding" + android:layout_marginRight="@dimen/stdpadding" + android:text="@string/vpn_securely_routed" + android:visibility="visible" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/eipLabel" /> - <LinearLayout + <TextView + android:id="@+id/vpn_route" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal" - android:layout_below="@+id/eipLabel" - android:layout_centerInParent="true"> - - <Button - android:id="@+id/vpn_main_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="24dp" - android:layout_marginLeft="24dp" - android:textSize="32sp" - /> - - <se.leap.bitmaskclient.userstatus.FabButton - android:id="@+id/vpn_status_image" - android:layout_width="56dp" - android:layout_height="56dp" - android:color="@android:color/holo_blue_dark" - android:layout_gravity="center" - android:visibility="visible" - android:indeterminate="true" - android:max="100" - fbb_autoStart="true" - fbb_progressColor="#ff170aff" - fbb_progressWidthRatio="0.2" - android:layout_marginStart="24dp" - android:layout_marginLeft="24dp" - /> - </LinearLayout> -</RelativeLayout> + android:layout_marginEnd="@dimen/stdpadding" + android:layout_marginStart="@dimen/stdpadding" + android:layout_marginLeft="@dimen/stdpadding" + android:layout_marginRight="@dimen/stdpadding" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/routed_text" /> + +</android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout-xlarge/loading_screen.xml b/app/src/main/res/layout-xlarge/loading_screen.xml new file mode 100644 index 00000000..2af6b411 --- /dev/null +++ b/app/src/main/res/layout-xlarge/loading_screen.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/loading_screen" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:visibility="gone"> + + <android.support.v7.widget.AppCompatImageView + android:layout_width="32dp" + android:layout_height="32dp" + android:adjustViewBounds="true" + app:tint="@color/colorPrimary" + app:srcCompat="@drawable/action_history" + android:layout_marginTop="@dimen/loading_screen_icon_vertical_margin" + android:layout_marginBottom="@dimen/loading_screen_icon_vertical_margin" + /> + + <android.support.v7.widget.AppCompatTextView + android:id="@+id/progressbar_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:fadingEdge="horizontal" + android:singleLine="true" + android:text="@string/configuring_provider" + android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" + android:layout_marginTop="@dimen/standard_margin" + android:layout_marginBottom="@dimen/standard_margin" + /> + + <ProgressBar + android:id="@+id/progressbar" + style="@style/Widget.AppCompat.ProgressBar.Horizontal" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:indeterminate="true" + android:layout_marginTop="@dimen/standard_margin" + /> + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/provider_header.xml b/app/src/main/res/layout-xlarge/provider_header.xml new file mode 100644 index 00000000..45f8302b --- /dev/null +++ b/app/src/main/res/layout-xlarge/provider_header.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<merge xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" > + + <android.support.v7.widget.AppCompatImageView + android:id="@+id/provider_header_logo" + android:layout_width="@dimen/bitmask_logo_tablet" + android:layout_height="@dimen/bitmask_logo_tablet" + android:adjustViewBounds="true" + app:srcCompat="@drawable/mask" /> + + <android.support.v7.widget.AppCompatTextView + android:id="@+id/provider_header_text" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="" + android:textAppearance="@style/Base.TextAppearance.AppCompat.Headline" + android:layout_marginTop="@dimen/standard_margin" + android:layout_marginBottom="@dimen/standard_margin" + /> + +</merge>
\ No newline at end of file diff --git a/app/src/main/res/layout-xlarge/provider_list_activity.xml b/app/src/main/res/layout-xlarge/provider_list_activity.xml new file mode 100644 index 00000000..cdffc24e --- /dev/null +++ b/app/src/main/res/layout-xlarge/provider_list_activity.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/provider_list_layout" + style="@style/BitmaskActivity" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".ProviderListActivity"> + + <android.support.v7.widget.AppCompatImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + app:srcCompat="@drawable/ic_colorsquare" + android:scaleType="centerCrop" + /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.2" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_right" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.8" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_top" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.15" /> + + <android.support.constraint.Guideline + android:id="@+id/guideline_bottom" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + app:layout_constraintGuide_percent="0.85" /> + + <LinearLayout + android:orientation="vertical" + android:padding="@dimen/stdpadding" + style="@style/BitmaskActivity" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="@dimen/stdpadding" + android:background="@color/colorBackground" + app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" + app:layout_constraintEnd_toStartOf="@+id/guideline_right" + app:layout_constraintHeight_min="411dp" + app:layout_constraintStart_toStartOf="@+id/guideline_left" + app:layout_constraintTop_toTopOf="@+id/guideline_top" + app:layout_constraintWidth_min="731dp"> + + <include layout="@layout/loading_screen" /> + + <LinearLayout + android:id="@+id/content" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <include layout="@layout/provider_header" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <ListView + android:id="@+id/provider_list" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawSelectorOnTop="false" + android:layout_marginTop="@dimen/list_view_margin_top" + /> + + </LinearLayout> + </LinearLayout> +</android.support.constraint.ConstraintLayout> diff --git a/app/src/main/res/layout-xlarge/provider_list_item.xml b/app/src/main/res/layout-xlarge/provider_list_item.xml index 728a61be..ec1e1242 100644 --- a/app/src/main/res/layout-xlarge/provider_list_item.xml +++ b/app/src/main/res/layout-xlarge/provider_list_item.xml @@ -1,44 +1,34 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:paddingTop="2dip" android:paddingBottom="2dip" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/activatedBackgroundIndicator" android:minHeight="?android:attr/listPreferredItemHeight" - android:mode="twoLine" > <TextView android:id="@+id/provider_domain" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" android:layout_marginTop="6dip" - android:textSize = "32sp" - android:textAppearance="?android:attr/textAppearanceListItem" + android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView android:id="@+id/provider_name" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/provider_domain" - android:layout_alignLeft="@id/provider_domain" - android:textSize = "24sp" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:textAppearance="?android:attr/textAppearanceMedium" /> -</TwoLineListItem> +</LinearLayout> diff --git a/app/src/main/res/layout-xlarge/single_list_item.xml b/app/src/main/res/layout-xlarge/single_list_item.xml new file mode 100644 index 00000000..ad3de093 --- /dev/null +++ b/app/src/main/res/layout-xlarge/single_list_item.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/text1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceLarge" + android:gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:background="?android:attr/activatedBackgroundIndicator" + android:minHeight="?android:attr/listPreferredItemHeight" /> diff --git a/app/src/main/res/layout/a_provider_credentials.xml b/app/src/main/res/layout/a_provider_credentials.xml index 85d9d3cb..4998effa 100644 --- a/app/src/main/res/layout/a_provider_credentials.xml +++ b/app/src/main/res/layout/a_provider_credentials.xml @@ -1,54 +1,43 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/content" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" + android:padding="@dimen/stdpadding" style="@style/BitmaskActivity"> <include layout="@layout/loading_screen" /> - <LinearLayout - android:id="@+id/content" + <include + layout="@layout/provider_header" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="wrap_content" /> - <include - layout="@layout/provider_header" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> + <ScrollView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:isScrollContainer="true" + > - <ScrollView - android:layout_height="match_parent" + <LinearLayout android:layout_width="match_parent" - android:isScrollContainer="true" - > - - <LinearLayout + android:layout_height="wrap_content" + android:orientation="vertical"> + <include + layout="@layout/provider_credentials" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - <include - layout="@layout/provider_credentials" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> + android:layout_height="wrap_content" /> - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="wrap_content"> - - <android.support.v7.widget.AppCompatButton - android:id="@+id/button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentEnd="true" - android:layout_alignParentRight="true" - android:text="@string/login_button" /> + <android.support.v7.widget.AppCompatButton + android:id="@+id/button" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:text="@string/login_button" /> - </RelativeLayout> - </LinearLayout> - </ScrollView> - </LinearLayout> + </LinearLayout> + </ScrollView> </LinearLayout> diff --git a/app/src/main/res/layout/a_provider_detail.xml b/app/src/main/res/layout/a_provider_detail.xml index 5f07b87c..018d4ee8 100644 --- a/app/src/main/res/layout/a_provider_detail.xml +++ b/app/src/main/res/layout/a_provider_detail.xml @@ -3,6 +3,7 @@ android:id="@+id/provider_detail_fragment" android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="@dimen/stdpadding" android:orientation="vertical" style="@style/BitmaskActivity" > diff --git a/app/src/main/res/layout/provider_header.xml b/app/src/main/res/layout/provider_header.xml index 8a757181..6b08976c 100644 --- a/app/src/main/res/layout/provider_header.xml +++ b/app/src/main/res/layout/provider_header.xml @@ -4,8 +4,8 @@ <android.support.v7.widget.AppCompatImageView android:id="@+id/provider_header_logo" - android:layout_width="@dimen/round_button_diameter" - android:layout_height="@dimen/round_button_diameter" + android:layout_width="@dimen/bitmask_logo" + android:layout_height="@dimen/bitmask_logo" android:adjustViewBounds="true" app:srcCompat="@drawable/mask" /> @@ -14,7 +14,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="" - android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium" + android:textAppearance="@style/Base.TextAppearance.AppCompat.Headline" android:layout_marginTop="@dimen/standard_margin" android:layout_marginBottom="@dimen/standard_margin" /> diff --git a/app/src/main/res/layout/configuration_wizard_activity.xml b/app/src/main/res/layout/provider_list_activity.xml index e22d9047..6c5281b8 100644 --- a/app/src/main/res/layout/configuration_wizard_activity.xml +++ b/app/src/main/res/layout/provider_list_activity.xml @@ -1,9 +1,10 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" - android:id="@+id/configuration_wizard_layout" + android:id="@+id/provider_list_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".ProviderListActivity" + android:padding="@dimen/stdpadding" style="@style/BitmaskActivity" > <include layout="@layout/loading_screen" /> diff --git a/app/src/main/res/layout/provider_list_item.xml b/app/src/main/res/layout/provider_list_item.xml index 68ba7e31..1f0e135b 100644 --- a/app/src/main/res/layout/provider_list_item.xml +++ b/app/src/main/res/layout/provider_list_item.xml @@ -1,33 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<TwoLineListItem xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" android:paddingTop="2dip" android:paddingBottom="2dip" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/activatedBackgroundIndicator" android:minHeight="?android:attr/listPreferredItemHeight" - android:mode="twoLine" > <TextView android:id="@+id/provider_domain" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" android:layout_marginTop="6dip" android:textAppearance="?android:attr/textAppearanceListItem" /> @@ -35,9 +24,11 @@ <TextView android:id="@+id/provider_name" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_below="@id/provider_domain" - android:layout_alignLeft="@id/provider_domain" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" android:textAppearance="?android:attr/textAppearanceSmall" /> -</TwoLineListItem> +</LinearLayout> diff --git a/app/src/main/res/layout/single_list_item.xml b/app/src/main/res/layout/single_list_item.xml new file mode 100644 index 00000000..652cb693 --- /dev/null +++ b/app/src/main/res/layout/single_list_item.xml @@ -0,0 +1,12 @@ +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@android:id/text1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceListItemSmall" + android:gravity="center_vertical" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:background="?android:attr/activatedBackgroundIndicator" + android:minHeight="?android:attr/listPreferredItemHeightSmall" />
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index a6afc8bc..87d8e266 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -29,4 +29,7 @@ <dimen name="navigation_drawer_width">300dp</dimen> <dimen name="loading_screen_icon_vertical_margin">16dp</dimen> + + <dimen name="bitmask_logo">56dp</dimen> + <dimen name="bitmask_logo_tablet">72dp</dimen> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 867fa54f..4e845384 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -65,7 +65,6 @@ </style> <style name="BitmaskActivity"> - <item name="android:padding">@dimen/activity_margin</item> </style> <style name="BitmaskButtonBlack" parent="android:Widget.Button"> |