android:name=".ui.LogActivity"
android:label="@string/log_title" >
</activity>
+ <activity
+ android:name=".ui.RemediationInstructionsActivity"
+ android:label="@string/remediation_instructions_title" >
+ </activity>
<activity
android:name=".ui.VpnProfileSelectActivity"
android:label="@string/strongswan_shortcut" >
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 Tobias Brunner
+ Hochschule fuer Technik Rapperswil
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item>
+ <shape>
+ <solid
+ android:color="@color/panel_separator" />
+ </shape>
+ </item>
+
+ <item android:left="2dp">
+ <shape>
+ <solid
+ android:color="@color/panel_background" />
+ </shape>
+ </item>
+
+</layer-list>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 Tobias Brunner
+ Hochschule fuer Technik Rapperswil
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:baselineAligned="false" >
+
+ <fragment
+ class="org.strongswan.android.ui.RemediationInstructionsFragment"
+ android:id="@+id/remediation_instructions_fragment"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:layout_width="0dp" />
+
+ <FrameLayout
+ android:layout_height="match_parent"
+ android:layout_weight="2"
+ android:layout_width="0dp"
+ android:background="@drawable/remediation_instruction_background_large"
+ android:padding="5dp" >
+
+ <fragment
+ class="org.strongswan.android.ui.RemediationInstructionFragment"
+ android:id="@+id/remediation_instruction_fragment"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" />
+
+ </FrameLayout>
+
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 Tobias Brunner
+ Hochschule fuer Technik Rapperswil
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/fragment_container">
+
+</FrameLayout>
\ No newline at end of file
<string name="imc_state_isolate">Eingeschränkt</string>
<string name="imc_state_block">Fehlgeschlagen</string>
+ <!-- Remediation instructions -->
+ <string name="remediation_instructions_title">Korrekturanweisungen</string>
+
<!-- Dialogs -->
<string name="login_title">Passwort eingeben um zu verbinden</string>
<string name="login_confirm">Verbinden</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
+ <!-- Remediation instructions -->
+ <string name="remediation_instructions_title">Remediation instructions</string>
+
<!-- Dialogs -->
<string name="login_title">Wprowadż hasło</string>
<string name="login_confirm">Połącz</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
+ <!-- Remediation instructions -->
+ <string name="remediation_instructions_title">Remediation instructions</string>
+
<!-- Dialogs -->
<string name="login_title">Введите пароль для соединения</string>
<string name="login_confirm">Соединить</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
+ <!-- Remediation instructions -->
+ <string name="remediation_instructions_title">Remediation instructions</string>
+
<!-- Dialogs -->
<string name="login_title">Введіть пароль для з\'єднання</string>
<string name="login_confirm">Підключити</string>
<string name="imc_state_isolate">Restricted</string>
<string name="imc_state_block">Failed</string>
+ <!-- Remediation instructions -->
+ <string name="remediation_instructions_title">Remediation instructions</string>
+
<!-- Dialogs -->
<string name="login_title">Enter password to connect</string>
<string name="login_confirm">Connect</string>
--- /dev/null
+/*
+ * Copyright (C) 2013 Tobias Brunner
+ * Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+package org.strongswan.android.ui;
+
+import java.util.ArrayList;
+
+import org.strongswan.android.R;
+import org.strongswan.android.logic.imc.RemediationInstruction;
+import org.strongswan.android.ui.RemediationInstructionsFragment.OnRemediationInstructionSelectedListener;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.MenuItem;
+
+public class RemediationInstructionsActivity extends Activity implements OnRemediationInstructionSelectedListener
+{
+ @Override
+ protected void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.remediation_instructions);
+ getActionBar().setDisplayHomeAsUpEnabled(true);
+
+ if (savedInstanceState != null)
+ { /* only update if we're not restoring */
+ return;
+ }
+ RemediationInstructionsFragment frag = (RemediationInstructionsFragment)getFragmentManager().findFragmentById(R.id.remediation_instructions_fragment);
+ if (frag != null)
+ { /* two-pane layout, update fragment */
+ Bundle extras = getIntent().getExtras();
+ ArrayList<RemediationInstruction> list = extras.getParcelableArrayList(RemediationInstructionsFragment.EXTRA_REMEDIATION_INSTRUCTIONS);
+ frag.updateView(list);
+ }
+ else
+ { /* one-pane layout, create fragment */
+ frag = new RemediationInstructionsFragment();
+ frag.setArguments(getIntent().getExtras());
+ getFragmentManager().beginTransaction().add(R.id.fragment_container, frag).commit();
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ switch (item.getItemId())
+ {
+ case android.R.id.home:
+ /* one-pane layout, pop possible fragment from stack, finish otherwise */
+ if (!getFragmentManager().popBackStackImmediate())
+ {
+ finish();
+ }
+ getActionBar().setTitle(getTitle());
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+ @Override
+ public void onRemediationInstructionSelected(RemediationInstruction instruction)
+ {
+ RemediationInstructionFragment frag = (RemediationInstructionFragment)getFragmentManager().findFragmentById(R.id.remediation_instruction_fragment);
+
+ if (frag != null)
+ { /* two-pane layout, update directly */
+ frag.updateView(instruction);
+ }
+ else
+ { /* one-pane layout, replace fragment */
+ frag = new RemediationInstructionFragment();
+ Bundle args = new Bundle();
+ args.putParcelable(RemediationInstructionFragment.ARG_REMEDIATION_INSTRUCTION, instruction);
+ frag.setArguments(args);
+
+ getFragmentManager().beginTransaction().replace(R.id.fragment_container, frag).addToBackStack(null).commit();
+ getActionBar().setTitle(instruction.getTitle());
+ }
+ }
+}
import java.util.ArrayList;
+import org.strongswan.android.R;
import org.strongswan.android.logic.imc.RemediationInstruction;
import org.strongswan.android.ui.adapter.RemediationInstructionAdapter;
{
super.onStart();
- boolean two_pane = false;
+ boolean two_pane = getFragmentManager().findFragmentById(R.id.remediation_instruction_fragment) != null;
if (two_pane)
{ /* two-pane layout, make list items selectable */
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);