Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit 9b539ac

Browse files
committed
Moved to Android Studio from Eclipse
1 parent 7748b6b commit 9b539ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+664
-200
lines changed

.classpath

Lines changed: 0 additions & 9 deletions
This file was deleted.

.gitignore

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,46 @@
1-
# Local configuration file (sdk path, etc)
2-
local.properties
3-
/.settings/
4-
51
# Built application files
62
*.apk
73
*.ap_
84

9-
# Files for the Dalvik VM
5+
# Files for the ART/Dalvik VM
106
*.dex
117

128
# Java class files
139
*.class
1410

1511
# Generated files
16-
bin/
1712
gen/
18-
obj/
13+
out/
1914

2015
# Gradle files
2116
.gradle/
2217
build/
18+
release/
2319

2420
# Local configuration file (sdk path, etc)
2521
local.properties
2622

2723
# Proguard folder generated by Eclipse
2824
proguard/
25+
26+
# Log Files
27+
*.log
28+
29+
# Android Studio Navigation editor temp files
30+
.navigation/
31+
32+
# Android Studio captures folder
33+
captures/
34+
35+
# Intellij
36+
*.iml
37+
.idea/
38+
39+
# Keystore files
40+
*.jks
41+
42+
# Mac OS X clutter
43+
*.DS_Store
44+
45+
# Windows clutter
46+
Thumbs.db

.project

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
wShell
22
======
33

