Skip to content

Commit

Permalink
RED-149 #time 90m Clean-up the code. Mark some methods with the depre…
Browse files Browse the repository at this point in the history
…cated annotation. Remove the overriding of the methods getSystemService and getLayoutInflator.
  • Loading branch information
ludovicroland committed Nov 16, 2017
1 parent cb0c5ea commit 2d58849
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 72 deletions.
7 changes: 2 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript

dependencies
{
classpath "com.android.tools.build:gradle:2.3.3"
classpath "com.android.tools.build:gradle:3.0.0"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
}
}
Expand All @@ -18,10 +18,7 @@ allprojects
repositories
{
jcenter()
maven
{
url "https://maven.google.com"
}
google()
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Mar 21 10:12:43 CET 2017
#Thu Nov 16 15:09:27 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
24 changes: 12 additions & 12 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ apply plugin: "maven-publish"

ext
{
appCompatVersion="25.4.0"
appCompatVersion="27.0.1"
}

android
{
compileSdkVersion 25
buildToolsVersion "25.0.3"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig
{
minSdkVersion 9
targetSdkVersion 25
minSdkVersion 14
targetSdkVersion 26

versionCode 20
versionName "2.5.3"
versionCode 21
versionName "2.5.4"
}

buildTypes
Expand All @@ -36,11 +36,11 @@ android
dependencies
{
//Android
compile("com.android.support:appcompat-v7:$appCompatVersion")
compile("com.android.support:preference-v7:$appCompatVersion")
implementation("com.android.support:appcompat-v7:$appCompatVersion")
implementation("com.android.support:preference-v7:$appCompatVersion")

testCompile("junit:junit:4.0")
testCompile("org.json:json:20090211")
testImplementation("junit:junit:4.0")
testImplementation("org.json:json:20090211")
}

task sourcesJar(type: Jar) {
Expand Down Expand Up @@ -139,7 +139,7 @@ bintray
repo = "maven"
name = "droid4me"
userOrg = "smartnsoft"
licenses = ["LGPL-2.1"]
licenses = ["MIT"]
vcsUrl = "https://github.com/smartnsoft/droid4me.git"
publish = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @author Édouard Mercier
* @since 2012.06.21
*/
@Deprecated
public interface AndroidLifeCycle
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public interface SystemServiceProvider
* @return the desired service, or {@code null} if no service corresponding to the provided {@code name} is available nor exists
* @see Activity#getSystemService(String)
*/
@Deprecated
Object getSystemService(Activity activity, String name, Object defaultService);

}
Expand Down Expand Up @@ -660,6 +661,7 @@ public void registerInterceptor(ActivityController.Interceptor interceptor)
* @return the service or {@code null} if the name does not exist
* @see #registerSystemServiceProvider(ActivityController.SystemServiceProvider)
*/
@Deprecated
public Object getSystemService(Activity activity, String name, Object defaultService)
{
if (systemServiceProvider != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data)
* @return the service or {@code null} if the name does not exist
* @see Context#getSystemService(String)
*/
@Deprecated
public Object getSystemService(String name, Object defaultService)
{
return ActivityController.getInstance().getSystemService(activity, name, defaultService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ protected void onDestroy()
}
}

@Override
public Object getSystemService(String name)
{
return droid4mizer.getSystemService(name, super.getSystemService(name));
}

@Override
public void onAttachedToWindow()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,6 @@ protected void onDestroy()
}
}

@Override
public Object getSystemService(String name)
{
return droid4mizer.getSystemService(name, super.getSystemService(name));
}

@Override
public void onAttachedToWindow()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@

package com.smartnsoft.droid4me.support.v4.app;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;

Expand Down Expand Up @@ -147,18 +145,6 @@ protected void onDestroy()
}
}

@Override
public LayoutInflater getLayoutInflater()
{
return (LayoutInflater) droid4mizer.getSystemService(Context.LAYOUT_INFLATER_SERVICE, super.getLayoutInflater());
}

@Override
public Object getSystemService(String name)
{
return droid4mizer.getSystemService(name, super.getSystemService(name));
}

@Override
public void onAttachedToWindow()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@

package com.smartnsoft.droid4me.support.v7.app;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;

Expand Down Expand Up @@ -147,25 +145,6 @@ protected void onDestroy()
}
}

@Override
public LayoutInflater getLayoutInflater()
{
return (LayoutInflater) droid4mizer.getSystemService(Context.LAYOUT_INFLATER_SERVICE, super.getLayoutInflater());
}

@Override
public Object getSystemService(String name)
{
if (Context.LAYOUT_INFLATER_SERVICE.equals(name) == true && getWindow() != null)
{
return droid4mizer.getSystemService(name, getWindow().getLayoutInflater());
}
else
{
return droid4mizer.getSystemService(name, super.getSystemService(name));
}
}

@Override
public void onAttachedToWindow()
{
Expand Down
10 changes: 5 additions & 5 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apply plugin: 'com.android.application'

android
{
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig
{
applicationId "com.smartnsoft.sample"

minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 26

versionCode 1
versionName "1.0"
Expand All @@ -29,6 +29,6 @@ android

dependencies
{
compile ("com.android.support:appcompat-v7:25.3.0")
compile (project(":library"))
implementation ("com.android.support:appcompat-v7:27.0.1")
implementation (project(":library"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected Void onRetrieveBusinessObjectsCustom()
{
try
{
Thread.sleep(15000);
Thread.sleep(2000);
}
catch (InterruptedException exception)
{
Expand Down

0 comments on commit 2d58849

Please sign in to comment.