Skip to content

Commit

Permalink
Merge pull request vx#130 from jklein24/nointro
Browse files Browse the repository at this point in the history
Remove the welcome wizard activity and add the EULA to the help screen.
  • Loading branch information
kruton committed Aug 14, 2015
2 parents 7de5ce1 + b0a0047 commit a043260
Show file tree
Hide file tree
Showing 15 changed files with 149 additions and 297 deletions.
6 changes: 5 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@
<activity android:name=".HostEditorActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".PortForwardListActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".SettingsActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".WizardActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".HelpActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".HelpTopicActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".ColorsActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name=".EulaActivity" android:parentActivityName=".HelpActivity"
android:configChanges="keyboardHidden|orientation" >
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="org.connectbot.HelpActivity" />
</activity>

<service android:name="org.connectbot.service.TerminalManager"
android:configChanges="keyboardHidden|orientation"
Expand Down
34 changes: 34 additions & 0 deletions app/src/main/java/org/connectbot/EulaActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* ConnectBot: simple, powerful, open-source SSH client for Android
* Copyright 2015 Kenny Root, Jeffrey Sharkey
*
* 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.
*/

package org.connectbot;

import android.app.Activity;
import android.os.Bundle;

public class EulaActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_eula);

this.setTitle(String.format("%s: %s",
getResources().getText(R.string.app_name),
getResources().getText(R.string.terms_and_conditions)));
}
}
13 changes: 13 additions & 0 deletions app/src/main/java/org/connectbot/HelpActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,18 @@ public void onClick(View v) {
// TODO Auto-generated catch block
Log.e(TAG, "couldn't get list of help assets", e);
}

Button button = new Button(this);
final String topic = getResources().getString(R.string.terms_and_conditions);
button.setText(topic);

button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(HelpActivity.this, EulaActivity.class);
HelpActivity.this.startActivity(intent);
}
});

content.addView(button);
}
}
21 changes: 1 addition & 20 deletions app/src/main/java/org/connectbot/HostListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.connectbot.util.HostDatabase;
import org.connectbot.util.PreferenceConstants;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.ComponentName;
Expand Down Expand Up @@ -70,8 +69,6 @@ public class HostListActivity extends ListActivity {

public final static int REQUEST_EDIT = 1;

public final static int REQUEST_EULA = 2;

protected TerminalManager bound = null;

protected HostDatabase hostdb;
Expand Down Expand Up @@ -175,17 +172,7 @@ protected void onNewIntent(Intent intent) {

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_EULA) {
if (resultCode == Activity.RESULT_OK) {
// yay they agreed, so store that info
Editor edit = prefs.edit();
edit.putBoolean(PreferenceConstants.EULA, true);
edit.commit();
} else {
// user didnt agree, so close
this.finish();
}
} else if (requestCode == REQUEST_EDIT) {
if (requestCode == REQUEST_EDIT) {
this.updateList();
}
}
Expand Down Expand Up @@ -224,12 +211,6 @@ public void onCreate(Bundle icicle) {
}
}

// check for eula agreement
boolean agreed = prefs.getBoolean(PreferenceConstants.EULA, false);
if (!agreed) {
this.startActivityForResult(new Intent(this, WizardActivity.class), REQUEST_EULA);
}

this.makingShortcut = Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())
|| Intent.ACTION_PICK.equals(getIntent().getAction());

Expand Down
7 changes: 0 additions & 7 deletions app/src/main/java/org/connectbot/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.connectbot;

import org.connectbot.util.PreferenceConstants;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceActivity;
Expand All @@ -45,11 +43,6 @@ protected void onCreate(Bundle savedInstanceState) {

PreferenceManager.setDefaultValues(this, R.xml.preferences, true);

// Since they were able to get to the Settings activity, they already agreed to the EULA
editor = preferences.edit();
editor.putBoolean(PreferenceConstants.EULA, true);
editor.commit();

addPreferencesFromResource(R.xml.preferences);
}

Expand Down
104 changes: 0 additions & 104 deletions app/src/main/java/org/connectbot/WizardActivity.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public class PreferenceConstants {

public static final String BUMPY_ARROWS = "bumpyarrows";

public static final String EULA = "eula";

public static final String SORT_BY_COLOR = "sortByColor";

public static final String BELL = "bell";
Expand Down
Binary file removed app/src/main/res/drawable/ic_btn_back.png
Binary file not shown.
Binary file removed app/src/main/res/drawable/ic_btn_next.png
Binary file not shown.
92 changes: 92 additions & 0 deletions app/src/main/res/layout/act_eula.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!--
~ ConnectBot: simple, powerful, open-source SSH client for Android
~ Copyright 2015 Kenny Root, Jeffrey Sharkey
~
~ 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.
-->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.connectbot.EulaActivity">

<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
>

<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="ConnectBot is a simple, powerful, open-source Secure Shell (SSH) client for your Android device."
android:textAppearance="?android:attr/textAppearanceMedium"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dip"
android:text="It can manage several SSH sessions, create secure tunnels, and copy/paste between other apps."
android:textAppearance="?android:attr/textAppearanceMedium"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dip"
android:autoLink="web"
android:text="@string/copyright_info"
android:textAppearance="?android:attr/textAppearanceSmall"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dip"
android:text="About and Credits"
android:textAppearance="?android:attr/textAppearanceMedium"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dip"
android:autoLink="web"
android:text="Copyright \u00a9 2007-2008 Kenny Root http://the-b.org, Jeffrey Sharkey http://jsharkey.org\n\nBased in part on the Trilead SSH2 client, provided under a BSD-style license. Copyright \u00a9 2007 Trilead AG. http://www.trilead.com\n\nAlso based on JTA Telnet/SSH client, provided under the GPLv2 license. Copyright \u00a9 Matthias L. Jugel, Marcus Meiner 1996-2005. http://www.javassh.org\n\nAlso based in part on the JSOCKS library, provided under the GNU LGPL license. http://jsocks.sourceforge.net\n\nAlso based in part on JZlib provided under a BSD-style license. Copyright \u00a9 JCraft, Inc., 2000-2004 http://www.jcraft.com"
android:textSize="14sp"
android:textColor="#bebebe"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dip"
android:text="@string/msg_version"
android:textAppearance="?android:attr/textAppearanceSmall"
/>

</LinearLayout>

</ScrollView>

</RelativeLayout>
Loading

0 comments on commit a043260

Please sign in to comment.