Skip to content

Commit

Permalink
(Initial) Release 1.1.0
Browse files Browse the repository at this point in the history
* Added: new App Icon
* Added: Dark Theme comatible with System Theme
* Updated: cleaner UI
* and a lot of other tweaks
  • Loading branch information
machiav3lli committed Jun 4, 2020
1 parent bc42724 commit 87fd4ec
Show file tree
Hide file tree
Showing 91 changed files with 740 additions and 905 deletions.
9 changes: 9 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
changelog
=========

1.1.0 (04.06.2020)
-------------------
* added: new App Icon
* added: Dark Theme comatible with System Theme
* updated: cleaner UI
* and some other tweaks
39 changes: 21 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ Android app for learning German nouns genders.

Contains almost 10,000 German nouns.

Try the app by using the apk under [releases](https://github.com/digitapex/DerDieDas/releases).
Try the app by using the apk under [releases](https://github.com/machiav3lli/DerDieDas/releases).

<a href='https://play.google.com/store/apps/details?id=com.spitslide.derdiedas'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height='75px'/></a>
## Screenshots

<p align="center">
<img src="/screenshots/Screenshot_01.png" width="250">
<img src="/screenshots/Screenshot_02.png" width="250">
<img src="/screenshots/Screenshot_03.png" width="250">
</p>
<br>
<p align="center">
<img src="/screenshots/Screenshot_04.png" width="250">
<img src="/screenshots/Screenshot_05.png" width="250">
<img src="/screenshots/Screenshot_06.png" width="250">
### Dark Theme

<p float="left">
<img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="170" />
<img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="170" />
</p>
<br>
<p align="center">
<img src="/screenshots/Screenshot_07.png" width="250">
<img src="/screenshots/Screenshot_08.png" width="250">
<img src="/screenshots/Screenshot_09.png" width="250">

### Light Theme

<p float="left">
<img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="170" />
<img src="/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png" width="170" />
</p>
<br>

## Credits

[Digitapex](https://github.com/digitapex) for writting this app at the first place.

## author

Antonios Hazim
60 changes: 45 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,62 @@
apply plugin: 'com.android.application'

int versionMajor = 1
int versionMinor = 1
int versionPath = 0

android {
buildToolsVersion "28.0.2"
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "com.spitslide.derdiedas"
minSdkVersion 15
targetSdkVersion 28
versionCode 2
versionName "1.01"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
applicationId 'com.machiav3lli.derdiedas'
minSdkVersion 24
targetSdkVersion 29
versionCode = versionMajor * 1000 + versionMinor * 100 + versionPath
versionName = "${versionMajor}.${versionMinor}.${versionPath}"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependenciesInfo {
includeInApk false
includeInBundle false
}
buildToolsVersion '29.0.3'
}

ext {
versions = [
butterknife : "10.2.1",

appcompat : "1.1.0",
constraintlayout : "2.0.0-beta6",
preference : "1.1.1",
material : "1.3.0-alpha01",

junit : "1.1.1",
espresso : "3.2.0"
]
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:preference-v14:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
//ButterKnife
implementation "com.jakewharton:butterknife:${versions.butterknife}"
annotationProcessor "com.jakewharton:butterknife-compiler:${versions.butterknife}"

// UI
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintlayout}"
implementation "androidx.preference:preference:${versions.preference}"
implementation "com.google.android.material:material:${versions.material}"

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'
// Test
implementation "androidx.test.ext:junit:${versions.junit}"
implementation "androidx.test.espresso:espresso-core:${versions.espresso}"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.spitslide.derdiedas;
package com.machiav3lli.derdiedas;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand Down
17 changes: 8 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spitslide.derdiedas">
package="com.machiav3lli.derdiedas">

<application
android:allowBackup="true"
android:icon="@drawable/germany_flag_128"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@drawable/germany_flag_128"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.spitslide.derdiedas.ui.MainActivity">
android:theme="@style/AppTheme.DayNight">
<activity android:name="com.machiav3lli.derdiedas.ui.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.spitslide.derdiedas.ui.WordActivity"/>
<activity android:name="com.spitslide.derdiedas.ui.SettingsActivity"/>
<activity android:name="com.spitslide.derdiedas.ui.StatsActivity"/>
<activity android:name="com.machiav3lli.derdiedas.ui.WordActivity" />
<activity android:name="com.machiav3lli.derdiedas.ui.SettingsActivity" />
<activity android:name="com.machiav3lli.derdiedas.ui.StatsActivity" />
</application>

</manifest>
Binary file added app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions app/src/main/java/com/machiav3lli/derdiedas/Constants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.machiav3lli.derdiedas;

public class Constants {

private Constants() {
}

public static final String TAG = "DerDieDas";
public static final String PREFS_THEME = "themes";

public static String classTag(String tag) {
return TAG + tag;
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package com.spitslide.derdiedas.data;

package com.machiav3lli.derdiedas.data;

public class Noun {

Expand All @@ -17,12 +16,10 @@ public String getNoun() {
return noun;
}


public String getGender() {
return gender;
}


public int getTimesAnswered() {
return timesAnswered;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package com.spitslide.derdiedas.data;

package com.machiav3lli.derdiedas.data;

import java.util.List;

Expand All @@ -9,20 +8,19 @@ public class SpacedRepetitionModel {
private static final int REPETITION_FOR_CORRECT = 20;
private static final int TIMES_TO_ANSWER_TO_REMOVE = 5;


public List<Noun> getUpdatedNounList(List<Noun> nounList, Noun noun, boolean isCorrect) {
if (nounList.size() == 0) {
return null;
}
nounList.remove(0);
if (!isCorrect) {
noun.setTimesAnswered(0);
nounList.add(REPETITION_FOR_WRONG <= nounList.size() ? REPETITION_FOR_WRONG : nounList.size(), noun);
nounList.add(Math.min(REPETITION_FOR_WRONG, nounList.size()), noun);

} else {
noun.setTimesAnswered(noun.getTimesAnswered() + 1);
if (noun.getTimesAnswered() < TIMES_TO_ANSWER_TO_REMOVE) {
nounList.add(REPETITION_FOR_CORRECT <= nounList.size() ? REPETITION_FOR_CORRECT : nounList.size(), noun);
nounList.add(Math.min(REPETITION_FOR_CORRECT, nounList.size()), noun);
}
}
return nounList;
Expand Down
102 changes: 102 additions & 0 deletions app/src/main/java/com/machiav3lli/derdiedas/ui/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.machiav3lli.derdiedas.ui;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager;

import com.machiav3lli.derdiedas.Constants;
import com.machiav3lli.derdiedas.R;
import com.machiav3lli.derdiedas.data.Noun;
import com.machiav3lli.derdiedas.utils.DatabaseUtil;
import com.machiav3lli.derdiedas.utils.FileUtils;
import com.machiav3lli.derdiedas.utils.PrefsUtil;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;
import butterknife.OnClick;

import static androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
setDayNightTheme(PrefsUtil.getPrefsString(this, Constants.PREFS_THEME));
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
createDatabaseIfFirstRun();
}

@OnClick(R.id.practice)
public void startPractice() {
startActivity(new Intent(this, WordActivity.class));
}

@OnClick(R.id.stats)
public void showStats() {
startActivity(new Intent(this, StatsActivity.class));
}

@OnClick(R.id.settings)
public void showSettings() {
startActivity(new Intent(this, SettingsActivity.class));
}

@Override
protected void onResume() {
super.onResume();
}

private void createDatabaseIfFirstRun() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getBoolean("firstrun", true)) {
String listNouns = null;
try {
listNouns = FileUtils.getNounList(this);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String[] nouns = FileUtils.getLines(listNouns);

final List<Noun> nounList = new ArrayList<>();
for (String line : nouns) {
String noun = line.split(",")[0];
String gender = line.split(",")[1];
Noun nounObject = new Noun(noun, gender, 0);
nounList.add(nounObject);
}

new Thread() {
@Override
public void run() {
new DatabaseUtil(MainActivity.this).addAllNouns(nounList);
}
}.start();

prefs.edit().putBoolean("firstrun", false).apply();
}
}

private void setDayNightTheme(String theme) {
switch (theme) {
case "light":
setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
break;
case "dark":
setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
break;
default:
setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
}
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.spitslide.derdiedas.ui;

package com.machiav3lli.derdiedas.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.spitslide.derdiedas.R;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.machiav3lli.derdiedas.R;

public class SettingsActivity extends ThemedActivity{
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Loading

0 comments on commit 87fd4ec

Please sign in to comment.