Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibler committed May 4, 2016
0 parents commit 87aff78
Show file tree
Hide file tree
Showing 20 changed files with 1,089 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
33 changes: 33 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TactileClock</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
42 changes: 42 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.eric_scheibler.tactileclock"
android:versionCode="1"
android:versionName="1.0.0" >

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />

<!-- permissions -->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<service
android:name=".TactileClockService" />

<receiver
android:name=".ScreenReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>

</application>

</manifest>
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v1.0.0: 2016.05.03:
- initial release.

674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
TactileClock
============

This Android app vibrates the current time when the display is locked and the power button is
pressed twice in a row with a delay between 500 and 1500 milliseconds. It is started automatically
after booting is finished. Android version >= 4.0 is supported.

The time is processed digit by digit. Vibration Pattern: short = 1, long = 5.

Examples:

- 02:11 = short . short ... short .. short
- 10:53 = short .. long . long ... long .. short . short . short

This app is also available in the [Play Store](https://play.google.com/store/apps/details?id=de.eric_scheibler.tactileclock&hl=en).

14 changes: 14 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-23
Binary file added res/drawable-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:text="@string/labelApplicationDescription1" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:focusable="true"
android:text="@string/labelApplicationDescription2" />

<Switch
android:id="@+id/buttonTimeFormat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/buttonTimeFormat" />

</LinearLayout>
</ScrollView>
14 changes: 14 additions & 0 deletions res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">TactileClock</string>
<string name="labelApplicationDescription1">Diese App gibt die aktuelle Uhrzeit als
Vibrationspattern aus. Dazu muss das Display abgeschaltet sein und der Power-Button zweimal
kurz hintereinander betätigt werden (Interwall von 500 bis 1500 Millisekunden). Die App
startet automatisch nach dem Booten des Geräts.</string>
<string name="labelApplicationDescription2">Die Uhrzeit wird Ziffer für Ziffer
verarbeitet.\nVibrationspattern: kurz = 1, lang = 5\n\nBeispiele:\n- 02:11 = kurz . kurz ...
kurz .. kurz\n- 10:53 = kurz .. lang . lang ... lang .. kurz . kurz . kurz</string>
<string name="buttonTimeFormat">Zeitformat: 24 Stunden</string>

</resources>
7 changes: 7 additions & 0 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<resources>

<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>

</resources>
13 changes: 13 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">TactileClock</string>
<string name="labelApplicationDescription1">This app vibrates the current time when the display
is locked and the power button is pressed twice in a row with a delay between 500 and 1500
milliseconds. It is started automatically after booting is finished.</string>
<string name="labelApplicationDescription2">The time is processed digit by digit.\nVibration
Pattern: short = 1, long = 5\n\nExamples:\n- 02:11 = short . short ... short ..
short\n- 10:53 = short .. long . long ... long .. short . short . short</string>
<string name="buttonTimeFormat">Time format: 24 hours</string>

</resources>
9 changes: 9 additions & 0 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<resources>

<!-- Base application theme -->
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- default font size -->
<item name="android:textSize">22sp</item>
</style>

</resources>
47 changes: 47 additions & 0 deletions src/de/eric_scheibler/tactileclock/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package de.eric_scheibler.tactileclock;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.format.DateFormat;
import android.widget.CompoundButton;
import android.widget.Switch;

public class MainActivity extends Activity {

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

// set 24 hour format option on first application start based on user selection
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
if (! settings.contains(TactileClockService.TWENTY_FOUR_HOUR_FORMAT_KEY)) {
store24HourFormatOption(DateFormat.is24HourFormat(this));
}

// toggle button to switch between 12 and 24 hour format
Switch buttonTimeFormat = (Switch) findViewById(R.id.buttonTimeFormat);
buttonTimeFormat.setChecked(
settings.getBoolean(TactileClockService.TWENTY_FOUR_HOUR_FORMAT_KEY, true));
buttonTimeFormat.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
store24HourFormatOption(isChecked);
}
});

// start service
Intent intent = new Intent(this, TactileClockService.class);
startService(intent);
}

private void store24HourFormatOption(boolean checked) {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
Editor editor = settings.edit();
editor.putBoolean(TactileClockService.TWENTY_FOUR_HOUR_FORMAT_KEY, checked);
editor.commit();
}

}
23 changes: 23 additions & 0 deletions src/de/eric_scheibler/tactileclock/ScreenReceiver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package de.eric_scheibler.tactileclock;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class ScreenReceiver extends BroadcastReceiver {

@Override public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)
|| intent.getAction().equals(Intent.ACTION_SCREEN_ON)
|| intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
Intent i = new Intent(context, TactileClockService.class);
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
i.putExtra("screenOn", true);
} else {
i.putExtra("screenOn", false);
}
context.startService(i);
}
}

}
Loading

0 comments on commit 87aff78

Please sign in to comment.