First commit
15
.gitignore
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
3
.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
.idea/.name
Normal file
|
@ -0,0 +1 @@
|
|||
Swatch .beat clock
|
6
.idea/compiler.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
20
.idea/gradle.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
20
.idea/jarRepositories.xml
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
9
.idea/misc.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
1
app/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/build
|
39
app/build.gradle.kts
Normal file
|
@ -0,0 +1,39 @@
|
|||
plugins {
|
||||
id("com.android.application")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "eu.mirkodi.swatchbeatclock"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "eu.mirkodi.swatchbeatclock"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 6
|
||||
versionName = "v1"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation("androidx.appcompat:appcompat:1.6.1")
|
||||
implementation("com.google.android.material:material:1.11.0")
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||
}
|
21
app/proguard-rules.pro
vendored
Normal 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
|
BIN
app/release/app-release.apk
Normal file
20
app/release/output-metadata.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "eu.mirkodi.swatchbeatclock",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 5,
|
||||
"versionName": "1.1.3",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("eu.mirkodi.swatchbeatclock", appContext.getPackageName());
|
||||
}
|
||||
}
|
26
app/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.SwatchbeatClock"
|
||||
tools:targetApi="34">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
BIN
app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 32 KiB |
|
@ -0,0 +1,81 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class ClockFragment extends Fragment {
|
||||
// settings
|
||||
private static final int UPDATEINTERVAL = 854 /* ms */; // one .beat is 85400 ms
|
||||
|
||||
|
||||
public static String ARG_OBJECT = "Clock"; // will be replaced by the non-hardcoded translation
|
||||
|
||||
static DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance();
|
||||
|
||||
TextView clock;
|
||||
ProgressBar pBar;
|
||||
|
||||
final int PBARMAX = 100;
|
||||
|
||||
private final Handler handler = new Handler(); // "thread"
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.clock, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
View gottenView = getView();
|
||||
|
||||
if (gottenView != null) {
|
||||
ARG_OBJECT = gottenView.getContext().getString(R.string.clock);
|
||||
|
||||
clock = gottenView.findViewById(R.id.clock);
|
||||
pBar = gottenView.findViewById(R.id.pBar);
|
||||
|
||||
pBar.setMax(PBARMAX);
|
||||
|
||||
// define the code block to be executed
|
||||
Runnable[] runnables = new Runnable[1];
|
||||
runnables[0] = () -> {
|
||||
double curTime = InternetTime.getCurrentTimeBeats();
|
||||
clock.setText(gottenView.getContext().getString(
|
||||
R.string.beatsDisplay,
|
||||
df.format(curTime)
|
||||
));
|
||||
|
||||
setProgressBar(curTime);
|
||||
|
||||
// repeat every UPDATEINTERVAL ms
|
||||
handler.postDelayed(runnables[0], UPDATEINTERVAL);
|
||||
};
|
||||
|
||||
// start the Runnable immediately
|
||||
handler.post(runnables[0]);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setProgressBar(double value) {
|
||||
// isolate the number after floating point
|
||||
double afterFP = value - ((int) value);
|
||||
pBar.setProgress((int) (afterFP * PBARMAX) /* 1:value=PBARMAX:x*/);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toString() {
|
||||
return ARG_OBJECT;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputFilter;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
|
||||
public class ConverterFragment extends Fragment {
|
||||
public static String ARG_OBJECT = "Converter"; // will be replaced by the non-hardcoded translation
|
||||
private static final String LOGTITLE = "Converter";
|
||||
|
||||
static DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance();
|
||||
|
||||
TimePicker timePicker;
|
||||
EditText converted;
|
||||
RadioGroup convertSideChooser;
|
||||
Button clear;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.converter, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
View gottenView = getView();
|
||||
|
||||
if (gottenView != null) {
|
||||
ARG_OBJECT = gottenView.getContext().getString(R.string.converter);
|
||||
|
||||
timePicker = gottenView.findViewById(R.id.normal_date);
|
||||
|
||||
converted = gottenView.findViewById(R.id.beats);
|
||||
|
||||
convertSideChooser = gottenView.findViewById(R.id.convert_side_picker);
|
||||
|
||||
clear = gottenView.findViewById(R.id.clear);
|
||||
|
||||
clear.setOnClickListener(view1 -> {
|
||||
timePicker.setHour(0); // run these first
|
||||
timePicker.setMinute(0);
|
||||
converted.setText(""); // and then this one
|
||||
});
|
||||
|
||||
convertSideChooser.setOnCheckedChangeListener((radioGroup, i) -> {
|
||||
if (convertSideChooser.getCheckedRadioButtonId() == R.id.normal_chosen) {
|
||||
converted.setEnabled(false);
|
||||
timePicker.setEnabled(true);
|
||||
converted.setFilters(new InputFilter[]{});
|
||||
} else {
|
||||
converted.setEnabled(true);
|
||||
timePicker.setEnabled(false);
|
||||
converted.setFilters(new InputFilter[]{new InputFilterMinMax(0, 1000)});
|
||||
}
|
||||
});
|
||||
|
||||
timePicker.setOnTimeChangedListener((timePicker, i, i1) -> {
|
||||
if (convertSideChooser.getCheckedRadioButtonId() == R.id.normal_chosen) {
|
||||
converted.setText(
|
||||
df.format(
|
||||
InternetTime.timeToBeat(
|
||||
timePicker.getHour(),
|
||||
timePicker.getMinute(),
|
||||
0 /* seconds */, 0 /* millis */
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
converted.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if (convertSideChooser.getCheckedRadioButtonId() == R.id.beats_chosen) {
|
||||
int[] normalTime;
|
||||
String text = converted.getText().toString();
|
||||
|
||||
try {
|
||||
normalTime = InternetTime.beatToTime(text);
|
||||
} catch (ParseException e) {
|
||||
Log.e(LOGTITLE, "Got ParseException on "+text);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
if (normalTime != null) {
|
||||
timePicker.setHour(normalTime[0]);
|
||||
Log.d(LOGTITLE, "Converted hour is "+normalTime[0]);
|
||||
if (normalTime.length > 1) {
|
||||
timePicker.setMinute(normalTime[1]);
|
||||
Log.d(LOGTITLE, "Converted minute is "+normalTime[1]);
|
||||
}
|
||||
else
|
||||
Log.d(LOGTITLE, "Minute not available");
|
||||
} else {
|
||||
Log.w(LOGTITLE, "normalTime is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toString() {
|
||||
return ARG_OBJECT;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import android.text.InputFilter;
|
||||
import android.text.Spanned;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Objects;
|
||||
|
||||
// by [Pratik Sharma](https://stackoverflow.com/users/556975/pratik-sharma)
|
||||
|
||||
public class InputFilterMinMax implements InputFilter {
|
||||
private final double min, max;
|
||||
static DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance();
|
||||
|
||||
public InputFilterMinMax(double min, double max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
||||
int dstart, int dend) {
|
||||
try {
|
||||
double input = Objects.requireNonNull(df.parse(dest.toString() + source.toString())).doubleValue();
|
||||
if (isInRange(min, max, input))
|
||||
return null;
|
||||
} catch (NumberFormatException | ParseException ignored) {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private boolean isInRange(double a, double b, double c) {
|
||||
return b > a ? c >= a && c <= b : c >= b && c <= a;
|
||||
}
|
||||
}
|
101
app/src/main/java/eu/mirkodi/swatchbeatclock/InternetTime.java
Normal file
|
@ -0,0 +1,101 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Objects;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class InternetTime {
|
||||
// settings
|
||||
static final int MAXTIMEARRELEMS = 6; // hour, min, sec, millis, .... MAXTIMEARRELEMS
|
||||
|
||||
static final String LOGTITLE = "InternetTime";
|
||||
|
||||
double initial; // set when obj is created
|
||||
|
||||
static DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance();
|
||||
|
||||
// initialise with current time
|
||||
public InternetTime() {
|
||||
initial = hoursToBeat(getCurrentTimeHours());
|
||||
}
|
||||
|
||||
// @return decimal hour value
|
||||
public static double getCurrentTimeHours() {
|
||||
TimeZone tz = TimeZone.getTimeZone("CET");
|
||||
Calendar c = Calendar.getInstance(tz);
|
||||
return timeToDoubleHours(c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE),
|
||||
c.get(Calendar.SECOND), c.get(Calendar.MILLISECOND));
|
||||
}
|
||||
|
||||
public static double hoursToBeat(double hours) {
|
||||
// 24:hours=1000:x
|
||||
return (hours * 1000) / 24;
|
||||
}
|
||||
|
||||
private static double timeToDoubleHours(int hour, int minute, int second, int millis) {
|
||||
return hour + ((minute + ((second + (millis / 1000.0)) / 60.0)) / 60.0);
|
||||
}
|
||||
|
||||
// @return: [0]: hour; [1]: minute; [2]: seconds; [3]: millis......
|
||||
private static int[] doubleHoursToTime(double hours) {
|
||||
Log.d(LOGTITLE, "Converting " + hours + " h to .beats");
|
||||
int[] ret = new int[MAXTIMEARRELEMS];
|
||||
|
||||
double n = hours;
|
||||
int i = 0;
|
||||
do {
|
||||
int intN = (int) n;
|
||||
Log.d(LOGTITLE, "i = " + i + "; n = " + n + "; intN = " + intN);
|
||||
ret[i] = intN;
|
||||
|
||||
double m = n - intN;
|
||||
if (i < 2) {
|
||||
n = m * 60;
|
||||
} else {
|
||||
n = m * 1000;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
while (n - ((int) n) != 0 && i < MAXTIMEARRELEMS);
|
||||
|
||||
Log.d(LOGTITLE, "ret: " + Arrays.toString(ret));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static double timeToBeat(int hour, int minute, int seconds, int millis) {
|
||||
return hoursToBeat(timeToDoubleHours(hour, minute, seconds, millis));
|
||||
}
|
||||
|
||||
public static double beatToDoubleHours(double beats) {
|
||||
return (beats * 24) / 1000 /* 1000:beats=24:hours */;
|
||||
}
|
||||
|
||||
// @return: [0]: hour; [1]: minute; [2]: seconds; [3]: millis
|
||||
public static int[] beatToTime(String beats) throws ParseException {
|
||||
if (beats.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
return beatToTime(Objects.requireNonNull(df.parse(beats)).doubleValue());
|
||||
}
|
||||
|
||||
// @return: [0]: hour; [1]: minute; [2]: seconds; [3]: millis
|
||||
public static int[] beatToTime(double beats) {
|
||||
return doubleHoursToTime(beatToDoubleHours(beats));
|
||||
}
|
||||
|
||||
public static double getCurrentTimeBeats() {
|
||||
return hoursToBeat(getCurrentTimeHours());
|
||||
}
|
||||
|
||||
// returns time saved when creating the class instance
|
||||
public double getInitial() {
|
||||
return initial;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
TabsPagerAdapter tabsPagerAdapter;
|
||||
ViewPager viewPager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// "wakelock"
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
tabsPagerAdapter = new TabsPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
viewPager = findViewById(R.id.pager);
|
||||
viewPager.setAdapter(tabsPagerAdapter);
|
||||
|
||||
TabLayout tabLayout = findViewById(R.id.tab_layout);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
public class TabsPagerAdapter extends FragmentStatePagerAdapter {
|
||||
ClockFragment clockFragment = new ClockFragment(); // 0
|
||||
ConverterFragment converterFragment = new ConverterFragment(); // 1;
|
||||
|
||||
public TabsPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
if (i == 1) {
|
||||
return converterFragment;
|
||||
}
|
||||
return clockFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 2 /* hardcoded */;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return getItem(position).toString();
|
||||
}
|
||||
}
|
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
|
@ -0,0 +1,170 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
102
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
|
@ -0,0 +1,102 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="642.76"
|
||||
android:viewportHeight="402.17">
|
||||
<group android:scaleX="0.47"
|
||||
android:scaleY="0.2940754"
|
||||
android:translateX="170.3314"
|
||||
android:translateY="141.95085">
|
||||
<path
|
||||
android:pathData="M508.09,27.21C508.09,22.68 511.47,19.31 515.83,19.31C520.1,19.31 523.48,22.68 523.48,27.21C523.48,31.73 520.1,35.1 515.83,35.1C511.47,35.1 508.09,31.73 508.09,27.21zM515.83,36.67C521.01,36.67 525.37,32.64 525.37,27.21C525.37,21.78 521.01,17.75 515.83,17.75C510.64,17.75 506.2,21.78 506.2,27.21C506.2,32.64 510.64,36.67 515.83,36.67zM513.85,27.95L515.74,27.95L518.62,32.64L520.43,32.64L517.39,27.87C518.95,27.7 520.19,26.8 520.19,24.9C520.19,22.68 518.87,21.78 516.32,21.78L512.12,21.78L512.12,32.64L513.85,32.64L513.85,27.95zM513.85,26.55L513.85,23.18L516.07,23.18C517.22,23.18 518.46,23.42 518.46,24.74C518.46,26.47 517.22,26.55 515.83,26.55L513.85,26.55"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M97.59,40.86L41.25,40.86C34.91,40.86 29.07,43.41 24.63,47.85C20.36,52.21 18.05,57.97 18.13,64.06C18.05,70.37 20.36,76.33 24.71,80.7C28.91,84.91 34.58,87.18 40.59,87.13C40.51,87.13 75.46,87.13 75.46,87.13C82.95,87.19 88.54,92.5 88.62,99.75C88.54,106.75 82.54,112.73 75.38,112.82C75.46,112.82 17.72,112.82 17.72,112.82L17.72,124.9L75.46,124.9C89.12,124.72 100.47,113.44 100.71,99.75C100.47,85.68 89.61,75.17 75.46,75.05C75.46,75.05 40.51,75.05 40.51,75.05C37.71,75.08 35.16,74.06 33.27,72.17C31.21,70.12 30.14,67.24 30.14,64.06C30.14,61.08 31.21,58.38 33.27,56.32C35.41,54.19 38.2,52.95 41.33,52.95C41.25,52.95 97.59,52.95 97.59,52.95L97.59,40.86"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M200.56,40.45L200.56,97.48C200.56,101.84 198.84,105.91 195.79,108.94C192.75,111.94 188.8,113.57 184.52,113.54C175.81,113.6 168.65,106.35 168.4,97.35C168.4,97.48 168.4,40.45 168.4,40.45L156.4,40.45L156.4,97.48C156.4,97.53 156.4,97.57 156.4,97.61L156.4,97.61C156.48,101.86 154.92,105.84 151.95,108.82C148.91,111.9 144.8,113.57 140.36,113.54C136.24,113.57 132.46,111.98 129.58,109.07C126.54,106.03 124.89,101.94 124.98,97.57C124.98,97.48 124.98,40.45 124.98,40.45L112.89,40.45L112.89,97.48C112.8,105.04 115.68,112.21 120.95,117.58C126.21,122.82 133.04,125.67 140.36,125.61C148.01,125.68 155.16,122.72 160.51,117.3C161.25,116.55 161.99,115.74 162.65,114.91C167.83,121.49 175.72,125.68 184.52,125.61C191.93,125.67 199,122.8 204.35,117.51C209.69,112.2 212.65,105.08 212.57,97.48L212.57,40.45L200.56,40.45"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M294.25,40.12L267.84,40.12C244.07,39.79 224.42,58.77 224.09,82.43C224.42,106.82 244.07,126.43 267.84,126.33C272.86,126.42 277.63,125.54 282.16,123.86L282.16,111.4L280.76,111.4L279.61,111.94C275.99,113.57 272.2,114.33 268.01,114.25C250.57,114.33 236.34,100.06 236.1,82.44C236.34,65.32 250.24,51.96 267.76,52.21C267.84,52.21 280.43,52.21 288.16,52.21L288.16,124.57L300.25,124.57L300.25,40.12L294.25,40.12"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M344.09,113.54C340.06,113.5 336.28,111.87 333.4,108.95C330.76,106.22 329.37,102.71 329.45,99.05C329.45,98.97 329.45,74.26 329.45,52.21L358.32,52.21L358.32,40.12L329.45,40.12C329.45,27.78 329.45,18.41 329.45,18.41L317.44,18.41L317.44,98.9C317.19,105.67 319.83,112.27 324.76,117.34C329.78,122.6 336.69,125.54 344.09,125.61C344.09,125.61 361.2,125.61 361.2,125.61L361.2,113.54L344.09,113.54"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M431.93,95.73C426.91,107.06 415.65,114.33 403.31,114.25C394.67,114.28 386.69,110.99 380.69,104.99C374.69,99 371.48,91.04 371.56,82.56C371.4,65.26 385.71,51.06 403.31,50.81C413.51,51.06 422.64,55.83 428.23,63.87L438.18,56.98C430.37,45.71 417.7,39.05 403.39,38.72C378.88,39.05 359.31,58.74 359.47,82.56C359.39,94.21 363.83,105.23 372.14,113.52C380.44,121.83 391.46,126.38 403.31,126.33C420.33,126.43 435.96,116.36 442.95,100.66L431.93,95.73"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M487.94,38.72C478.98,38.56 470.26,41.85 463.43,48.02L463.43,18.41L451.34,18.41L451.34,124.57L463.43,124.57L463.43,75.31C463.35,68.7 465.9,62.49 470.59,57.8C475.28,53.2 481.45,50.65 487.94,50.81C501.84,50.57 513.11,61.65 513.36,75.5C513.36,75.39 513.36,124.57 513.36,124.57L525.45,124.57L525.45,75.39C525.12,54.76 508.26,38.39 487.94,38.72"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"/>
|
||||
<path
|
||||
android:pathData="M542.97,42.59L624.89,42.59L624.89,124.57L542.97,124.57L542.97,42.59z"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.28787318"
|
||||
android:fillColor="#da0021"
|
||||
android:strokeColor="#da0021"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M619.21,73.25L594.21,73.25L594.21,48.35L573.57,48.35L573.57,73.25L547.9,73.25L547.9,93.92L573.57,93.92L573.57,119.57L594.21,119.57L594.21,93.92L619.21,93.92L619.21,73.25"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.035"
|
||||
android:fillColor="#fffeff"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M18.87,319.99L71.19,319.99L71.19,380.47L18.87,380.47L18.87,319.99z"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.28787318"
|
||||
android:fillColor="#da0021"
|
||||
android:strokeColor="#da0021"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M153.6,305.26C153.6,278.14 154.75,257.24 170.3,257.24C187.07,257.24 187.9,275.6 187.9,303.28C187.9,327.85 187.32,351.29 170.05,351.29C156.4,351.29 153.6,334.91 153.6,305.26zM108.86,380.5L152.78,380.5L152.78,361.73L153.27,361.73C156.72,372.21 166.02,384.38 186.5,384.38C217.18,384.38 233.46,362.3 233.46,305.38C233.46,258.09 226.72,223.83 189.3,223.83C176.55,223.83 162.65,228.08 155,244.5L154.42,244.5L154.42,178.96L108.86,178.96L108.86,380.5"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.035"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M298.77,285.08C298.77,264.4 301.32,251.94 316.21,251.94C328.79,251.94 331.59,263.55 331.59,285.08L298.77,285.08zM375.67,311.73C375.67,259.59 371.72,223.8 315.06,223.8C265.54,223.8 253.2,255.61 253.2,298.7C253.2,344.16 257.73,384.42 315.06,384.42C352.81,384.42 373.45,366.13 374.27,328.36L331.92,328.36C330.76,347.54 327.15,356.28 315.3,356.28C302.14,356.28 298.77,344.72 298.77,321.04L298.77,311.73L375.67,311.73"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.035"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M439.83,333.41C439.83,324.99 442.05,320.23 446.9,316.59C451.18,313.22 457.43,312.93 471.9,305.37C471.9,311.54 471.58,319.39 471.58,332.01C471.58,347.15 462.78,352.75 453.15,352.75C444.6,352.75 439.83,345.46 439.83,333.41zM440.57,275.08C440.81,261.51 444.52,253.71 457.35,253.71C467.63,253.71 471.9,259.78 471.9,269.31C471.9,280.97 469.36,283.22 455.37,286.86C442.62,290.22 425.68,293.03 414.33,299.2C403.06,305.37 395.66,320.23 395.66,337.9C395.66,370.83 410.71,384.38 436.37,384.38C451.75,384.38 466.23,376.48 472.48,362.92L473.06,362.92C473.3,368.87 473.88,375.09 475.61,380.47L519.61,380.47C514.26,373.68 514.26,358.98 514.26,347.43L514.26,269.31C514.26,236.78 497.57,223.8 459.9,223.8C440.81,223.8 427.82,226.34 417.13,233.68C406.43,241.01 400.18,253.71 399.94,275.08L440.57,275.08"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.035"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
<path
|
||||
android:pathData="M558.1,259.38L539.18,259.38L539.18,227.75L558.1,227.75L558.1,182.84L603.67,182.84L603.67,227.75L624.81,227.75L624.81,259.38L603.67,259.38L603.67,336.49C603.67,347.22 607.62,350.62 618.39,350.62C620.37,350.62 622.83,350.33 624.81,350.05L624.81,380.55C616.09,381.69 607.37,382.25 598.57,382.25C567.07,382.25 558.1,376.59 558.1,340.97L558.1,259.38"
|
||||
android:strokeLineJoin="miter"
|
||||
android:strokeWidth="0.035"
|
||||
android:fillColor="#000000"
|
||||
android:strokeColor="#00000000"
|
||||
android:fillType="nonZero"
|
||||
android:strokeLineCap="butt"/>
|
||||
</group>
|
||||
</vector>
|
14
app/src/main/res/layout/activity_main.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:contentDescription="@string/tabs_desc"
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</androidx.viewpager.widget.ViewPager>
|
27
app/src/main/res/layout/clock.xml
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textSize="@dimen/time_size"
|
||||
android:id="@+id/clock"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:id="@+id/pBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/progressbar_height"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
81
app/src/main/res/layout/converter.xml
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/normal_date"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/convert_side_picker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/normal_chosen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/twentyfour_hour" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/beats_chosen"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/radio_spacing"
|
||||
android:text="@string/beats" />
|
||||
</RadioGroup>
|
||||
|
||||
<Button
|
||||
android:id="@+id/clear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/clear_and_convert_side_picker_spacing"
|
||||
android:text="@string/clear" />
|
||||
</LinearLayout>
|
||||
|
||||
<TimePicker
|
||||
android:id="@+id/normal_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:timePickerMode="spinner"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/normal_date">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/at"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/at"
|
||||
android:textSize="@dimen/converted_beats_size"
|
||||
app:layout_constraintBaseline_toBaselineOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/beats" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/beats"
|
||||
android:layout_width="@dimen/beats_input_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:autofillHints="@string/time_in_beats"
|
||||
android:enabled="false"
|
||||
android:hint="@string/time_in_beats"
|
||||
android:inputType="numberDecimal"
|
||||
android:textSize="@dimen/converted_beats_size"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/at"
|
||||
app:layout_constraintStart_toEndOf="@+id/at"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
5
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.webp
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 8.9 KiB |
11
app/src/main/res/values-it/strings.xml
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Orologio .beat Swatch</string>
|
||||
<string name="beats">Battiti</string>
|
||||
<string name="time_in_beats">Tempo (.battiti)</string>
|
||||
<string name="twentyfour_hour">24-ore</string>
|
||||
<string name="clear">Svuota</string>
|
||||
<string name="tabs_desc">Contenitore per le diverse funzioni messe a disposizione dall\'applicazione.</string>
|
||||
<string name="clock">Orologio</string>
|
||||
<string name="converter">Convertitore</string>
|
||||
</resources>
|
10
app/src/main/res/values-night/themes.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.SwatchbeatClock" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<item name="colorPrimary">@color/lightbluewhite</item>
|
||||
<item name="colorPrimaryVariant">@color/lightbluelighter</item>
|
||||
<item name="colorSecondary">@color/redwhite</item>
|
||||
<item name="colorSecondaryVariant">@color/redlighter</item>
|
||||
</style>
|
||||
</resources>
|
13
app/src/main/res/values/colors.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="cyan">#317B7C</color>
|
||||
<color name="lightblue">#41B4C0</color>
|
||||
<color name="lightbluewhite">#E5FBFD</color>
|
||||
<color name="lightbluelighter">#94F0F8</color>
|
||||
<color name="red">#FF0000</color>
|
||||
<color name="reddarker">#DA0000</color>
|
||||
<color name="redwhite">#FFE7E6</color>
|
||||
<color name="redlighter">#FFA28A</color>
|
||||
</resources>
|
10
app/src/main/res/values/dimens.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="time_size">30pt</dimen>
|
||||
<dimen name="converted_beats_size">15pt</dimen>
|
||||
<dimen name="progressbar_height">5dp</dimen>
|
||||
<dimen name="converted_bottom_margin">25dp</dimen>
|
||||
<dimen name="beats_input_width">333dp</dimen>
|
||||
<dimen name="radio_spacing">25dp</dimen>
|
||||
<dimen name="clear_and_convert_side_picker_spacing">50dp</dimen>
|
||||
</resources>
|
12
app/src/main/res/values/strings.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<resources>
|
||||
<string name="app_name">Swatch .beat clock</string>
|
||||
<string name="beats">Beats</string>
|
||||
<string name="beatsDisplay" translatable="false">\@%1$s</string>
|
||||
<string name="at" translatable="false">\@</string>
|
||||
<string name="time_in_beats">Time (.beats)</string>
|
||||
<string name="twentyfour_hour">24-hour</string>
|
||||
<string name="clear">Clear</string>
|
||||
<string name="tabs_desc">Container for different functions provided by the application.</string>
|
||||
<string name="clock">Clock</string>
|
||||
<string name="converter">Converter</string>
|
||||
</resources>
|
12
app/src/main/res/values/themes.xml
Normal file
|
@ -0,0 +1,12 @@
|
|||
<resources>
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.SwatchbeatClock" parent="Theme.Material3.Light.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<item name="colorPrimary">@color/lightblue</item>
|
||||
<item name="colorPrimaryVariant">@color/cyan</item>
|
||||
<item name="colorSecondary">@color/red</item>
|
||||
<item name="colorSecondaryVariant">@color/reddarker</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.SwatchbeatClock" parent="Base.Theme.SwatchbeatClock" />
|
||||
</resources>
|
13
app/src/main/res/xml/backup_rules.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
19
app/src/main/res/xml/data_extraction_rules.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
|
@ -0,0 +1,17 @@
|
|||
package eu.mirkodi.swatchbeatclock;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
4
build.gradle.kts
Normal file
|
@ -0,0 +1,4 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id("com.android.application") version "8.1.1" apply false
|
||||
}
|
21
gradle.properties
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# 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
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
#Mon Jan 08 16:38:42 CET 2024
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
185
gradlew
vendored
Executable file
|
@ -0,0 +1,185 @@
|
|||
#!/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" "$@"
|
89
gradlew.bat
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
@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 Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@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 execute
|
||||
|
||||
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 execute
|
||||
|
||||
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
|
||||
|
||||
: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 %*
|
||||
|
||||
: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
|
17
settings.gradle.kts
Normal file
|
@ -0,0 +1,17 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "Swatch .beat clock"
|
||||
include(":app")
|