Started with Disroot app

This commit is contained in:
Massimiliano Lentini 2018-09-02 19:00:45 +02:00
parent 9503ef7087
commit b749305276
58 changed files with 1586 additions and 0 deletions

56
.gitignore vendored Normal file
View File

@ -0,0 +1,56 @@
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/gradle.xml
*.iml
# Fucking crashlytics strings
app/src/main/res/values/com_crashlytics_export_strings.xml
app/src/main/assets/crashlytics-build.properties
app/app.iml

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WizardSettings">
<option name="children">
<map>
<entry key="vectorWizard">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="vectorAssetStep">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="assetSourceType" value="FILE" />
<entry key="outputName" value="ic_home" />
<entry key="sourceFile" value="$PROJECT_DIR$/../home.svg" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</component>
</project>

Binary file not shown.

View File

@ -0,0 +1,29 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

165
LICENCE.txt Normal file
View File

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

18
README.md Normal file
View File

@ -0,0 +1,18 @@
<h1>Disroot app </h1>
This app is a webapp for the site siroot.org.
<i>Link to source:<br />
...
<br/>
Link to APK:<br/>
...</i>
Licence GPLv3 (see licence on source above)
Requiriments:
Android 4.1 or +
4 MB free on Smartphone
<h3>Developed by Massimiliano:</h3>

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

36
app/build.gradle Normal file
View File

@ -0,0 +1,36 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "org.disroot.disrootapp"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "0.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
// Processors
def anpros = ['com.jakewharton:butterknife-compiler:8.8.1']
}