4-
Copyright (C) 2014 Anton Skshidlevsky
5-
6-
Licensed under the [GPL version 3](http://www.gnu.org/licenses/) or later.
4+
Copyright (C) 2014-2018 Anton Skshidlevsky, [GPLv3](http://opensource.org/licenses/gpl-3.0.html)
75

86
Web-based terminal emulator for Android. Based on [Shell In A Box](http://code.google.com/p/shellinabox/).
97

10-
#### Source code ####
11-
Source code: <https://github.com/meefik/wshell>. This source code are written with use Android SDK and Eclipse ADT plugin.
8+
#### Install
9+
10+
You can install the app from:
11+
* GitHub: <https://github.com/meefik/wshell/releases>
12+
* Google Play: <https://play.google.com/store/apps/details?id=ru.meefik.wshell>
13+
14+
#### Source code
15+
16+
wShell: <https://github.com/meefik/wshell>
17+
18+
#### Donations
19+
20+
E-Money: <http://meefik.github.io/donate>
1221

13-
#### Donation ####
14-
<http://meefik.github.io/donate.html>
22+
Google Play: <https://play.google.com/store/apps/details?id=ru.meefik.donate>
1523

app/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 25
5+
buildToolsVersion '27.0.2'
6+
7+
defaultConfig {
8+
applicationId 'ru.meefik.wshell'
9+
minSdkVersion 9
10+
targetSdkVersion 25
11+
versionCode 10
12+
versionName '1.1.0'
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
compile 'com.android.support:appcompat-v7:25.4.0'
25+
compile 'com.android.support:design:25.4.0'
26+
}

AndroidManifest.xml renamed to app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,30 @@
1414
android:allowBackup="true"
1515
android:icon="@drawable/ic_launcher"
1616
android:label="@string/app_name"
17-
android:theme="@style/AppTheme" >
17+
android:theme="@style/DarkTheme" >
1818
<activity
1919
android:name="ru.meefik.wshell.MainActivity"
2020
android:label="@string/app_name" >
2121
<intent-filter>
2222
<action android:name="android.intent.action.MAIN" />
23-
2423
<category android:name="android.intent.category.LAUNCHER" />
2524
</intent-filter>
2625
</activity>
2726
<activity
2827
android:name="ru.meefik.wshell.SettingsActivity"
29-
android:label="@string/title_activity_settings" >
28+
android:label="@string/title_activity_settings"
29+
android:parentActivityName=".MainActivity">
30+
<meta-data
31+
android:name="android.support.PARENT_ACTIVITY"
32+
android:value=".MainActivity" />
3033
</activity>
3134
<activity
3235
android:name="ru.meefik.wshell.AboutActivity"
33-
android:label="@string/title_activity_about" >
36+
android:label="@string/title_activity_about"
37+
android:parentActivityName=".MainActivity">
38+
<meta-data
39+
android:name="android.support.PARENT_ACTIVITY"
40+
android:value=".MainActivity" />
3441
</activity>
3542
</application>
3643

File renamed without changes.
File renamed without changes.

src/ru/meefik/wshell/AboutActivity.java renamed to app/src/main/java/ru/meefik/wshell/AboutActivity.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
package ru.meefik.wshell;
22

3-
import android.app.Activity;
43
import android.content.Intent;
54
import android.net.Uri;
65
import android.os.Bundle;
6+
import android.support.v7.app.AppCompatActivity;
77
import android.text.method.LinkMovementMethod;
88
import android.view.Menu;
99
import android.view.MenuItem;
1010
import android.widget.TextView;
1111

12-
public class AboutActivity extends Activity {
12+
public class AboutActivity extends AppCompatActivity {
1313

1414
@Override
1515
public void onCreate(Bundle savedInstanceState) {
1616
super.onCreate(savedInstanceState);
1717
setContentView(R.layout.activity_about);
18-
getActionBar().setDisplayHomeAsUpEnabled(true);
1918
TextView tv = (TextView) findViewById(R.id.aboutTextView);
2019
tv.setMovementMethod(LinkMovementMethod.getInstance());
2120
}
2221

2322
@Override
2423
public boolean onCreateOptionsMenu(Menu menu) {
25-
getMenuInflater().inflate(R.menu.about, menu);
24+
getMenuInflater().inflate(R.menu.activity_about, menu);
2625
return true;
2726
}
2827

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
/*
2+
* Copyright (C) 2014 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package ru.meefik.wshell;
17+
18+
import android.content.res.Configuration;
19+
import android.os.Bundle;
20+
import android.preference.PreferenceActivity;
21+
import android.support.annotation.LayoutRes;
22+
import android.support.annotation.Nullable;
23+
import android.support.v4.app.NavUtils;
24+
import android.support.v7.app.ActionBar;
25+
import android.support.v7.app.AppCompatDelegate;
26+
import android.support.v7.widget.Toolbar;
27+
import android.view.MenuInflater;
28+
import android.view.MenuItem;
29+
import android.view.View;
30+
import android.view.ViewGroup;
31+
32+
/**
33+
* A {@link PreferenceActivity} which implements and proxies the necessary calls
34+
* to be used with AppCompat.
35+
* <p/>
36+
* This technique can be used with an {@link android.app.Activity} class, not just
37+
* {@link PreferenceActivity}.
38+
*/
39+
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
40+
private AppCompatDelegate mDelegate;
41+
42+
@Override
43+
protected void onCreate(Bundle savedInstanceState) {
44+
getDelegate().installViewFactory();
45+
getDelegate().onCreate(savedInstanceState);
46+
super.onCreate(savedInstanceState);
47+
}
48+
49+
@Override
50+
protected void onPostCreate(Bundle savedInstanceState) {
51+
super.onPostCreate(savedInstanceState);
52+
getDelegate().onPostCreate(savedInstanceState);
53+
}
54+
55+
public ActionBar getSupportActionBar() {
56+
return getDelegate().getSupportActionBar();
57+
}
58+
59+
public void setSupportActionBar(@Nullable Toolbar toolbar) {
60+
getDelegate().setSupportActionBar(toolbar);
61+
}
62+
63+
@Override
64+
public MenuInflater getMenuInflater() {
65+
return getDelegate().getMenuInflater();
66+
}
67+
68+
@Override
69+
public void setContentView(@LayoutRes int layoutResID) {
70+
getDelegate().setContentView(layoutResID);
71+
}
72+
73+
@Override
74+
public void setContentView(View view) {
75+
getDelegate().setContentView(view);
76+
}
77+
78+
@Override
79+
public void setContentView(View view, ViewGroup.LayoutParams params) {
80+
getDelegate().setContentView(view, params);
81+
}
82+
83+
@Override
84+
public void addContentView(View view, ViewGroup.LayoutParams params) {
85+
getDelegate().addContentView(view, params);
86+
}
87+
88+
@Override
89+
protected void onPostResume() {
90+
super.onPostResume();
91+
getDelegate().onPostResume();
92+
}
93+
94+
@Override
95+
protected void onTitleChanged(CharSequence title, int color) {
96+
super.onTitleChanged(title, color);
97+
getDelegate().setTitle(title);
98+
}
99+
100+
@Override
101+
public void onConfigurationChanged(Configuration newConfig) {
102+
super.onConfigurationChanged(newConfig);
103+
getDelegate().onConfigurationChanged(newConfig);
104+
}
105+
106+
@Override
107+
protected void onStop() {
108+
super.onStop();
109+
getDelegate().onStop();
110+
}
111+
112+
@Override
113+
protected void onDestroy() {
114+
super.onDestroy();
115+
getDelegate().onDestroy();
116+
}
117+
118+
@Override
119+
public boolean onOptionsItemSelected(MenuItem item) {
120+
switch (item.getItemId()) {
121+
case android.R.id.home:
122+
NavUtils.navigateUpFromSameTask(this);
123+
return true;
124+
}
125+
return super.onOptionsItemSelected(item);
126+
}
127+
128+
@Override
129+
public void invalidateOptionsMenu() {
130+
getDelegate().invalidateOptionsMenu();
131+
}
132+
133+
private AppCompatDelegate getDelegate() {
134+
if (mDelegate == null) {
135+
mDelegate = AppCompatDelegate.create(this, null);
136+
}
137+
return mDelegate;
138+
}
139+
}

0 commit comments

Comments
 (0)