Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions MemeProject/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion MemeProject/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions MemeProject/MemeProject.iml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="MemeProject" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
Expand Down
14 changes: 8 additions & 6 deletions MemeProject/app/app.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="MemeProject" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand All @@ -9,7 +9,6 @@
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
Expand All @@ -25,7 +24,6 @@
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
Expand Down Expand Up @@ -83,11 +81,15 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="butterknife-7.0.1" level="project" />
<orderEntry type="library" exported="" name="ormlite-android-4.48" level="project" />
<orderEntry type="library" exported="" name="ormlite-core-4.48" level="project" />
<orderEntry type="library" exported="" name="picasso-2.5.2" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.1.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-22.1.1" level="project" />
</component>
</module>

3 changes: 3 additions & 0 deletions MemeProject/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
}
4 changes: 2 additions & 2 deletions MemeProject/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</activity>

<activity
android:name=".EditPhoto"
android:name=".EditPhotoActivity"
android:label="@string/title_activity_edit_photo"
android:screenOrientation="portrait" >
<intent-filter>
Expand All @@ -30,7 +30,7 @@
</intent-filter>
</activity>

<activity android:name=".MemeList"
<activity android:name=".MemeListActivity"
android:label="MemeList"
android:screenOrientation="portrait">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import android.view.MotionEvent;
import android.view.View;

public class ColorPicker extends View {
public class ColorPickerView extends View {


/**
Expand Down Expand Up @@ -74,17 +74,17 @@ public class ColorPicker extends View {
*/
private float[] colorHSV = new float[]{0f, 0f, 1f};

public ColorPicker(Context context, AttributeSet attrs, int defStyle) {
public ColorPickerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}

public ColorPicker(Context context, AttributeSet attrs) {
public ColorPickerView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}

public ColorPicker(Context context) {
public ColorPickerView(Context context) {
super(context);
init();
}
Expand Down Expand Up @@ -307,7 +307,7 @@ public boolean onTouchEvent(MotionEvent event) {

invalidate();
}
EditPhoto.getInstance().setTopColor(getColor());
EditPhotoActivity.getInstance().setTopColor(getColor());
return true;
}
return super.onTouchEvent(event);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package madelyntav.c4q.nyc.memeproject;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;

import java.sql.SQLException;
import java.util.List;

public class DatabaseHelper extends OrmLiteSqliteOpenHelper {

private static final String MYDB = "mydb.db";
private static final int VERSION = 1;
private static DatabaseHelper mHelper;

public static synchronized DatabaseHelper getInstance(Context context) {
if (mHelper == null) {
mHelper = new DatabaseHelper(context.getApplicationContext());
}
return mHelper;
}

public DatabaseHelper(Context context) {
super(context, MYDB, null, VERSION);
}

@Override
public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {
try {
TableUtils.createTable(connectionSource, MemeTemplate.class);
} catch (SQLException e) {
e.printStackTrace();
}
}

@Override
public void onUpgrade(SQLiteDatabase database, ConnectionSource connectionSource, int oldVersion, int newVersion) {
try {
TableUtils.dropTable(connectionSource, MemeTemplate.class, true);
onCreate(database, connectionSource);
} catch (SQLException e) {
e.printStackTrace();
}
}

public void insertRow(String title, Integer resource_id) throws SQLException {
MemeTemplate memeTemplate = new MemeTemplate(title, resource_id);
getDao(MemeTemplate.class).create(memeTemplate);
}

public List<MemeTemplate> loadData() throws SQLException {
return getDao(MemeTemplate.class).queryForAll();
}
}
Loading