Skip to content

Commit

Permalink
Version 2.1.0
Browse files Browse the repository at this point in the history
- Added announcement vibration for watch
- Removed auto-disable watch feature
- Support for Android api 29 (Q)
- Migration to AndroidX
- Code cleanup and bug fixes
  • Loading branch information
scheibler committed Jun 7, 2020
1 parent 58004cc commit a673688
Show file tree
Hide file tree
Showing 32 changed files with 592 additions and 1,152 deletions.
50 changes: 33 additions & 17 deletions CHANGES → CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
v1.0.0: Released at 2016-05-03
- initial release.
# Change log

v1.0.1: Released at 2016-05-06
- added tabs
- improved application description

v1.0.2: Released at 2016-08-07
- Added switch to enable and disable the service
- Material design
- New project website at the info tab
## v2.1.0: Released at 2020-06-06
- Added announcement vibration for watch
- Removed auto-disable watch feature
- Support for Android api 29 (Q)
- Migration to AndroidX
- Code cleanup and bug fixes

v1.1.0: Released at 2016-10-03
- New options:
- Time component order: choose between hours,minutes and minutes,hours
- Warn vibration, if display was turned off,on instead of on,off
- Time interval changes (upper boundary pushed from 1000 to 1500 ms)

v2.0.0: Released at 2018-01-08
## v2.0.1: Released at 2018-01-12
- Additional space character in application title


## v2.0.0: Released at 2018-01-08
- Converted into Gradle project
- Supports API 27 (Android 8.1)
- Layout changes:
Expand All @@ -27,6 +24,25 @@ v2.0.0: Released at 2018-01-08
- Option to select the power button shortcut click interval
- Fixed several small bugs

v2.0.1: Released at 2018-01-12
- Additional space character in application title

## v1.1.0: Released at 2016-10-03
- New options:
- Time component order: choose between hours,minutes and minutes,hours
- Warn vibration, if display was turned off,on instead of on,off
- Time interval changes (upper boundary pushed from 1000 to 1500 ms)


## v1.0.2: Released at 2016-08-07
- Added switch to enable and disable the service
- Material design
- New project website at the info tab


## v1.0.1: Released at 2016-05-06
- added tabs
- improved application description


## v1.0.0: Released at 2016-05-03
- initial release.

