Skip to content

Commit ce76cb1

Browse files
committed
noop and debug now can be installed on the same device simultaneously
updates readme updates app to use v0.3.0
1 parent 4be0f54 commit ce76cb1

File tree

9 files changed

+25
-14
lines changed

9 files changed

+25
-14
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,10 @@ Here is a piratical example to use default flavor in debug and noop in release:
351351
The `PopHoodActivity` will also respect the no-op switch and just finish.
352352
The no-op state can be checked with `Hood.isLibEnabled()` from any caller.
353353

354+
Here is a example of a noop view being rendered
355+
356+
![example image](doc/noop_example.png)
357+
354358
### Module `hood-extended`
355359

356360
Extends the `hood-core` with a default implementation of a debug activity

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ android {
3434

3535
buildTypes {
3636
debug {
37+
applicationIdSuffix '.debug'
3738
minifyEnabled false
3839
shrinkResources false
3940
}
4041

4142
releaseNoop {
43+
applicationIdSuffix '.noop'
4244
minifyEnabled true
4345
shrinkResources true
4446
signingConfig signingConfigs.release

app/src/main/java/at/favre/app/hood/demo/MainActivity.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
import android.databinding.DataBindingUtil;
44
import android.os.Bundle;
55
import android.support.annotation.Nullable;
6+
import android.support.v4.content.res.ResourcesCompat;
67
import android.support.v7.app.AppCompatActivity;
78
import android.util.Log;
89
import android.view.View;
910

1011
import at.favre.app.hood.demo.databinding.ActivityMainBinding;
12+
import at.favre.lib.hood.Hood;
1113
import at.favre.lib.hood.extended.PopHoodActivity;
1214

1315
public class MainActivity extends AppCompatActivity {
@@ -69,5 +71,10 @@ public void onClick(View view) {
6971
}
7072
});
7173
Log.d(TAG, "Main Activity started - Test debug log");
74+
75+
if (!Hood.isLibEnabled()) {
76+
findViewById(R.id.main_content).setBackgroundColor(ResourcesCompat.getColor(getResources(), R.color.disabled_background, null));
77+
setTitle(getTitle() + " (no-op)");
78+
}
7279
}
7380
}

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,15 @@
1616
tools:targetApi="lollipop"/>
1717

1818
<ScrollView
19+
android:id="@+id/main_content"
1920
android:layout_width="match_parent"
2021
android:layout_height="match_parent">
2122

2223
<LinearLayout
23-
xmlns:android="http://schemas.android.com/apk/res/android"
24-
xmlns:tools="http://schemas.android.com/tools"
2524
android:layout_width="match_parent"
2625
android:layout_height="wrap_content"
2726
android:layout_gravity="center"
2827
android:orientation="vertical">
29-
30-
3128
<Button
3229
android:id="@+id/btn_start_light"
3330
style="@style/Base.Widget.AppCompat.Button.Colored"

app/src/main/res/values/styles.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<resources>
2+
<color name="disabled_background">#838383</color>
23

34
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
45
<item name="colorPrimary">#62A869</item>
@@ -10,19 +11,19 @@
1011
<item name="android:background">?attr/colorPrimary</item>
1112
</style>
1213

13-
<style name="CustomHoodThemeLight" parent="HoodThemeBaseLight">
14+
<style name="CustomHoodThemeLight" parent="HoodThemeLight">
1415
<item name="colorPrimary">#9b26af</item>
1516
<item name="colorPrimaryDark">#7a1ea1</item>
1617
<item name="colorAccent">#68efad</item>
1718
</style>
1819

19-
<style name="CustomHoodThemeLight2" parent="HoodThemeBaseLight">
20+
<style name="CustomHoodThemeLight2" parent="HoodThemeLight">
2021
<item name="colorPrimary">#CDDC39</item>
2122
<item name="colorPrimaryDark">#AFB42B</item>
2223
<item name="colorAccent">#C62828</item>
2324
</style>
2425

25-
<style name="CustomHoodThemeLight3" parent="HoodThemeBaseLight">
26+
<style name="CustomHoodThemeLight3" parent="HoodThemeLight">
2627
<item name="colorPrimary">#FFC107</item>
2728
<item name="colorPrimaryDark">#FFA000</item>
2829
<item name="colorAccent">#6900FF</item>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ext {
2424
versionNameApp = "0.3.0"
2525
versionNameLib = "$versionNameApp"
2626
versionCode = 3
27-
versionNameDep = "0.2.3"
27+
versionNameDep = "0.3.0"
2828

2929

3030
compileSdkVersion = 25

doc/noop_example.png

18.5 KB
Loading

doc/playstore_banner.png

-1.94 KB
Loading

publish.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ bintray {
8282
key = properties.getProperty("bintray.apikey")
8383

8484
configurations = ['archives']
85-
filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec)
86-
from new File(project.buildDir, "outputs/aar")
87-
include '*-noop.aar'
88-
into "$group/$rootProject.ext.versionNameLib/"
89-
rename { name -> "hood-core-$rootProject.ext.versionNameLib-noop.aar" }
90-
}
85+
// filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec)
86+
// from new File(project.buildDir, "outputs/aar")
87+
// include '*-noop.aar'
88+
// into "$group/$rootProject.ext.versionNameLib/"
89+
// rename { name -> "hood-core-$rootProject.ext.versionNameLib-noop.aar" }
90+
// }
9191

9292
dryRun = false
9393
publish = true //Whether version should be auto published after an upload

0 commit comments

Comments
 (0)