Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/beta-development'
Browse files Browse the repository at this point in the history
  • Loading branch information
galadril committed Jun 16, 2016
2 parents 2edc1ed + 3b4550d commit 1ffc1f7
Show file tree
Hide file tree
Showing 318 changed files with 5,334 additions and 2,121 deletions.
95 changes: 74 additions & 21 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,45 @@ android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

//noinspection GroovyAssignabilityCheck
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 98
versionName '0.1.252'
multiDexEnabled true
def versionPropsFile = file('version.properties')

if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()

versionProps.load(new FileInputStream(versionPropsFile))
def value = 0
def runTasks = gradle.startParameter.taskNames
println "****************************"
println "runTasks: ${gradle.startParameter.taskNames}"

if ('assemble' in runTasks || 'assembleRelease' in runTasks || 'aR' in runTasks || ':app:compilePaidReleaseSources' in runTasks) {
value = 1;

println "Build Version: +1"
}
println "****************************"

def versionMajor = 0
def versionMinor = 1
def versionPatch = versionProps['VERSION_PATCH'].toInteger() + value
def versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
def version_Code = versionProps['VERSION_CODE'].toInteger() + value

versionProps['VERSION_PATCH'] = versionPatch.toString()
versionProps['VERSION_BUILD'] = versionBuild.toString()
versionProps['VERSION_CODE'] = version_Code.toString()

versionProps.store(versionPropsFile.newWriter(), null)

defaultConfig {
versionCode version_Code
versionName "${versionMajor}.${versionMinor}.${versionPatch} (${versionBuild})"
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
}
} else {
throw new GradleException("Could not read version.properties!")
}

//noinspection GroovyAssignabilityCheck
Expand Down Expand Up @@ -76,48 +108,69 @@ dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':libs:MemorizingTrustManager')

compile('com.github.afollestad.material-dialogs:core:0.8.5.7@aar') {
compile('com.github.afollestad.material-dialogs:core:0.8.5.8@aar') {
transitive = true
}
compile('com.github.afollestad.material-dialogs:commons:0.8.5.7@aar') {
compile('com.github.afollestad.material-dialogs:commons:0.8.5.8@aar') {
transitive = true
}

paidWearApp project(path: ':wear', configuration: 'paidRelease')

compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-v13:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v13:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'

compile 'com.android.support:multidex:1.0.1'
compile 'com.google.code.gson:gson:2.4'

compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'

compile 'com.mcxiaoke.volley:library:1.0.15'
compile 'com.android.support:design:23.2.1'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
compile 'com.marvinlabs:android-floatinglabel-widgets:1.6.1@aar'
compile 'com.splunk.mint:mint:5.0.0'
compile 'com.larswerkman:lobsterpicker:1.0.0'
compile 'com.larswerkman:lobsterpicker:1.0.1'
compile 'com.github.lecho:hellocharts-library:1.5.8@aar'

compile 'com.github.dexafree:MaterialList:v3.2.2'

compile 'com.github.hotchemi:android-rate:0.5.6'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.fenjuly:SpinnerLoader:fd5b8ab578'
compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
compile 'eu.inloop:easygcm:1.6.1@aar'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
compile 'com.github.jd-alexander:LikeButton:0.1.8'
compile 'jp.wasabeef:recyclerview-animators:2.2.1'
compile 'com.github.jd-alexander:LikeButton:0.2.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.3'
compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
compile('com.mikepenz:materialdrawer:5.2.2@aar') {
transitive = true
}

compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
compile 'com.github.zagum:SpeechRecognitionView:1.0.2'

compile project(path: ':SeekArc_library')
compile project(path: ':materialIntro_library')
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms.google-services'

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}

apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'
50 changes: 35 additions & 15 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>

<uses-feature
android:name="android.hardware.nfc"
Expand All @@ -39,13 +40,17 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name_domoticz"
android:theme="@style/AppTheme"
android:theme="@style/AppThemeMain"
tools:replace="android:icon, android:label, android:theme, android:name">

<activity android:name=".Service.NFCServiceActivity">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />

<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="www.domoticz.com"
android:pathPrefix="/app"
android:scheme="http" />
</intent-filter>

<meta-data
Expand All @@ -54,11 +59,17 @@
</activity>

<service android:name=".Service.GeofenceTransitionsIntentService" />

<service android:name=".Service.WearMessageListenerService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
<action android:name="com.google.android.gms.wearable.DATA_CHANGED" />
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
<action android:name="com.google.android.gms.wearable.CAPABILITY_CHANGED" />
<action android:name="com.google.android.gms.wearable.CHANNEL_EVENT" />
<data android:scheme="wear" android:host="*" />
</intent-filter>
</service>

<service
android:name=".Service.TaskService"
android:exported="true"
Expand All @@ -77,6 +88,7 @@
android:name="android.appwidget.provider"
android:resource="@xml/appwidgetprovider" />
</receiver>

<receiver android:name=".Service.WidgetIntentReceiver">
<intent-filter>
<action android:name="nl.hnogames.domoticz.Service.WIDGET_TOGGLE_ACTION" />
Expand All @@ -86,15 +98,6 @@
android:name="android.appwidget.provider"
android:resource="@xml/appwidgetprovider" />
</receiver>
<receiver android:name=".Service.BootUpReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/appwidgetprovider" />
</receiver>

<activity
android:name=".WidgetConfigurationActivity"
Expand All @@ -106,28 +109,39 @@
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>

<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>

<activity
android:name=".WidgetActionActivity"
android:configChanges="orientation|screenSize"
android:label="Domoticz Widget Action" />

<service android:name=".Service.WidgetProviderLarge$UpdateWidgetService" />

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

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/appwidgetprovider" />
</receiver>

<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:label="@string/app_name_domoticz"
android:launchMode="singleTop">

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
Expand Down Expand Up @@ -207,6 +221,12 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".SpeechSettingsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/category_Speech"
android:parentActivityName=".SettingsActivity"></activity>
<activity
android:name=".QRCodeSettingsActivity"
android:configChanges="orientation|screenSize"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Data
public static final int ID_SCENE_SWITCH = 2000;
private final int ID_TEXTVIEW = 1000;
private final int ID_SWITCH = 0;
private boolean showAsList = false;

private final int[] EVOHOME_STATE_IDS = {
Domoticz.Device.ModalSwitch.Action.AUTO,
Domoticz.Device.ModalSwitch.Action.ECONOMY,
Expand All @@ -70,12 +68,11 @@ public class DashboardAdapter extends RecyclerView.Adapter<DashboardAdapter.Data
Domoticz.Device.ModalSwitch.Action.CUSTOM,
Domoticz.Device.ModalSwitch.Action.HEATING_OFF
};

private Domoticz domoticz;
private Context context;
public ArrayList<DevicesInfo> data = null;
public ArrayList<DevicesInfo> filteredData = null;

private boolean showAsList = false;
private Domoticz domoticz;
private Context context;
private switchesClickListener listener;
private int previousDimmerValue;
private SharedPrefUtil mSharedPrefs;
Expand Down Expand Up @@ -315,13 +312,8 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
setButtons(holder, Buttons.BLINDS);
setBlindsRowData(mDeviceInfo, holder);
} else {
if (mSharedPrefs.showSwitchesAsButtons()) {
setButtons(holder, Buttons.BUTTONS);
setOnOffButtonRowData(mDeviceInfo, holder);
} else {
setButtons(holder, Buttons.BUTTONS);
setOnOffSwitchRowData(mDeviceInfo, holder);
}
setButtons(holder, Buttons.BUTTONS);
setOnOffButtonRowData(mDeviceInfo, holder);
}
break;