28 changes: 20 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (keystoreProperties.isEmpty()) {

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
buildToolsVersion "29.0.3"

compileOptions {
sourceCompatibility 1.8
Expand All @@ -33,8 +33,11 @@ android {
minSdkVersion 16
targetSdkVersion 29
resConfigs "en", "de"
versionCode 7
versionName '2.0.2'
versionCode 8
versionName '2.1.0'
// project website
buildConfigField 'String', 'CONTACT_EMAIL_ADDRESS', '"[email protected]"'
buildConfigField 'String', 'PROJECT_WEBSITE', '"https://github.com/scheibler/TactileClock"'
// set .apk name
setProperty("archivesBaseName", "${archivesBaseName}-$versionName")
}
Expand All @@ -56,14 +59,23 @@ android {
}

lintOptions {
disable "StaticFieldLeak", "InflateParams", "GoogleAppIndexingWarning",
"ButtonStyle", "UseSparseArrays", "UseCompoundDrawables",
"DefaultLocale", "AllowBackup", "IconLauncherShape", "Autofill", "GradleCompatible"
disable "GoogleAppIndexingWarning", "ButtonStyle", "UseSparseArrays",
"UseCompoundDrawables", "AllowBackup", "IconLauncherShape", "Autofill"
}
}

dependencies {
//implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.android.support:design:28.0.0'
// androidX
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core:1.3.0'
implementation 'androidx.drawerlayout:drawerlayout:1.0.0'
implementation 'androidx.fragment:fragment:1.2.4'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
// material design
implementation 'com.google.android.material:material:1.1.0'
// guava
implementation 'com.google.guava:guava:28.2-android'
// logging
implementation 'com.jakewharton.timber:timber:4.7.1'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package de.eric_scheibler.tactileclock.data;

import java.util.HashMap;
import java.util.Map;


public enum HourFormat {
TWELVE_HOURS("12hours"),
TWENTYFOUR_HOURS("24hours");

private final String code;
private static final Map<String,HourFormat> valuesByCode;

static {
valuesByCode = new HashMap<String,HourFormat>();
for(HourFormat hourFormat : HourFormat.values()) {
valuesByCode.put(hourFormat.code, hourFormat);
}
}

public static HourFormat lookupByCode(String code) {
if (code == null || valuesByCode.get(code) == null)
return TWENTYFOUR_HOURS; // default value
return valuesByCode.get(code);
}

private HourFormat(String code) {
this.code = code;
}

public String getCode() {
return code;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package de.eric_scheibler.tactileclock.data;

import java.util.HashMap;
import java.util.Map;


public enum TimeComponentOrder {
HOURS_MINUTES("hoursMinutes"),
MINUTES_HOURS("minutesHours");

private final String code;
private static final Map<String,TimeComponentOrder> valuesByCode;

static {
valuesByCode = new HashMap<String,TimeComponentOrder>();
for(TimeComponentOrder timeComponentOrder : TimeComponentOrder.values()) {
valuesByCode.put(timeComponentOrder.code, timeComponentOrder);
}
}

public static TimeComponentOrder lookupByCode(String code) {
if (code == null || valuesByCode.get(code) == null)
return HOURS_MINUTES; // default value
return valuesByCode.get(code);
}

private TimeComponentOrder(String code) {
this.code = code;
}

public String getCode() {
return code;
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
package de.eric_scheibler.tactileclock.ui.activity;

import android.content.BroadcastReceiver;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import androidx.appcompat.app.AppCompatActivity;

import de.eric_scheibler.tactileclock.ui.dialog.HelpDialog;
import de.eric_scheibler.tactileclock.utils.SettingsManager;
import android.support.v4.content.LocalBroadcastManager;
import android.content.Context;
import de.eric_scheibler.tactileclock.utils.Constants;


public abstract class AbstractActivity extends AppCompatActivity {
Expand All @@ -19,14 +14,12 @@ public abstract class AbstractActivity extends AppCompatActivity {

@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
settingsManagerInstance = SettingsManager.getInstance(this);
settingsManagerInstance = new SettingsManager();
}


@Override public void onPause() {
super.onPause();
// unregister broadcast receiver
LocalBroadcastManager.getInstance(this).unregisterReceiver(mMessageReceiver);
}

@Override public void onResume() {
Expand All @@ -35,18 +28,6 @@ public abstract class AbstractActivity extends AppCompatActivity {
HelpDialog.newInstance().show(
getSupportFragmentManager(), "HelpDialog");
}
// register broadcast receiver to listen to messages from dtPlayer
LocalBroadcastManager.getInstance(this).registerReceiver(
mMessageReceiver, new IntentFilter(Constants.CustomAction.RELOAD_UI));
}


private BroadcastReceiver mMessageReceiver = new BroadcastReceiver() {
@Override public void onReceive(Context context, Intent intent) {
if (Constants.CustomAction.RELOAD_UI.equals(intent.getAction())) {
AbstractActivity.this.recreate();
}
}
};

}
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
package de.eric_scheibler.tactileclock.ui.activity;


import android.os.Build;
import android.os.Bundle;

import android.support.v7.widget.Toolbar;

import android.text.Html;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.method.LinkMovementMethod;

import android.widget.TextView;

import androidx.appcompat.widget.Toolbar;

import de.eric_scheibler.tactileclock.BuildConfig;
import de.eric_scheibler.tactileclock.R;
import de.eric_scheibler.tactileclock.ui.activity.AbstractActivity;


public class InfoActivity extends AbstractActivity {

private TextView labelApplicationVersion;

@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_info);
Expand All @@ -27,21 +30,43 @@ public class InfoActivity extends AbstractActivity {
getSupportActionBar().setTitle(
getResources().getString(R.string.infoActivityTitle));

labelApplicationVersion = (TextView) findViewById(R.id.labelApplicationVersion);
}

@Override public void onResume() {
super.onResume();
updateUI();
}

private void updateUI() {
TextView labelApplicationVersion = (TextView) findViewById(R.id.labelApplicationVersion);
labelApplicationVersion.setText(
String.format(
"%1$s%2$s",
getResources().getString(R.string.labelApplicationVersion),
settingsManagerInstance.getApplicationVersion())
);

TextView labelEmailAddress = (TextView) findViewById(R.id.labelEmailAddress);
labelEmailAddress.setText(
String.format(
getResources().getString(R.string.labelEmailAddress),
BuildConfig.CONTACT_EMAIL_ADDRESS)
);

TextView labelWebsite = (TextView) findViewById(R.id.labelWebsite);
labelWebsite.setMovementMethod(LinkMovementMethod.getInstance());
labelWebsite.setText(
fromHtml(
String.format(
getResources().getString(R.string.labelWebsite),
BuildConfig.PROJECT_WEBSITE)
)
);
}

@SuppressWarnings("deprecation")
private static Spanned fromHtml(String html){
if (html == null) {
return new SpannableString("");
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
// FROM_HTML_MODE_LEGACY is the behaviour that was used for versions below android N
// we are using this flag to give a consistent behaviour
return Html.fromHtml(html, Html.FROM_HTML_MODE_LEGACY);
} else {
return Html.fromHtml(html);
}
}

}
Loading

0 comments on commit a673688

Please sign in to comment.