Skip to content
Snippets Groups Projects
Commit b8fa6504 authored by Torsten Grote's avatar Torsten Grote
Browse files

Merge branch 'basic-project-setup' into 'main'

Basic project setup

See merge request !1
parents dc35d7b8 4f17dc48
No related branches found
No related tags found
1 merge request!1Basic project setup
Showing
with 990 additions and 0 deletions
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="62.177082mm"
height="62.177082mm"
viewBox="0 0 62.177082 62.177082"
version="1.1"
id="svg994"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="logo-simple.svg">
<defs
id="defs988" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="187.61184"
inkscape:cy="200.04615"
inkscape:document-units="mm"
inkscape:current-layer="g1696"
showgrid="false"
inkscape:window-width="1680"
inkscape:window-height="993"
inkscape:window-x="1680"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-object-midpoints="true" />
<metadata
id="metadata991">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Logo"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-15.780507,-8.8876533)"
style="display:inline">
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path13"
d="m 28.26884,34.763903 v 31.617708 c 0,2.566458 2.090208,4.683125 4.683125,4.683125 h 2.196041 c 2.566459,0 4.683125,-2.116667 4.683125,-4.683125 V 34.763903 Z"
class="st1" />
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path15"
d="m 39.804673,19.523903 v -5.953125 c 0,-2.566458 -2.090208,-4.6831247 -4.656667,-4.6831247 h -2.196041 c -2.566459,0 -4.683125,2.1166667 -4.683125,4.6831247 v 5.953125 z"
class="st1" />
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path23"
d="M 65.469256,45.188486 V 13.570778 c 0,-2.566458 -2.090208,-4.6831247 -4.656667,-4.6831247 h -2.196041 c -2.566459,0 -4.683125,2.1166667 -4.683125,4.6831247 v 31.617708 z"
class="st1" />
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path27"
d="m 53.933423,60.428486 v 5.953125 c 0,2.566458 2.116666,4.683125 4.683125,4.683125 h 2.196041 c 2.566459,0 4.683125,-2.116667 4.683125,-4.683125 v -5.953125 z"
class="st1" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path35"
d="m 26.416757,47.040569 h -5.953125 c -2.566459,0 -4.683125,2.090209 -4.683125,4.683125 v 2.196042 c 0,2.566458 2.090208,4.683125 4.683125,4.683125 h 5.953125 z"
class="st3" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path39"
d="M 73.274464,47.040569 H 41.656756 v 11.562292 h 31.617708 c 2.566459,0 4.683125,-2.116667 4.683125,-4.683125 v -2.196042 c 0,-2.592916 -2.116666,-4.683125 -4.683125,-4.683125 z"
class="st3" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path49"
d="M 52.08134,21.375986 H 20.463632 c -2.566459,0 -4.683125,2.090209 -4.683125,4.683125 v 2.196042 c 0,2.566458 2.090208,4.683125 4.683125,4.683125 H 52.08134 Z"
class="st3" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path51"
d="m 73.274464,21.375986 h -5.953125 v 11.562292 h 5.953125 c 2.566459,0 4.683125,-2.090208 4.683125,-4.683125 v -2.196042 c 0,-2.592916 -2.116666,-4.683125 -4.683125,-4.683125 z"
class="st3" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Mailbox"
style="display:inline">
<g
id="g1696"
transform="translate(93.605168,-22.3857)">
<rect
y="53.891731"
x="-64.67923"
height="24.856064"
width="30.201456"
id="rect1682"
style="opacity:1;vector-effect:none;fill:#1f78d1;fill-opacity:1;stroke:none;stroke-width:0.66145831;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
rx="3" />
<path
style="opacity:1;vector-effect:none;fill:#435b7f;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 120.66406,119.07812 c -3.08343,0 -5.86623,1.22333 -7.90625,3.20704 l 24.92578,23.13867 c 15.59667,14.47856 28.54649,26.28299 28.77735,26.23242 0.23085,-0.0505 13.15382,-11.89622 28.71679,-26.32422 l 24.86133,-23.04883 c -2.03975,-1.98198 -4.82238,-3.20508 -7.90429,-3.20508 z"
transform="matrix(0.26458333,0,0,0.26458333,-93.605168,22.3857)"
id="path1692"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="62.177082mm"
height="62.177082mm"
viewBox="0 0 62.177082 62.177082"
version="1.1"
id="svg994"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="logo.svg">
<defs
id="defs988" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="187.61184"
inkscape:cy="200.04615"
inkscape:document-units="mm"
inkscape:current-layer="g1696"
showgrid="false"
inkscape:window-width="1680"
inkscape:window-height="993"
inkscape:window-x="1680"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-object-midpoints="true" />
<metadata
id="metadata991">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Logo"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-15.780507,-8.8876533)"
style="display:inline">
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path13"
d="m 28.26884,34.763903 v 31.617708 c 0,2.566458 2.090208,4.683125 4.683125,4.683125 h 2.196041 c 2.566459,0 4.683125,-2.116667 4.683125,-4.683125 V 34.763903 Z"
class="st1" />
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path15"
d="m 39.804673,19.523903 v -5.953125 c 0,-2.566458 -2.090208,-4.6831247 -4.656667,-4.6831247 h -2.196041 c -2.566459,0 -4.683125,2.1166667 -4.683125,4.6831247 v 5.953125 z"
class="st1" />
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path23"
d="M 65.469256,45.188486 V 13.570778 c 0,-2.566458 -2.090208,-4.6831247 -4.656667,-4.6831247 h -2.196041 c -2.566459,0 -4.683125,2.1166667 -4.683125,4.6831247 v 31.617708 z"
class="st1" />
<path
style="fill:#87c214;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path27"
d="m 53.933423,60.428486 v 5.953125 c 0,2.566458 2.116666,4.683125 4.683125,4.683125 h 2.196041 c 2.566459,0 4.683125,-2.116667 4.683125,-4.683125 v -5.953125 z"
class="st1" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path35"
d="m 26.416757,47.040569 h -5.953125 c -2.566459,0 -4.683125,2.090209 -4.683125,4.683125 v 2.196042 c 0,2.566458 2.090208,4.683125 4.683125,4.683125 h 5.953125 z"
class="st3" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path39"
d="M 73.274464,47.040569 H 41.656756 v 11.562292 h 31.617708 c 2.566459,0 4.683125,-2.116667 4.683125,-4.683125 v -2.196042 c 0,-2.592916 -2.116666,-4.683125 -4.683125,-4.683125 z"
class="st3" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path49"
d="M 52.08134,21.375986 H 20.463632 c -2.566459,0 -4.683125,2.090209 -4.683125,4.683125 v 2.196042 c 0,2.566458 2.090208,4.683125 4.683125,4.683125 H 52.08134 Z"
class="st3" />
<path
style="fill:#95d220;stroke-width:0.26458332"
inkscape:connector-curvature="0"
id="path51"
d="m 73.274464,21.375986 h -5.953125 v 11.562292 h 5.953125 c 2.566459,0 4.683125,-2.090208 4.683125,-4.683125 v -2.196042 c 0,-2.592916 -2.116666,-4.683125 -4.683125,-4.683125 z"
class="st3" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Mailbox"
style="display:inline">
<g
id="g1696"
transform="translate(93.605168,-22.3857)">
<rect
y="53.891731"
x="-64.67923"
height="24.856064"
width="30.201456"
id="rect1682"
style="opacity:1;vector-effect:none;fill:#1f78d1;fill-opacity:1;stroke:none;stroke-width:0.66145831;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
rx="3" />
<path
style="opacity:1;vector-effect:none;fill:#435b7f;fill-opacity:1;stroke:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 120.66406,119.07812 c -3.08343,0 -5.86623,1.22333 -7.90625,3.20704 l 24.92578,23.13867 c 15.59667,14.47856 28.54649,26.28299 28.77735,26.23242 0.23085,-0.0505 13.15382,-11.89622 28.71679,-26.32422 l 24.86133,-23.04883 c -2.03975,-1.98198 -4.82238,-3.20508 -7.90429,-3.20508 z"
transform="matrix(0.26458333,0,0,0.26458333,-93.605168,22.3857)"
id="path1692"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>
buildscript {
ext.kotlin_version = "1.5.21"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean (type: Delete) {
delete rootProject.buildDir
}
android.useAndroidX=true
\ No newline at end of file
File added
#Fri Jun 25 21:56:52 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
gradlew 0 → 100755
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# 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
#
# https://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.
#
##############################################################################
##
## 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='"-Xmx64m" "-Xms64m"'
# 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 or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; 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=`expr $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"
exec "$JAVACMD" "$@"
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@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="-Xmx64m" "-Xms64m"
@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
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "org.briarproject.mailbox"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.google.dagger:dagger:2.37'
kapt 'com.google.dagger:dagger-compiler:2.37'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
# 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
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.briarproject.mailbox">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:name=".MailboxApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/Theme.Briarmailbox">
<service android:name=".MailboxService" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package org.briarproject.mailbox
import dagger.Component
@Component
interface ApplicationComponent {
fun inject(activity: MainActivity)
}
\ No newline at end of file
package org.briarproject.mailbox
import android.app.Application
class MailboxApplication : Application() {
val appComponent = DaggerApplicationComponent.create()
override fun onCreate() {
super.onCreate()
MailboxService.startService(this, "Waiting for messages")
}
}
\ No newline at end of file
package org.briarproject.mailbox
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.Context
import android.content.Intent
import android.os.Build.VERSION
import android.os.Build.VERSION.SDK_INT
import android.os.Build.VERSION_CODES
import android.os.IBinder
import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat
class MailboxService : Service() {
companion object {
private const val CHANNEL_ID = "Briar Mailbox Service"
private const val ARG_MESSAGE = "message"
private const val NOTIFICATION_MAIN_ID = 1
fun startService(context: Context, message: String) {
val startIntent = Intent(context, MailboxService::class.java)
startIntent.putExtra(ARG_MESSAGE, message)
ContextCompat.startForegroundService(context, startIntent)
}
fun stopService(context: Context) {
val stopIntent = Intent(context, MailboxService::class.java)
context.stopService(stopIntent)
}
}
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
val input = intent?.getStringExtra(ARG_MESSAGE)
createNotificationChannel()
val notificationIntent = Intent(this, MainActivity::class.java)
val pendingIntent = PendingIntent.getActivity(
this, 0, notificationIntent, 0
)
val notification = NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(getString(R.string.notification_mailbox_running))
.setContentText(input)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setContentIntent(pendingIntent)
.build()
startForeground(NOTIFICATION_MAIN_ID, notification)
return START_NOT_STICKY
}
override fun onBind(intent: Intent): IBinder? {
return null
}
private fun createNotificationChannel() {
if (SDK_INT >= 26) {
val serviceChannel = NotificationChannel(
CHANNEL_ID, getString(R.string.notification_channel_name),
NotificationManager.IMPORTANCE_DEFAULT
)
val manager = getSystemService(NotificationManager::class.java)
manager!!.createNotificationChannel(serviceChannel)
}
}
}
\ No newline at end of file
package org.briarproject.mailbox
import javax.inject.Inject
class MailboxViewModel @Inject constructor() {
val text = "Hello Mailbox"
}
\ No newline at end of file
package org.briarproject.mailbox
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import javax.inject.Inject
class MainActivity : AppCompatActivity() {
lateinit var applicationComponent: ApplicationComponent
@Inject
lateinit var mailboxViewModel: MailboxViewModel
override fun onCreate(savedInstanceState: Bundle?) {
(applicationContext as MailboxApplication).appComponent.inject(this)
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val textView = findViewById<TextView>(R.id.text)
textView.text = mailboxViewModel.text
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.816378"
android:scaleY="0.816378"
android:translateX="28.62"
android:translateY="28.62">
<path
android:pathData="m12.4883,25.8763v31.6177c0,2.5665 2.0902,4.6831 4.6831,4.6831h2.196c2.5665,0 4.6831,-2.1167 4.6831,-4.6831L24.0506,25.8763Z"
android:strokeWidth="0.26458332"
android:fillColor="#87c214"/>
<path
android:pathData="m24.0242,10.6362v-5.9531c0,-2.5665 -2.0902,-4.6831 -4.6567,-4.6831h-2.196c-2.5665,0 -4.6831,2.1167 -4.6831,4.6831v5.9531z"
android:strokeWidth="0.26458332"
android:fillColor="#87c214"/>
<path
android:pathData="M49.6887,36.3008L49.6887,4.6831c0,-2.5665 -2.0902,-4.6831 -4.6567,-4.6831h-2.196c-2.5665,0 -4.6831,2.1167 -4.6831,4.6831v31.6177z"
android:strokeWidth="0.26458332"
android:fillColor="#87c214"/>
<path
android:pathData="m38.1529,51.5408v5.9531c0,2.5665 2.1167,4.6831 4.6831,4.6831h2.196c2.5665,0 4.6831,-2.1167 4.6831,-4.6831v-5.9531z"
android:strokeWidth="0.26458332"
android:fillColor="#87c214"/>
<path
android:pathData="m10.6363,38.1529h-5.9531c-2.5665,0 -4.6831,2.0902 -4.6831,4.6831v2.196c0,2.5665 2.0902,4.6831 4.6831,4.6831h5.9531z"
android:strokeWidth="0.26458332"
android:fillColor="#95d220"/>
<path
android:pathData="M57.494,38.1529L25.8763,38.1529v11.5623h31.6177c2.5665,0 4.6831,-2.1167 4.6831,-4.6831v-2.196c0,-2.5929 -2.1167,-4.6831 -4.6831,-4.6831z"
android:strokeWidth="0.26458332"
android:fillColor="#95d220"/>
<path
android:pathData="M36.3008,12.4883L4.6831,12.4883c-2.5665,0 -4.6831,2.0902 -4.6831,4.6831v2.196c0,2.5665 2.0902,4.6831 4.6831,4.6831L36.3008,24.0506Z"
android:strokeWidth="0.26458332"
android:fillColor="#95d220"/>
<path
android:pathData="m57.494,12.4883h-5.9531v11.5623h5.9531c2.5665,0 4.6831,-2.0902 4.6831,-4.6831v-2.196c0,-2.5929 -2.1167,-4.6831 -4.6831,-4.6831z"
android:strokeWidth="0.26458332"
android:fillColor="#95d220"/>
<path
android:pathData="M31.9259,31.506L56.1274,31.506A3,3 0,0 1,59.1274 34.506L59.1274,53.3621A3,3 0,0 1,56.1274 56.3621L31.9259,56.3621A3,3 0,0 1,28.9259 53.3621L28.9259,34.506A3,3 0,0 1,31.9259 31.506z"
android:strokeLineJoin="round"
android:strokeWidth="0.66145831"
android:fillColor="#1f78d1"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="m31.9257,31.5061c-0.8158,0 -1.5521,0.3237 -2.0919,0.8485l6.5949,6.1221c4.1266,3.8308 7.5529,6.954 7.614,6.9407 0.0611,-0.0134 3.4803,-3.1475 7.598,-6.9649l6.5779,-6.0983c-0.5397,-0.5244 -1.2759,-0.848 -2.0913,-0.848z"
android:strokeLineJoin="round"
android:strokeWidth="2.5"
android:fillColor="#435b7f"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
</group>
</vector>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment