Skip to content

Commit

Permalink
Doggy can work now
Browse files Browse the repository at this point in the history
  • Loading branch information
piruin committed Nov 10, 2016
1 parent 1260df4 commit 6ebc807
Show file tree
Hide file tree
Showing 15 changed files with 348 additions and 128 deletions.
30 changes: 15 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@ version = '0.1'


buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}

allprojects {
repositories {
jcenter()
}
repositories {
jcenter()
}
}

ext {
JAVA_VERSION = JavaVersion.VERSION_1_7
JAVA_VERSION = JavaVersion.VERSION_1_7

ANDROID_MIN_SDK = 19
ANDROID_TARGET_SDK = 25
ANDROID_BUILD_TOOLS = "25.0.0"
ANDROID_SUPPORT_VERSION = "25.0.0"
ANDROID_MIN_SDK = 19
ANDROID_TARGET_SDK = 25
ANDROID_BUILD_TOOLS = "25.0.0"
ANDROID_SUPPORT_VERSION = "25.0.0"

githubRepo = 'piruin/doggy-activity'
githubRepo = 'piruin/doggy-activity'
}
46 changes: 23 additions & 23 deletions doggy-activity-sample/build.gradle
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'
}
28 changes: 14 additions & 14 deletions doggy-activity-sample/src/main/AndroidManifest.xml
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>
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 doggy-activity-sample/src/main/res/layout/activity_sample.xml
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>
8 changes: 4 additions & 4 deletions doggy-activity-sample/src/main/res/values-w820dp/dimens.xml
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>
6 changes: 3 additions & 3 deletions doggy-activity-sample/src/main/res/values/colors.xml
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>
6 changes: 3 additions & 3 deletions doggy-activity-sample/src/main/res/values/dimens.xml
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>
2 changes: 1 addition & 1 deletion doggy-activity-sample/src/main/res/values/strings.xml
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>
14 changes: 7 additions & 7 deletions doggy-activity-sample/src/main/res/values/styles.xml
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>
58 changes: 29 additions & 29 deletions doggy-activity/build.gradle
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"
}
4 changes: 1 addition & 3 deletions doggy-activity/src/main/AndroidManifest.xml
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>
Loading

0 comments on commit 6ebc807

Please sign in to comment.