Skip to content

Commit d08150d

Browse files
committed
Initial commit
0 parents  commit d08150d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1161
-0
lines changed

Diff for: .gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures

Diff for: .idea/.name

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/compiler.xml

+22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/copyright/profiles_settings.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/gradle.xml

+24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/misc.xml

+46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/modules.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: .idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

Diff for: app/build.gradle

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.0"
6+
7+
defaultConfig {
8+
applicationId "com.codepath.debuggingchallenges"
9+
minSdkVersion 21
10+
targetSdkVersion 24
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
testCompile 'junit:junit:4.12'
25+
compile 'com.android.support:appcompat-v7:24.0.0'
26+
compile 'com.loopj.android:android-async-http:1.4.9'
27+
compile 'com.squareup.picasso:picasso:2.5.2'
28+
compile group: 'com.google.guava', name: 'guava', version: '18.0'
29+
}

Diff for: app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/nickai/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.codepath.debuggingchallenges;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

Diff for: app/src/main/AndroidManifest.xml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.codepath.debuggingchallenges">
4+
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
7+
<application
8+
android:allowBackup="true"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:supportsRtl="true"
12+
android:theme="@style/AppTheme">
13+
<activity android:name=".activities.MainActivity">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
17+
<category android:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
<activity android:name=".activities.CurrentDayActivity" />
21+
<activity android:name=".activities.MoviesActivity" />
22+
<activity android:name=".activities.ChangeBackgroundActivity" />
23+
<activity
24+
android:name=".activities.ToolbarActivity"
25+
android:theme="@style/AppThemeNoActionBar" />
26+
<activity android:name=".activities.SearchHistoryActivity"></activity>
27+
</application>
28+
29+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.codepath.debuggingchallenges.activities;
2+
3+
import android.graphics.Color;
4+
import android.os.Bundle;
5+
import android.support.v7.app.AppCompatActivity;
6+
import android.view.View;
7+
8+
import com.codepath.debuggingchallenges.R;
9+
10+
public class ChangeBackgroundActivity extends AppCompatActivity {
11+
12+
private int oldColor = Color.BLUE;
13+
14+
@Override
15+
protected void onCreate(Bundle savedInstanceState) {
16+
super.onCreate(savedInstanceState);
17+
setContentView(R.layout.activity_change_background);
18+
}
19+
20+
public void onGoClick(View view) {
21+
View mainView = findViewById(android.R.id.content);
22+
mainView.setBackgroundColor(getNextColor());
23+
}
24+
25+
private int getNextColor() {
26+
int newColor = (oldColor == Color.BLUE) ? Color.RED : Color.BLUE;
27+
oldColor = newColor;
28+
return newColor;
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.codepath.debuggingchallenges.activities;
2+
3+
import android.os.Bundle;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.widget.TextView;
6+
7+
import com.codepath.debuggingchallenges.R;
8+
9+
import java.util.Calendar;
10+
11+
public class CurrentDayActivity extends AppCompatActivity {
12+
13+
TextView tvDay;
14+
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
setContentView(R.layout.activity_current_day);
19+
tvDay = (TextView) findViewById(R.id.tvDay);
20+
tvDay.setText(getDayOfMonth());
21+
}
22+
23+
private int getDayOfMonth() {
24+
Calendar cal = Calendar.getInstance();
25+
return cal.get(Calendar.DAY_OF_MONTH);
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.codepath.debuggingchallenges.activities;
2+
3+
import android.content.Intent;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.os.Bundle;
6+
import android.view.View;
7+
8+
import com.codepath.debuggingchallenges.R;
9+
10+
public class MainActivity extends AppCompatActivity {
11+
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_main);
16+
}
17+
18+
private void launchActivity(Class klass) {
19+
Intent intent = new Intent(this, klass);
20+
startActivity(intent);
21+
}
22+
23+
public void launchCurrentDayActivity(View view) {
24+
launchActivity(CurrentDayActivity.class);
25+
}
26+
27+
public void launchMoviesActivity(View view) {
28+
launchActivity(MoviesActivity.class);
29+
}
30+
31+
public void launchChangeBackgroundActivity(View view) {
32+
launchActivity(ChangeBackgroundActivity.class);
33+
}
34+
35+
public void launchToolbarActivity(View view) {
36+
launchActivity(ToolbarActivity.class);
37+
}
38+
39+
public void launchSearchHistoryActivity(View view) {
40+
launchActivity(SearchHistoryActivity.class);
41+
}
42+
}

0 commit comments

Comments
 (0)