Expand Down Expand Up @@ -615,7 +607,7 @@ private void setOnOffSwitchRowData(final DevicesInfo mDeviceInfo,
else
holder.onOffSwitch.setId(mDeviceInfo.getIdx());

holder.onOffSwitch.setOnCheckedChangeListener (null);
holder.onOffSwitch.setOnCheckedChangeListener(null);
holder.onOffSwitch.setChecked(mDeviceInfo.getStatusBoolean());
holder.onOffSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
Expand Down Expand Up @@ -1032,11 +1024,11 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo,
holder.switch_battery_level.setText(text);
}

int loadLevel = (mDeviceInfo.getLevel()-1) / 10;
int loadLevel = (mDeviceInfo.getLevel() - 1) / 10;
final String[] levelNames = mDeviceInfo.getLevelNames();
String statusText = context.getString(R.string.unknown);

if (levelNames.length > loadLevel)
if (levelNames != null && levelNames.length > loadLevel)
statusText = levelNames[loadLevel];

holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW);
Expand All @@ -1045,7 +1037,7 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo,
if (holder.dimmerOnOffSwitch != null) {
holder.dimmerOnOffSwitch.setId(mDeviceInfo.getIdx() + ID_SWITCH);

holder.dimmerOnOffSwitch.setOnCheckedChangeListener (null);
holder.dimmerOnOffSwitch.setOnCheckedChangeListener(null);
holder.dimmerOnOffSwitch.setChecked(mDeviceInfo.getStatusBoolean());
holder.dimmerOnOffSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
Expand Down Expand Up @@ -1106,7 +1098,9 @@ public void onClick(View v) {

holder.dimmer.incrementProgressBy(1);
holder.dimmer.setProgress(loadLevel);
holder.dimmer.setMax(levelNames.length - 1);

if (levelNames != null && levelNames.length > 0)
holder.dimmer.setMax(levelNames.length - 1);
holder.dimmer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -1201,7 +1195,7 @@ private void setDimmerRowData(final DevicesInfo mDeviceInfo,

holder.dimmerOnOffSwitch.setId(mDeviceInfo.getIdx() + ID_SWITCH);

holder.dimmerOnOffSwitch.setOnCheckedChangeListener (null);
holder.dimmerOnOffSwitch.setOnCheckedChangeListener(null);
holder.dimmerOnOffSwitch.setChecked(mDeviceInfo.getStatusBoolean());
holder.dimmerOnOffSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
Expand Down Expand Up @@ -1250,14 +1244,18 @@ public void onStartTrackingTouch(SeekBar seekBar) {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
int progress = seekBar.getProgress();
Switch dimmerOnOffSwitch = (Switch) seekBar.getRootView()
.findViewById(mDeviceInfo.getIdx() + ID_SWITCH);

if (progress == 0 && dimmerOnOffSwitch.isChecked()) {
dimmerOnOffSwitch.setChecked(false);
seekBar.setProgress(previousDimmerValue);
} else if (progress > 0 && !dimmerOnOffSwitch.isChecked())
dimmerOnOffSwitch.setChecked(true);
Switch dimmerOnOffSwitch = null;
try {
dimmerOnOffSwitch = (Switch) seekBar.getRootView()
.findViewById(mDeviceInfo.getIdx() + ID_SWITCH);
if (progress == 0 && dimmerOnOffSwitch.isChecked()) {
dimmerOnOffSwitch.setChecked(false);
seekBar.setProgress(previousDimmerValue);
} else if (progress > 0 && !dimmerOnOffSwitch.isChecked()) {
dimmerOnOffSwitch.setChecked(true);
}
} catch (Exception ex) {/*else we don't use a switch, but buttons */}

handleDimmerChange(mDeviceInfo.getIdx(), progress + 1, false);
mDeviceInfo.setLevel(progress);
}
Expand Down
Loading

0 comments on commit 1ffc1f7

Please sign in to comment.