21
app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,13 @@
package org.disroot.disrootapp.ui;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.webview">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_disroot"
android:label="@string/app_name"
android:theme="@style/DisTheme">
<activity
android:name="org.disroot.disrootapp.ui.SplashScreenActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="org.disroot.disrootapp.ui.MainActivity"
android:configChanges="orientation|screenSize"
android:hardwareAccelerated="true"
android:label="@string/app_name" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
body {
background-color: #123456;
}
#all-links {
position: relative;
width: 600;
top: 25%;
left: 25%;
}
.img-link {
height: 200px;
width: 200px;
}
.link {
color: #fff;
font-family: "Monospace";
font-size: 1.3em;
text-decoration:none;
margin: 40px;
}
.link-text {
padding: 20px;
padding-top: 2%;
}

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body {
background-color: #123456;
background: url("bgimage.jpg")
}
#wrapper {
width: 400px;
margin-left: auto;
margin-right: auto;
margin-top: 100px;
}
#logo {
background: url("logo.png") no-repeat;
background-size: auto 45px;
height: 45px;
margin-top: 20px;
margin-left: 15%;
}
#all-links {
width: 100%;
}
.img-link {
height: 100px;
width: 100px;
display: inline-block;
}
.link {
color: #fff;
font-family: "Source-Sans-Pro",sans-serif;
font-size: 0.7em;
text-decoration:none;
}
.link:hover {
color: #a33;
}
#all-links {
position: relative;
width: 120;
top: 5%;
left: 5%;
}
.img-link {
height: 50px;
width: 50px;
}
.link {
color: #fff;
font-family: "Monospace";
font-size: 1.3em;
text-decoration:none;
margin: 40px;
}
.link-text {
padding: 20px;
padding-top: 2%;
}
</style>
<link rel="stylesheet" href="css/font-awesome.min.css">
<title>Disroot's Dashboard</title>
</head>
<body>
<div id="logo">
</div>
<div id="wrapper">
<div id="all-links">
<a class="link" href="https://mail.disroot.org" target=_blank>
<div id="link-to-mail" class="img-link">
<i class="fa fa-envelope fa-5x" aria-hidden="true"></i>
<p class="link-text"> E-MAIL </p>
</div>
</a>
<a class="link" href="https://cloud.disroot.org" target=_blank>
<div id="link-to-cloud" class="img-link">
<i class="fa fa-cloud fa-5x" aria-hidden="true"></i>
<p class="link-text"> CLOUD </p>
</div>
</a>
<a class="link" href="https://pod.disroot.org" target=_blank>
<div id="link-to-pod" class="img-link">
<i class="fa fa-asterisk fa-5x" aria-hidden="true"></i>
<p class="link-text"> DIASPORA* </p>
</div>
</a>
<a class="link" href="https://forum.disroot.org" target=_blank>
<div id="link-to-forum" class="img-link">
<i class="fa fa-stack-exchange fa-5x" aria-hidden="true"></i>
<p class="link-text"> FORUM </p>
</div>
</a>
<a class="link" href="xmpp:disroot@chat.disroot.org?join" target=_blank>
<div id="link-to-chat" class="img-link">
<i class="fa fa-comments fa-5x" aria-hidden="true"></i>
<p class="link-text"> Chat </p>
</div>
</a>
<a class="link" href="https://pad.disroot.org" target=_blank>
<div id="link-to-pad" class="img-link">
<i class="fa fa-file-text fa-5x" aria-hidden="true"></i>
<p class="link-text"> ETHERPAD </p>
</div>
</a>
<a class="link" href="https://calc.disroot.org" target=_blank>
<div id="link-to-calc" class="img-link">
<i class="fa fa-calculator fa-5x" aria-hidden="true"></i>
<p class="link-text"> ETHERCALC </p>
</div>
</a>
<a class="link" href="https://bin.disroot.org" target=_blank>
<div id="link-to-bin" class="img-link">
<i class="fa fa-calendar-o fa-5x" aria-hidden="true"></i>
<p class="link-text"> ZEROBIN </p>
</div>
</a>
<a class="link" href="https://upload.disroot.org" target=_blank>
<div id="link-to-upload" class="img-link">
<i class="fa fa-paper-plane fa-5x" aria-hidden="true"></i>
<p class="link-text"> UPLOAD </p>
</div>
</a>
<a class="link" href="https://search.disroot.org" target=_blank>
<div id="link-to-search" class="img-link">
<i class="fa fa-search fa-5x" aria-hidden="true"></i>
<p class="link-text"> SEARX </p>
</div>
</a>
<a class="link" href="https://poll.disroot.org" target=_blank>
<div id="link-to-poll" class="img-link">
<i class="fa fa-check-square fa-5x" aria-hidden="true"></i>
<p class="link-text"> POLLS </p>
</div>
</a>
<a class="link" href="https://board.disroot.org" target=_blank>
<div id="link-to-board" class="img-link">
<i class="fa fa-th fa-5x" aria-hidden="true"></i>
<p class="link-text"> TAIGA </p>
</div>
</a>
<a class="link" href="https://user.disroot.org" target=_blank>
<div id="link-to-user" class="img-link">
<i class="fa fa-user fa-5x" aria-hidden="true"></i>
<p class="link-text"> PASSWORD </p>
</div>
</a>
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
app/src/main/ic_dio-web.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -0,0 +1,241 @@
package org.disroot.disrootapp.ui;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.webview.R;
import org.disroot.disrootapp.utils.Constants;
import org.disroot.disrootapp.utils.DeviceProvider;
import org.disroot.disrootapp.webviews.DisWebChromeClient;
import org.disroot.disrootapp.webviews.DisWebViewClient;
import java.lang.reflect.Method;
public class MainActivity extends AppCompatActivity implements View.OnLongClickListener {
private static final String TAG = MainActivity.class.getSimpleName();
private WebView webView;
private DisWebChromeClient disWebChromeClient;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setupToolbar();
FrameLayout frameLayoutContainer = (FrameLayout) findViewById(R.id.framelayout_container);
ViewGroup viewLoading = (ViewGroup) findViewById(R.id.linearlayout_view_loading_container);
setupWebView(savedInstanceState, frameLayoutContainer, viewLoading);
// enables the activity icon as a 'home' button. required if "android:targetSdkVersion" > 14
//getActionBar().setHomeButtonEnabled(true);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
webView.saveState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
webView.restoreState(savedInstanceState);
}
@Override
protected void onPause() {
super.onPause();
webView.onPause();
}
@Override
protected void onResume() {
super.onResume();
webView.onResume();
}
@Override
protected void onStop() {
super.onStop();
disWebChromeClient.hideCustomView();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (disWebChromeClient.hideCustomView()) {
return true;
} else if (!disWebChromeClient.hideCustomView() && webView.canGoBack()) {
webView.goBack();
return true;
}
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu items for use in the action bar
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_main, menu);
// To show icons in the actionbar's overflow menu:
// http://stackoverflow.com/questions/18374183/how-to-show-icons-in-overflow-menu-in-actionbar
//if(featureId == Window.FEATURE_ACTION_BAR && menu != null){
if(menu.getClass().getSimpleName().equals("MenuBuilder")){
try{
Method m = menu.getClass().getDeclaredMethod(
"setOptionalIconsVisible", Boolean.TYPE);
m.setAccessible(true);
m.invoke(menu, true);
}
catch(NoSuchMethodException e){
Log.e(TAG, "onMenuOpened", e);
}
catch(Exception e){
throw new RuntimeException(e);
}
}
//}
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_share:
shareCurrentPage();
return true;
case R.id.action_home:
webView.loadUrl(Constants.URL_DisApp_MAIN_PAGE);
return true;
case R.id.action_mail:
String k9 = "com.fsck.k9";
Intent mail = getPackageManager().getLaunchIntentForPackage(k9);
if(mail == null) {
mail = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+k9));
}
startActivity(mail);
return true;
case R.id.action_cloud:
String nc = "com.nextcloud.client";
Intent cloud = getPackageManager().getLaunchIntentForPackage(nc);
if(cloud == null) {
cloud = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+nc));
}
startActivity(cloud);
return true;
case R.id.action_diaspora:
String Diaspora = "com.github.dfa.diaspora_android";
Intent pod = getPackageManager().getLaunchIntentForPackage(Diaspora);
if(pod == null) {
pod = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id="+Diaspora));
}
startActivity(pod);
return true;
case R.id.action_forum:
webView.loadUrl(Constants.URL_DisApp_FORUM);
return true;
case R.id.action_chat:
Intent xmpp = new Intent(Intent.ACTION_MAIN);
PackageManager conversations = getPackageManager();
xmpp = conversations.getLaunchIntentForPackage("eu.siacs.conversations");
xmpp.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(xmpp);
return true;
case R.id.action_pad:
webView.loadUrl(Constants.URL_DisApp_PAD);
return true;
case R.id.action_calc:
webView.loadUrl(Constants.URL_DisApp_CALC);
return true;
case R.id.action_bin:
webView.loadUrl(Constants.URL_DisApp_BIN);
return true;
case R.id.action_upload:
webView.loadUrl(Constants.URL_DisApp_UPLOAD);
return true;
case R.id.action_searx:
webView.loadUrl(Constants.URL_DisApp_SEARX);
return true;
case R.id.action_poll:
webView.loadUrl(Constants.URL_DisApp_POLL);
return true;
case R.id.action_board:
webView.loadUrl(Constants.URL_DisApp_BOARD);
return true;
case R.id.action_user:
webView.loadUrl(Constants.URL_DisApp_USER);
return true;
case R.id.action_about:
showAppInfo();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
public void setupToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
((TextView) toolbar.findViewById(R.id.textview_toolbar_title)).setText(R.string.app_name);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null)
actionBar.setTitle("");
}
private void setupWebView(Bundle savedInstanceState, FrameLayout customViewContainer, ViewGroup viewLoading) {
disWebChromeClient = new DisWebChromeClient(this, webView, customViewContainer);
webView = (WebView) findViewById(R.id.webView_content);
webView.setWebViewClient(new DisWebViewClient(savedInstanceState, viewLoading));
webView.setWebChromeClient(disWebChromeClient);
webView.getSettings().setJavaScriptEnabled(true);
webView.setVerticalScrollBarEnabled(false);
webView.getSettings().setAppCacheEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setSaveFormData(true);
webView.loadUrl(Constants.URL_DisApp_MAIN_PAGE);
webView.setOnLongClickListener(this);
}
public void shareCurrentPage() {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, webView.getUrl());
intent.setType("text/plain");
startActivity(intent);
}
private void showAppInfo() {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle(R.string.app_name);
builder.setMessage(getString(R.string.activity_main_manteiners, DeviceProvider.getAppVersion(this)));
builder.setPositiveButton(R.string.global_ok, null);
builder.show();
}
@Override
public boolean onLongClick(View view) {
Toast.makeText(view.getContext(), R.string.activity_main_share_info, Toast.LENGTH_LONG).show();
return false;
}
}

