summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorFup Duck <fupduck@sacknagel.com>2018-01-09 14:02:57 +0100
committerFup Duck <fupduck@sacknagel.com>2018-01-09 14:02:57 +0100
commit3addd20598f7fee2d41a24d64b375a2f63874457 (patch)
treec6127e66e2b0c6857a38879dc935a1196727a9f7 /app/src/main
parentbc9c6ef38348af8719358aa7d8426439519bc7f1 (diff)
create ProviderDetail Activity
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/AndroidManifest.xml8
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java45
-rw-r--r--app/src/main/res/layout-xlarge/provider_detail_fragment.xml5
-rw-r--r--app/src/main/res/layout/provider_detail_fragment.xml5
-rw-r--r--app/src/main/res/values-es/strings.xml2
-rw-r--r--app/src/main/res/values/strings.xml2
6 files changed, 21 insertions, 46 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 43c31a88..8407d76d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -91,11 +91,11 @@
</activity>
<activity
android:name=".ConfigurationWizard"
- android:label="@string/configuration_wizard_title"
- android:uiOptions="splitActionBarWhenNarrow"></activity>
+ android:label="@string/configuration_wizard_title" />
+
<activity
- android:name=".fragments.AboutFragment"
- android:label="@string/about_fragment_title"></activity>
+ android:name=".ProviderDetailActivity"
+ android:label="@string/provider_details_title" />
<service
android:name=".eip.EIP"
diff --git a/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java b/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java
index 9f12ed9a..601615b6 100644
--- a/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java
@@ -70,7 +70,7 @@ import static android.view.View.VISIBLE;
*/
public abstract class BaseConfigurationWizard extends AppCompatActivity
- implements NewProviderDialog.NewProviderDialogInterface, ProviderDetailFragment.ProviderDetailFragmentInterface, DownloadFailedDialog.DownloadFailedDialogInterface, ProviderAPIResultReceiver.Receiver {
+ implements NewProviderDialog.NewProviderDialogInterface, DownloadFailedDialog.DownloadFailedDialogInterface, ProviderAPIResultReceiver.Receiver {
@InjectView(R.id.progressbar_configuration_wizard)
protected ProgressBar mProgressBar;
@InjectView(R.id.progressbar_description)
@@ -150,22 +150,13 @@ public abstract class BaseConfigurationWizard extends AppCompatActivity
private void restoreState(Bundle savedInstanceState) {
progressbar_text = savedInstanceState.getString(PROGRESSBAR_TEXT, "");
selected_provider = savedInstanceState.getParcelable(Provider.KEY);
-
- if (fragment_manager.findFragmentByTag(ProviderDetailFragment.TAG) == null &&
- (SETTING_UP_PROVIDER.equals(mConfigState.getAction()) ||
- PENDING_SHOW_PROVIDER_DETAILS.equals(mConfigState.getAction()) ||
- PENDING_SHOW_FAILED_DIALOG.equals(mConfigState.getAction())
- )) {
- onItemSelectedUi();
- }
}
@Override
protected void onResume() {
super.onResume();
if (SETTING_UP_PROVIDER.equals(mConfigState.getAction())) {
- showProgressBar();
- adapter.hideAllBut(adapter.indexOf(selected_provider));
+ cancelAndShowAllProviders();
} else if (PENDING_SHOW_PROVIDER_DETAILS.equals(mConfigState.getAction())) {
showProviderDetails();
} else if (PENDING_SHOW_FAILED_DIALOG.equals(mConfigState.getAction())) {
@@ -396,15 +387,9 @@ public abstract class BaseConfigurationWizard extends AppCompatActivity
*
*/
public void showProviderDetails() {
- try {
- FragmentTransaction fragment_transaction = fragment_manager.removePreviousFragment(ProviderDetailFragment.TAG);
-
- DialogFragment newFragment = ProviderDetailFragment.newInstance();
- newFragment.show(fragment_transaction, ProviderDetailFragment.TAG);
- } catch (IllegalStateException e) {
- e.printStackTrace();
- mConfigState.setAction(PENDING_SHOW_PROVIDER_DETAILS);
- }
+ Intent intent = new Intent(this, ProviderDetailActivity.class);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
+ startActivity(intent);
}
@@ -428,32 +413,12 @@ public abstract class BaseConfigurationWizard extends AppCompatActivity
}
}
- @Override
public void cancelAndShowAllProviders() {
mConfigState.setAction(PROVIDER_NOT_SET);
selected_provider = null;
adapter.showAllProviders();
}
- @Override
- public void login() {
- mConfigState.setAction(PROVIDER_SET);
- Intent ask_login = new Intent();
- ask_login.putExtra(Provider.KEY, selected_provider);
- ask_login.putExtra(SessionDialog.TAG, SessionDialog.TAG);
- setResult(RESULT_OK, ask_login);
- finish();
- }
-
- @Override
- public void use_anonymously() {
- mConfigState.setAction(PROVIDER_SET);
- Intent pass_provider = new Intent();
- pass_provider.putExtra(Provider.KEY, selected_provider);
- setResult(RESULT_OK, pass_provider);
- finish();
- }
-
public class ProviderAPIBroadcastReceiver_Update extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
diff --git a/app/src/main/res/layout-xlarge/provider_detail_fragment.xml b/app/src/main/res/layout-xlarge/provider_detail_fragment.xml
index 4abbaa17..860f99d9 100644
--- a/app/src/main/res/layout-xlarge/provider_detail_fragment.xml
+++ b/app/src/main/res/layout-xlarge/provider_detail_fragment.xml
@@ -40,4 +40,9 @@
android:textStyle="normal"
android:textAppearance="?android:attr/textAppearanceSmall" />
+ <ListView
+ android:id="@+id/provider_detail_options"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/provider_detail_fragment.xml b/app/src/main/res/layout/provider_detail_fragment.xml
index 3b35bae7..3db32b2c 100644
--- a/app/src/main/res/layout/provider_detail_fragment.xml
+++ b/app/src/main/res/layout/provider_detail_fragment.xml
@@ -38,4 +38,9 @@
android:textStyle="normal"
android:textAppearance="?android:attr/textAppearanceSmall" />
+ <ListView
+ android:id="@+id/provider_detail_options"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index 11fe31a1..6355ce62 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -25,7 +25,7 @@
<string name="new_provider_uri">Dominio</string>
<string name="valid_url_entered">El dominio está bien formado</string>
<string name="not_valid_url_entered">Dominio no válido</string>
- <string name="provider_details_fragment_title">Detalles del proveedor</string>
+ <string name="provider_details_title">Detalles del proveedor</string>
<string name="use_anonymously_button">Utilizar sin registrarse</string>
<string name="username_hint">usuario</string>
<string name="username_ask">Por favor, introduce tu usuario</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 38e47f1d..22736245 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -23,7 +23,7 @@
<string name="new_provider_uri">Domain name</string>
<string name="valid_url_entered">It seems your URL is well formed</string>
<string name="not_valid_url_entered">It seems your URL is not well formed</string>
- <string name="provider_details_fragment_title">Provider details</string>
+ <string name="provider_details_title">Provider details</string>
<string name="use_anonymously_button">Use anonymously</string>
<string name="username_hint">username</string>
<string name="username_ask">Please enter your username</string>