├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── pencil.jpg │ │ │ │ ├── check_icon.png │ │ │ │ ├── classroom.jpg │ │ │ │ ├── mountains.jpg │ │ │ │ ├── circle.xml │ │ │ │ ├── circle2.xml │ │ │ │ ├── circle_subject_solved.xml │ │ │ │ ├── ic_baseline_add_24.xml │ │ │ │ ├── ic_baseline_notes_24.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── ic_launcher_round.png │ │ │ │ └── ic_launcher_foreground.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── exam_item_test.xml │ │ │ │ ├── dialog_number_of_questions.xml │ │ │ │ ├── exam_item.xml │ │ │ │ ├── activity_add_exam_item.xml │ │ │ │ ├── activity_update_delete_item.xml │ │ │ │ ├── activity_test_subjects.xml │ │ │ │ └── activity_main.xml │ │ │ ├── menu │ │ │ │ └── settings_menu.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── ic_launcher-playstore.png │ │ ├── java │ │ │ └── remcv │ │ │ │ └── com │ │ │ │ └── github │ │ │ │ └── examprep │ │ │ │ ├── utils │ │ │ │ ├── TableConstants.java │ │ │ │ └── Utils.java │ │ │ │ ├── controller │ │ │ │ ├── DatabaseCrud.java │ │ │ │ └── DatabaseHandler.java │ │ │ │ ├── view │ │ │ │ ├── MyDialogDatePicker.java │ │ │ │ ├── ExamItemAdapter.java │ │ │ │ └── DialogNumberOfQuestions.java │ │ │ │ ├── model │ │ │ │ └── ExamItem.java │ │ │ │ ├── TestSubjectsActivity.java │ │ │ │ ├── AddExamItemActivity.java │ │ │ │ ├── UpdateDeleteItemActivity.java │ │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── remcv │ │ │ └── com │ │ │ └── github │ │ │ └── examprep │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── remcv │ │ └── com │ │ └── github │ │ └── examprep │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── screenshots └── Screenshot_03.jpg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── vcs.xml ├── render.experimental.xml ├── misc.xml ├── runConfigurations.xml ├── gradle.xml ├── jarRepositories.xml └── codeStyles │ └── Project.xml ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "ExamPrep" -------------------------------------------------------------------------------- /screenshots/Screenshot_03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/screenshots/Screenshot_03.jpg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/pencil.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/drawable/pencil.jpg -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/check_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/drawable/check_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/classroom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/drawable/classroom.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/mountains.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/drawable/mountains.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/remcv/ExamPrep-Android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/render.experimental.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #2E7D32 4 | #2E7D32 5 | #3949AB 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Aug 03 07:11:37 EEST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ExamPrep 3 | solved 4 | subject is solved 5 | Import 6 | Add 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/exam_item_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/circle_subject_solved.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_add_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_notes_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/remcv/com/github/examprep/utils/TableConstants.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep.utils; 2 | 3 | public interface TableConstants 4 | { 5 | public static final String CATEGORY_NUMBER = "categoryNumber"; 6 | public static final String PROBLEM = "problem"; 7 | public static final String INDEX = "index"; 8 | public static final String BUTTON_NAME = "buttonName"; 9 | public static final String IS_DONE = "isDone"; 10 | public static final String RANDOM_LIST = "randomList"; 11 | } 12 | -------------------------------------------------------------------------------- /app/src/test/java/remcv/com/github/examprep/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest 13 | { 14 | @Test 15 | public void addition_isCorrect() 16 | { 17 | assertEquals(4, 2 + 2); 18 | } 19 | } -------------------------------------------------------------------------------- /app/src/main/java/remcv/com/github/examprep/controller/DatabaseCrud.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep.controller; 2 | 3 | import java.io.File; 4 | import java.util.List; 5 | 6 | public interface DatabaseCrud 7 | { 8 | public abstract boolean add(T item); 9 | public abstract T read(int id); 10 | public abstract boolean update(T item); 11 | public abstract boolean delete(int id); 12 | public abstract void loadDb(File databaseFile); 13 | public abstract void saveDb(File databaseFile); 14 | public abstract String getDatabasePath(); 15 | public abstract List getList(); 16 | } 17 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ExamPrep 2 | 3 | Simple Android application to help you prepare for your exams. 4 | 5 | ### How it works 6 | Randomly select a predefined number of questions from a list of questions. 7 | 8 | ### Features 9 | - add, update, delete exam items 10 | - countdown of the number of days until your exam (can be modified by the user) 11 | - the user can check and exclude the problems already solved 12 | - upload your own list of questions in .tsv format (number\tsubject\tisSolved) from your Android phone 13 | - test yourself with a user-determined number of random questions 14 | 15 | ### Screenshot 16 | 17 | ![App screenshot](/screenshots/Screenshot_03.jpg) 18 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_number_of_questions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/remcv/com/github/examprep/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest 20 | { 21 | @Test 22 | public void useAppContext() 23 | { 24 | // Context of the app under test. 25 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 26 | assertEquals("remcv.com.github.examprep", appContext.getPackageName()); 27 | } 28 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/remcv/com/github/examprep/view/MyDialogDatePicker.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep.view; 2 | 3 | import android.app.DatePickerDialog; 4 | import android.app.Dialog; 5 | import android.os.Bundle; 6 | 7 | import androidx.annotation.NonNull; 8 | import androidx.annotation.Nullable; 9 | import androidx.fragment.app.DialogFragment; 10 | 11 | import java.util.Calendar; 12 | 13 | public class MyDialogDatePicker extends DialogFragment 14 | { 15 | @NonNull 16 | @Override 17 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) 18 | { 19 | // use the current date as the default date in the picker 20 | final Calendar c = Calendar.getInstance(); 21 | int year = c.get(Calendar.YEAR); 22 | int month = c.get(Calendar.MONTH); 23 | int day = c.get(Calendar.DAY_OF_MONTH); 24 | 25 | // create an instance of DatePickerDialog and return it 26 | return new DatePickerDialog(getActivity(), (DatePickerDialog.OnDateSetListener) getActivity(), year, month, day); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/settings_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 10 | 11 | 15 | 16 | 19 | 20 | 23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 29 5 | buildToolsVersion "29.0.3" 6 | 7 | defaultConfig { 8 | applicationId "remcv.com.github.examprep" 9 | minSdkVersion 28 10 | targetSdkVersion 29 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | } 16 | 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility JavaVersion.VERSION_1_8 25 | targetCompatibility JavaVersion.VERSION_1_8 26 | } 27 | } 28 | 29 | dependencies { 30 | implementation fileTree(dir: "libs", include: ["*.jar"]) 31 | implementation 'androidx.appcompat:appcompat:1.1.0' 32 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 33 | implementation 'com.google.android.material:material:1.1.0' 34 | testImplementation 'junit:junit:4.12' 35 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 36 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' 37 | implementation 'com.google.code.gson:gson:2.8.6' 38 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 14 | 15 | 18 | 19 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/remcv/com/github/examprep/model/ExamItem.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep.model; 2 | 3 | public class ExamItem implements Comparable 4 | { 5 | // fields 6 | private int categoryNumber; 7 | private String problem; 8 | private boolean isDone; 9 | 10 | // constructor 11 | public ExamItem(int categoryNumber, String problem, boolean isDone) 12 | { 13 | this.categoryNumber = categoryNumber; 14 | this.problem = problem; 15 | this.isDone = isDone; 16 | } 17 | 18 | // methods - getters 19 | public int getCategoryNumber() 20 | { 21 | return categoryNumber; 22 | } 23 | 24 | public String getProblem() 25 | { 26 | return problem; 27 | } 28 | 29 | public boolean getIsDone() 30 | { 31 | return isDone; 32 | } 33 | 34 | // methods - interface 35 | @Override 36 | public int compareTo(ExamItem other) 37 | { 38 | // by category number, than alphabetical 39 | if (this.categoryNumber == other.getCategoryNumber()) 40 | { 41 | return this.problem.compareTo(other.getProblem()); 42 | } 43 | else 44 | { 45 | return this.categoryNumber - other.getCategoryNumber(); 46 | } 47 | } 48 | 49 | // methods - toString 50 | @Override 51 | public String toString() 52 | { 53 | return "ExamItem{" + 54 | "categoryNumber=" + categoryNumber + 55 | ", problem='" + problem + '\'' + 56 | ", isDone=" + isDone + 57 | '}'; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout/exam_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 26 | 27 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/remcv/com/github/examprep/view/ExamItemAdapter.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep.view; 2 | 3 | import android.app.Activity; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.BaseAdapter; 8 | import android.widget.ImageView; 9 | import android.widget.TextView; 10 | 11 | import java.util.List; 12 | 13 | import remcv.com.github.examprep.R; 14 | import remcv.com.github.examprep.model.ExamItem; 15 | 16 | public class ExamItemAdapter extends BaseAdapter 17 | { 18 | // fields 19 | private List list; 20 | private Activity activity; 21 | 22 | // constructor 23 | public ExamItemAdapter(List list, Activity activity) 24 | { 25 | this.list = list; 26 | this.activity = activity; 27 | } 28 | 29 | // methods from parent class 30 | @Override 31 | public int getCount() 32 | { 33 | return list.size(); 34 | } 35 | 36 | @Override 37 | public ExamItem getItem(int position) 38 | { 39 | return list.get(position); 40 | } 41 | 42 | @Override 43 | public long getItemId(int position) 44 | { 45 | return 0; 46 | } 47 | 48 | @Override 49 | public View getView(int position, View convertView, ViewGroup parent) 50 | { 51 | View oneExamItemView; 52 | LayoutInflater inflater = LayoutInflater.from(activity); 53 | oneExamItemView = inflater.inflate(R.layout.exam_item, parent, false); 54 | 55 | // initialize layout 56 | TextView categoryNumber_TV = oneExamItemView.findViewById(R.id.categoryNumberTextView_EI); 57 | TextView problem_TV = oneExamItemView.findViewById(R.id.problemTextView_EI); 58 | 59 | // put data in view 60 | ExamItem examItem = list.get(position); 61 | categoryNumber_TV.setText(String.valueOf(examItem.getCategoryNumber())); 62 | problem_TV.setText(examItem.getProblem()); 63 | 64 | if (examItem.getIsDone()) 65 | { 66 | categoryNumber_TV.setBackgroundResource(R.drawable.circle_subject_solved); 67 | } 68 | 69 | return oneExamItemView; 70 | } 71 | 72 | // methods - setters 73 | public void setList(List list) 74 | { 75 | this.list = list; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /app/src/main/java/remcv/com/github/examprep/TestSubjectsActivity.java: -------------------------------------------------------------------------------- 1 | package remcv.com.github.examprep; 2 | 3 | import androidx.appcompat.app.AppCompatActivity; 4 | 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.widget.ListView; 8 | import android.widget.TextView; 9 | 10 | import com.google.gson.Gson; 11 | import com.google.gson.reflect.TypeToken; 12 | 13 | import java.lang.reflect.Type; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | import remcv.com.github.examprep.model.ExamItem; 18 | import remcv.com.github.examprep.utils.TableConstants; 19 | import remcv.com.github.examprep.utils.Utils; 20 | import remcv.com.github.examprep.view.ExamItemAdapter; 21 | 22 | public class TestSubjectsActivity extends AppCompatActivity implements TableConstants 23 | { 24 | // fields - layout 25 | private TextView minutes_TV; 26 | private ListView subjects_LV; 27 | 28 | // fields - data 29 | private List examItems; 30 | private ExamItemAdapter adapter; 31 | 32 | // methods - life cycle 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) 35 | { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.activity_test_subjects); 38 | 39 | // initialize layout 40 | initializeLayout(); 41 | 42 | // initialize data 43 | initialDataSetup(); 44 | 45 | // update layout 46 | updateLayout(); 47 | } 48 | 49 | // methods - data 50 | public void initialDataSetup() 51 | { 52 | // get list of Exam items 53 | Intent getListIntent = getIntent(); 54 | String listStringJson = getListIntent.getStringExtra(TableConstants.RANDOM_LIST); 55 | 56 | Gson gson = new Gson(); 57 | Type type = new TypeToken>() {}.getType(); 58 | 59 | examItems = gson.fromJson(listStringJson, type); 60 | 61 | // set adapter 62 | adapter = new ExamItemAdapter(examItems, TestSubjectsActivity.this); 63 | } 64 | 65 | // methods - layout 66 | public void initializeLayout() 67 | { 68 | minutes_TV = findViewById(R.id.minutesTextView_ATS); 69 | subjects_LV = findViewById(R.id.problemsListView_ATS); 70 | } 71 | 72 | public void updateLayout() 73 | { 74 | // minutes 75 | String minutes = Utils.calculateMinutes(examItems.size()); 76 | minutes_TV.setText(minutes); 77 | 78 | // put items in listView 79 | subjects_LV.setAdapter(adapter); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_add_exam_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 18 | 19 | 28 | 29 | 36 | 37 | 42 | 43 | 44 | 51 | 52 | 57 | 58 | 59 |