View File

@ -0,0 +1,37 @@
package org.disroot.disrootapp.ui;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import com.example.webview.R;
import org.disroot.disrootapp.utils.Constants;
public class SplashScreenActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
if (getSupportActionBar() != null)
getSupportActionBar().hide();
getSplashScreenCountDownTimer().start();
}
private CountDownTimer getSplashScreenCountDownTimer() {
return new CountDownTimer(Constants.SPLASH_SCREEN_DURATION, Constants.SPLASH_SCREEN_INTERVAL) {
@Override
public void onTick(long l) {
}
@Override
public void onFinish() {
Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
};
}
}

View File

@ -0,0 +1,24 @@
package org.disroot.disrootapp.utils;
/**
* Created by jackson on 02/11/15.
*/
public class Constants {
public static final long SPLASH_SCREEN_DURATION = 3000;
public static final long SPLASH_SCREEN_INTERVAL = 1000;
public static final String URL_DisApp_MAIN_PAGE = "file:///android_asset/index.html";
public static final String URL_DisApp_MAIL = "https://mail.disroot.org";
public static final String URL_DisApp_CLOUD = "https://cloud.disroot.org";
public static final String URL_DisApp_DIASPORA = "https://pod.disroot.org/";
public static final String URL_DisApp_FORUM = "https://forum.disroot.org/";
public static final String URL_DisApp_CHAT = "http://chat.disroot.org";
public static final String URL_DisApp_PAD = "http://pad.disroot.org";
public static final String URL_DisApp_CALC = "http://calc.disroot.org";
public static final String URL_DisApp_BIN = "http://bin.disroot.org";
public static final String URL_DisApp_UPLOAD = "http://upload.disroot.org";
public static final String URL_DisApp_SEARX = "http://search.disroot.org";
public static final String URL_DisApp_POLL = "http://poll.disroot.org";
public static final String URL_DisApp_BOARD = "http://board.disroot.org";
public static final String URL_DisApp_USER = "http://user.disroot.org";
}

