-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
348 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion ANDROID_TARGET_SDK | ||
buildToolsVersion ANDROID_BUILD_TOOLS | ||
compileSdkVersion ANDROID_TARGET_SDK | ||
buildToolsVersion ANDROID_BUILD_TOOLS | ||
|
||
defaultConfig { | ||
applicationId "me.piruin.doggyactivity.sample" | ||
minSdkVersion ANDROID_MIN_SDK | ||
targetSdkVersion ANDROID_TARGET_SDK | ||
versionCode 1 | ||
versionName rootProject.version | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
defaultConfig { | ||
applicationId "me.piruin.doggyactivity.sample" | ||
minSdkVersion ANDROID_MIN_SDK | ||
targetSdkVersion ANDROID_TARGET_SDK | ||
versionCode 1 | ||
versionName rootProject.version | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JAVA_VERSION | ||
targetCompatibility JAVA_VERSION | ||
} | ||
compileOptions { | ||
sourceCompatibility JAVA_VERSION | ||
targetCompatibility JAVA_VERSION | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile project(':doggy-activity') | ||
compile "com.android.support:appcompat-v7:$ANDROID_SUPPORT_VERSION" | ||
testCompile 'junit:junit:4.12' | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile project(':doggy-activity') | ||
compile "com.android.support:appcompat-v7:$ANDROID_SUPPORT_VERSION" | ||
testCompile 'junit:junit:4.12' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="me.piruin.doggyactivity.sample"> | ||
package="me.piruin.doggyactivity.sample"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".SampleActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".SampleActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
36 changes: 29 additions & 7 deletions
36
doggy-activity-sample/src/main/java/me/piruin/doggyactivity/sample/SampleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
package me.piruin.doggyactivity.sample; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
import android.widget.Toast; | ||
import me.piruin.doggyactivity.DoggyActivity; | ||
|
||
public class SampleActivity extends AppCompatActivity { | ||
public class SampleActivity extends DoggyActivity { | ||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_sample); | ||
} | ||
|
||
@Override public void onScreenOff() { | ||
super.onScreenOff(); | ||
Toast.makeText(this, "Who turn of the light", Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override public void onScreenOn() { | ||
super.onScreenOn(); | ||
Toast.makeText(this, "Screen on Again", Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override public void onUserLeave(boolean systemInterrupt) { | ||
super.onUserLeave(systemInterrupt); | ||
Toast.makeText(this, "User Leave", Toast.LENGTH_SHORT).show(); | ||
|
||
} | ||
|
||
@Override public void onUserBack() { | ||
super.onUserBack(); | ||
Toast.makeText(this, "User is Back, ha ha", Toast.LENGTH_SHORT).show(); | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_sample); | ||
} | ||
} |
31 changes: 16 additions & 15 deletions
31
doggy-activity-sample/src/main/res/layout/activity_sample.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/activity_sample" | ||
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" | ||
tools:context="me.piruin.doggyactivity.sample.SampleActivity"> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/activity_sample" | ||
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" | ||
tools:context="me.piruin.doggyactivity.sample.SampleActivity" | ||
> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!"/> | ||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
/> | ||
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<resources> | ||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml | ||
(such as screen margins) for screens with more than 820dp of available width. This | ||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | ||
<dimen name="activity_horizontal_margin">64dp</dimen> | ||
<!-- Example customization of dimensions originally defined in res/values/dimens.xml | ||
(such as screen margins) for screens with more than 820dp of available width. This | ||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). --> | ||
<dimen name="activity_horizontal_margin">64dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#3F51B5</color> | ||
<color name="colorPrimaryDark">#303F9F</color> | ||
<color name="colorAccent">#FF4081</color> | ||
<color name="colorPrimary">#3F51B5</color> | ||
<color name="colorPrimaryDark">#303F9F</color> | ||
<color name="colorAccent">#FF4081</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<resources> | ||
<!-- Default screen margins, per the Android Design guidelines. --> | ||
<dimen name="activity_horizontal_margin">16dp</dimen> | ||
<dimen name="activity_vertical_margin">16dp</dimen> | ||
<!-- Default screen margins, per the Android Design guidelines. --> | ||
<dimen name="activity_horizontal_margin">16dp</dimen> | ||
<dimen name="activity_vertical_margin">16dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<resources> | ||
<string name="app_name">DoggyActivity</string> | ||
<string name="app_name">DoggyActivity</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<resources> | ||
|
||
<!-- Base application theme. --> | ||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
<!-- Customize your theme here. --> | ||
<item name="colorPrimary">@color/colorPrimary</item> | ||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
<item name="colorAccent">@color/colorAccent</item> | ||
</style> | ||
<!-- Base application theme. --> | ||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
<!-- Customize your theme here. --> | ||
<item name="colorPrimary">@color/colorPrimary</item> | ||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
<item name="colorAccent">@color/colorAccent</item> | ||
</style> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion ANDROID_TARGET_SDK | ||
buildToolsVersion ANDROID_BUILD_TOOLS | ||
compileSdkVersion ANDROID_TARGET_SDK | ||
buildToolsVersion ANDROID_BUILD_TOOLS | ||
|
||
defaultConfig { | ||
minSdkVersion ANDROID_MIN_SDK | ||
targetSdkVersion ANDROID_TARGET_SDK | ||
} | ||
defaultConfig { | ||
minSdkVersion ANDROID_MIN_SDK | ||
targetSdkVersion ANDROID_TARGET_SDK | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JAVA_VERSION | ||
targetCompatibility JAVA_VERSION | ||
} | ||
compileOptions { | ||
sourceCompatibility JAVA_VERSION | ||
targetCompatibility JAVA_VERSION | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError true | ||
checkAllWarnings true | ||
warningsAsErrors true | ||
} | ||
lintOptions { | ||
abortOnError true | ||
checkAllWarnings true | ||
warningsAsErrors true | ||
} | ||
|
||
packagingOptions { | ||
exclude 'LICENSE.txt' | ||
exclude 'META-INF/DEPENDENCIES' | ||
exclude 'META-INF/ASL2.0' | ||
exclude 'META-INF/NOTICE' | ||
exclude 'META-INF/LICENSE' | ||
} | ||
packagingOptions { | ||
exclude 'LICENSE.txt' | ||
exclude 'META-INF/DEPENDENCIES' | ||
exclude 'META-INF/ASL2.0' | ||
exclude 'META-INF/NOTICE' | ||
exclude 'META-INF/LICENSE' | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile "com.android.support:appcompat-v7:$ANDROID_SUPPORT_VERSION" | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile "com.android.support:appcompat-v7:$ANDROID_SUPPORT_VERSION" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="me.piruin.doggyactivity"> | ||
</manifest> | ||
<manifest package="me.piruin.doggyactivity"></manifest> |
Oops, something went wrong.