-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "com.example.myapplication" | ||
minSdkVersion 23 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation 'com.android.support:appcompat-v7:28.0.0' | ||
implementation 'com.android.support:support-v4:28.0.0' | ||
implementation 'com.android.support:design:28.0.0' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
implementation 'com.android.support:recyclerview-v7:28.0.0' | ||
implementation "android.arch.persistence.room:runtime:1.1.1" | ||
annotationProcessor "android.arch.persistence.room:compiler:1.1.1" | ||
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion" | ||
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion" | ||
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion" | ||
implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion" | ||
annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.myapplication; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.example.myapplication", appContext.getPackageName()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.example.myapplication"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/logo" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/logo" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme" | ||
tools:ignore="GoogleAppIndexingWarning"> | ||
<activity | ||
android:name=".TaskDescription" | ||
android:label="@string/title_activity_task_description" | ||
android:parentActivityName=".TaskList" | ||
android:theme="@style/AppTheme.NoActionBar"> | ||
<meta-data | ||
android:name="android.support.PARENT_ACTIVITY" | ||
android:value="com.example.myapplication.TaskList" /> | ||
</activity> | ||
<activity | ||
android:name=".TaskList" | ||
android:label="@string/title_activity_task_list" | ||
android:theme="@style/AppTheme.NoActionBar" /> | ||
<activity | ||
android:name=".MainActivity" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme.NoActionBar"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<meta-data | ||
android:name="preloaded_fonts" | ||
android:resource="@array/preloaded_fonts" /> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.example.myapplication; | ||
|
||
import android.arch.persistence.room.Database; | ||
import android.arch.persistence.room.RoomDatabase; | ||
import android.arch.persistence.room.TypeConverters; | ||
|
||
/** | ||
* room database for the app | ||
*/ | ||
@Database(entities = { Task.class }, version = 8,exportSchema = false) | ||
@TypeConverters({Converters.class}) | ||
public abstract class AppDatabase extends RoomDatabase { | ||
|
||
public abstract TaskDAO taskDAO(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.example.myapplication; | ||
|
||
import android.arch.persistence.room.TypeConverter; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class Converters { | ||
/** | ||
* converter from task list to string, required to save the list in the database | ||
* @param list is the list of tasks | ||
* @return the string that is used to save the list in the database | ||
*/ | ||
@TypeConverter | ||
public String listToString(ArrayList<String> list){ | ||
StringBuilder converted= new StringBuilder(); | ||
for (String s : list) converted.append(s).append("\n"); | ||
return converted.toString(); | ||
} | ||
|
||
/** | ||
* converter from a string that is saved in the database to list that is used in the app | ||
* @param string is the string that is saved in the database | ||
* @return the list to use in the app | ||
*/ | ||
@TypeConverter | ||
public ArrayList<String> stringToList(String string){ | ||
ArrayList<String> converted=new ArrayList<>(); | ||
while (!string.isEmpty()){ | ||
converted.add(string.substring(0,string.indexOf('\n'))); | ||
string=string.substring(string.indexOf('\n')+1); | ||
} | ||
return converted; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.example.myapplication; | ||
|
||
/** | ||
* an interface for an item touch helper that has a method for onItemMove | ||
*/ | ||
public interface ItemTouchHelperAdapter { | ||
void onItemMove(int fromPosition, int toPosition); | ||
|
||
} |