View File

@ -0,0 +1,21 @@
package org.disroot.disrootapp.utils;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
/**
* Created by jackson on 02/11/15.
*/
public class DeviceProvider {
public static String getAppVersion(Context context) {
try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
return packageInfo.versionName;
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -0,0 +1,83 @@
package org.disroot.disrootapp.webviews;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.FrameLayout;
import com.example.webview.R;
/**
* Created by jackson on 02/11/15.
*/
public class DisWebChromeClient extends WebChromeClient {
private final WebView webView;
private final FrameLayout frameLayoutContainer;
private final Context context;
private ViewGroup viewLoading;
private View viewCustom;
private CustomViewCallback customViewCallback;
public DisWebChromeClient(Context context, WebView webView, FrameLayout frameLayoutContainer) {
this.context = context;
this.webView = webView;
this.frameLayoutContainer = frameLayoutContainer;
}
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
if (viewCustom == null) {
viewCustom = view;
webView.setVisibility(View.GONE);
frameLayoutContainer.setVisibility(View.VISIBLE);
frameLayoutContainer.addView(view);
customViewCallback = callback;
} else {
callback.onCustomViewHidden();
}
}
@Override
public View getVideoLoadingProgressView() {
if (viewLoading == null) {
LayoutInflater inflater = LayoutInflater.from(context);
viewLoading = (ViewGroup) inflater.inflate(R.layout.view_loading, null);
viewLoading.findViewById(R.id.textview_loading_description).setVisibility(View.VISIBLE);
}
return viewLoading;
}
@Override
public void onHideCustomView() {
super.onHideCustomView();
if (viewCustom != null) {
setWebViewVisible();
removeCustomViewFromParent();
}
}
private void setWebViewVisible() {
webView.setVisibility(View.VISIBLE);
frameLayoutContainer.setVisibility(View.GONE);
viewCustom.setVisibility(View.GONE);
}
private void removeCustomViewFromParent() {
frameLayoutContainer.removeView(viewCustom);
customViewCallback.onCustomViewHidden();
viewCustom = null;
}
public boolean hideCustomView() {
if (viewCustom == null) {
return false;
} else {
onHideCustomView();
return true;
}
}
}

View File

@ -0,0 +1,49 @@
package org.disroot.disrootapp.webviews;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
/**
* Created by jackson on 02/11/15.
*/
public class DisWebViewClient extends WebViewClient {
private final Bundle savedInstanceState;
private final ViewGroup viewLoading;
private boolean isViewLoadingNotStarted = true;
public DisWebViewClient(Bundle savedInstanceState, ViewGroup viewLoading) {
this.savedInstanceState = savedInstanceState;
this.viewLoading = viewLoading;
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (savedInstanceState == null)
view.loadUrl(url);
return super.shouldOverrideUrlLoading(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
if (isViewLoadingNotStarted) {
viewLoading.setVisibility(View.VISIBLE);
isViewLoadingNotStarted = false;
}
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if (!isViewLoadingNotStarted) {
viewLoading.setVisibility(View.INVISIBLE);
isViewLoadingNotStarted = true;
}
view.setVisibility(View.VISIBLE);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/item_toolbar" />
<FrameLayout
android:id="@+id/framelayout_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/webView_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible" />
<include layout="@layout/view_loading"/>
</FrameLayout>
</LinearLayout>

View File

@ -0,0 +1,13 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bg_primary_blue">
<ImageView
android:id="@+id/imageView"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/logodisroot" />
</RelativeLayout>

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/bg_primary_blue"
android:elevation="8dp"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.MyApp.ActionBar">
<TextView
android:id="@+id/textview_toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="20sp" />
</android.support.v7.widget.Toolbar>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayout_view_loading_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ProgressBar
android:id="@+id/progressbar_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/textview_loading_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="8dp"
android:text="@string/view_loading_description"
android:textColor="?android:attr/textColorPrimary"
android:visibility="gone" />
</LinearLayout>

View File

@ -0,0 +1,63 @@
<menu 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"
tools:context=".MainActivity">
<item
android:id="@+id/action_share"
android:orderInCategory="1"
android:title="@string/action_share"
android:icon="@drawable/ic_share_white_24dp"
app:showAsAction="always" />
<group
android:orderInCategory="101"
android:showAsAction="always">
<item
android:icon="@drawable/ic_home"
android:id="@+id/action_home"
android:title="@string/action_home"/>
<item
android:id="@+id/action_mail"
android:title="@string/action_mail" />
<item
android:id="@+id/action_cloud"
android:title="@string/action_cloud" />
<item
android:id="@+id/action_diaspora"
android:title="@string/action_diaspora" />
<item
android:id="@+id/action_forum"
android:title="@string/action_forum" />
<item
android:id="@+id/action_chat"
android:title="@string/action_chat" />
<item
android:id="@+id/action_pad"
android:title="@string/action_pad" />
<item
android:id="@+id/action_calc"
android:title="@string/action_calc" />
<item
android:id="@+id/action_bin"
android:title="@string/action_bin" />
<item
android:id="@+id/action_upload"
android:title="@string/action_upload" />
<item
android:id="@+id/action_searx"
android:title="@string/action_searx" />
<item
android:id="@+id/action_poll"
android:title="@string/action_poll" />
<item
android:id="@+id/action_board"
android:title="@string/action_board" />
<item
android:id="@+id/action_user"
android:title="@string/action_user" />
<item
android:id="@+id/action_about"
android:title="@string/action_about" />
</group>
</menu>

View File

@ -0,0 +1,10 @@
<menu 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"
tools:context="org.disroot.disrootapp.ui.SplashScreenActivity">
<item
android:id="@+id/action_settings"
android:orderInCategory="1"
android:title="@string/action_options"
app:showAsAction="never" />
</menu>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="bg_primary_blue">#50162d</color>
<color name="bg_primary_blue_dark">#1f5c60</color>
</resources>

View File

@ -0,0 +1,27 @@
<resources>
<string name="app_name">Disroot App</string>
<string name="action_home">Home</string>
<string name="action_mail">Mail</string>
<string name="action_cloud">Cloud</string>
<string name="action_diaspora">Diaspora*</string>
<string name="action_forum">Forum</string>
<string name="action_chat">Chat</string>
<string name="action_pad">Etherpad</string>
<string name="action_calc">EtherCalc</string>
<string name="action_bin">Zerobin</string>
<string name="action_upload">Upload</string>
<string name="action_searx">Searx</string>
<string name="action_poll">Poll</string>
<string name="action_board">Board</string>
<string name="action_user">Password</string>
<string name="action_about">About</string>
<string name="action_share">Share</string>
<string name="action_options">Actions</string>
<string name="activity_main_share_info">share link info</string>
<string name="activity_main_manteiners">%s\n\nDeveloper: Massimiliano\n\ncontact us:\n<EMAIL mailto="contact@disroot.org">contact@disroot.org</EMAIL></string>
<string name="view_loading_description">Loading...</string>
<string name="global_ok">ok</string>
</resources>

View File

@ -0,0 +1,24 @@
<resources>
<style name="DisTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/bg_primary_blue</item>
<item name="colorPrimaryDark">@color/bg_primary_blue_dark</item>
<item name="colorAccent">@color/bg_primary_blue</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="windowActionModeOverlay">true</item>
<item name="toolbarStyle">@style/Widget.MyApp.ActionBar</item>
</style>
<style name="Widget.MyApp.ActionBar" parent="Widget.AppCompat.ActionBar">
<item name="theme">@style/ThemeOverlay.MyApp.ActionBar</item>
<item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
</style>
<style name="ThemeOverlay.MyApp.ActionBar" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:actionMenuTextColor">@android:color/white</item>
<item name="android:textSize">18sp</item>
</style>
</resources>

27
build.gradle Normal file
View File

@ -0,0 +1,27 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

13
gradle.properties Normal file
View File

@ -0,0 +1,13 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sat Sep 01 13:24:54 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

172
gradlew vendored Executable file
View File

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored Normal file
View File

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

1
settings.gradle Normal file
View File

@ -0,0 +1 @@
include ':app'