Version 2.2

This commit is contained in:
mmk2410 2015-05-15 22:19:23 +02:00
parent 2d8bf539ae
commit d682999421
11 changed files with 146 additions and 63 deletions

19
.gitignore vendored
View file

@ -1,33 +1,14 @@
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
#.idea directory
.idea/
# IntelliJ IDEA Files
*.iml
app/app.iml

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module 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.id="MorseConverter" 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">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
@ -16,4 +17,3 @@
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="MorseConverter" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<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="MorseConverter" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
@ -12,8 +12,9 @@
<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="assembleDebugTest" />
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugTestSources" />
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" />
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
@ -84,15 +85,15 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-22.0.0" level="project" />
<orderEntry type="library" exported="" name="MaterialNavigationDrawer-1.3.3" level="project" />
<orderEntry type="library" exported="" name="material-ripple-1.0.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="library-1.0.24" level="project" />
<orderEntry type="library" exported="" name="support-v4-22.0.0" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-22.0.0" level="project" />
</component>
</module>

View file

@ -1,15 +1,15 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "de.marcelkapfer.morseconverter"
minSdkVersion 11
targetSdkVersion 21
versionCode 4
versionName "2.1"
targetSdkVersion 22
versionCode 220
versionName "2.2 beta"
}
buildTypes {
release {
@ -26,9 +26,10 @@ repositories {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:appcompat-v7:22.0.+'
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:support-v4:22.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.anjlab.android.iab.v3:library:1.0.+@aar'
}

View file

@ -1,8 +1,6 @@
-- Merging decision tree log ---
manifest
ADDED from AndroidManifest.xml:23:1
xmlns:android
ADDED from AndroidManifest.xml:23:11
package
ADDED from AndroidManifest.xml:24:5
INJECTED from AndroidManifest.xml:0:0
@ -10,19 +8,24 @@ ADDED from AndroidManifest.xml:23:1
android:versionName
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
xmlns:android
ADDED from AndroidManifest.xml:23:11
android:versionCode
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
application
ADDED from AndroidManifest.xml:26:5
MERGED from com.android.support:appcompat-v7:21.0.3:16:5
MERGED from com.android.support:support-v4:21.0.3:16:5
MERGED from it.neokree:MaterialNavigationDrawer:1.3:14:5
MERGED from com.github.markushi:android-ui:1.2:9:5
MERGED from com.android.support:appcompat-v7:21.0.3:16:5
MERGED from com.android.support:support-v4:21.0.3:16:5
MERGED from com.android.support:appcompat-v7:22.0.0:22:5
MERGED from com.android.support:support-v4:22.0.0:22:5
MERGED from it.neokree:MaterialNavigationDrawer:1.3.3:14:5
MERGED from com.android.support:appcompat-v7:22.0.0:22:5
MERGED from com.android.support:support-v4:22.0.0:22:5
MERGED from com.balysv:material-ripple:1.0.1:12:5
MERGED from com.android.support:cardview-v7:21.0.3:16:5
MERGED from com.android.support:support-v4:21.0.3:16:5
MERGED from com.android.support:support-v4:22.0.0:22:5
MERGED from com.android.support:recyclerview-v7:21.0.3:17:5
MERGED from com.android.support:support-v4:22.0.0:22:5
MERGED from com.anjlab.android.iab.v3:library:1.0.24:13:5
android:label
ADDED from AndroidManifest.xml:29:9
android:allowBackup
@ -47,21 +50,35 @@ category#android.intent.category.LAUNCHER
ADDED from AndroidManifest.xml:37:17
android:name
ADDED from AndroidManifest.xml:37:27
uses-permission#com.android.vending.BILLING
ADDED from AndroidManifest.xml:42:5
MERGED from com.anjlab.android.iab.v3:library:1.0.24:11:5
android:name
ADDED from AndroidManifest.xml:42:22
uses-sdk
INJECTED from AndroidManifest.xml:0:0 reason: use-sdk injection requested
MERGED from com.android.support:appcompat-v7:21.0.3:15:5
MERGED from com.android.support:support-v4:21.0.3:15:5
MERGED from it.neokree:MaterialNavigationDrawer:1.3:8:5
MERGED from com.github.markushi:android-ui:1.2:7:5
MERGED from com.android.support:appcompat-v7:21.0.3:15:5
MERGED from com.android.support:support-v4:21.0.3:15:5
MERGED from com.android.support:appcompat-v7:22.0.0:20:5
MERGED from com.android.support:support-v4:22.0.0:20:5
MERGED from it.neokree:MaterialNavigationDrawer:1.3.3:8:5
MERGED from com.android.support:appcompat-v7:22.0.0:20:5
MERGED from com.android.support:support-v4:22.0.0:20:5
MERGED from com.balysv:material-ripple:1.0.1:8:5
MERGED from com.android.support:cardview-v7:21.0.3:15:5
MERGED from com.android.support:support-v4:21.0.3:15:5
MERGED from com.android.support:support-v4:22.0.0:20:5
MERGED from com.android.support:recyclerview-v7:21.0.3:15:5
MERGED from com.android.support:support-v4:22.0.0:20:5
MERGED from com.anjlab.android.iab.v3:library:1.0.24:7:5
tools:overrideLibrary
ADDED from it.neokree:MaterialNavigationDrawer:1.3.3:11:9
android:targetSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:minSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
tools:overrideLibrary
ADDED from it.neokree:MaterialNavigationDrawer:1.3:11:9
activity#android.support.v7.widget.TestActivity
ADDED from com.android.support:recyclerview-v7:21.0.3:18:9
android:label
ADDED from com.android.support:recyclerview-v7:21.0.3:18:19
android:name
ADDED from com.android.support:recyclerview-v7:21.0.3:18:60

View file

@ -39,4 +39,6 @@
</activity>
</application>
<uses-permission android:name="com.android.vending.BILLING" />
</manifest>

View file

@ -34,6 +34,9 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import com.anjlab.android.iab.v3.BillingProcessor;
import com.anjlab.android.iab.v3.TransactionDetails;
import de.marcelkapfer.morseconverter.engine.DecodeNormalMorseManager;
import de.marcelkapfer.morseconverter.engine.DecodeWrittenMorseManager;
import de.marcelkapfer.morseconverter.engine.EncodeNormalMorseManager;
@ -45,29 +48,47 @@ import de.marcelkapfer.morseconverter.fragments.writtenMorseListFragment;
import it.neokree.materialnavigationdrawer.MaterialNavigationDrawer;
import it.neokree.materialnavigationdrawer.elements.MaterialSection;
import it.neokree.materialnavigationdrawer.elements.listeners.MaterialSectionListener;
import it.neokree.materialnavigationdrawer.util.MaterialActionBarDrawerToggle;
public class MainActivity extends MaterialNavigationDrawer {
public class MainActivity extends MaterialNavigationDrawer implements BillingProcessor.IBillingHandler {
//Declaring the Material Sections
private MaterialSection writtenMorse, normalMorse, writtenMorseList, about;
MaterialActionBarDrawerToggle mDrawerToggle;
private MaterialSection writtenMorse, normalMorse, writtenMorseList, donate, about;
private MaterialActionBarDrawerToggle mDrawerToggle;
BillingProcessor bp;
//The MaterialNavigationDrawer init() methode replaces the normal onCreate() methode
@Override
public void init(Bundle savedInstanceState) {
bp = new BillingProcessor(this, "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkmhshG72hHv9OmduVGxio5jyhC9M4CRGp099vtYHmZGaVCq/hpzUhgu7z/H3ioPSc325W13o3qYGpY4GLwe7MAtnSfTIT2fBu6l3kv9lgyYG0qSnDxZVOikf4Bfj7LE/g1OEr/++MqcD2hg1EBMqIgVyB6qOXgXkrHBSj2pf2Rko1SXNmeZ/MiTFx1VRB0PPRf01hPWU1bxZUizh3hdgWiATuTJCCYR0vpfb4IlQDF5wGS4AGHgIz5Qhh5ZZ+XQDTHv7SDdodSdLc02a/Zy0/9bxTIh8yy/Lg1JbPdh5rvWK/HeEH/wAYmwc8xQoQL264wjTQqKUZ+7iisHwS9ZtowIDAQAB", this);
// Restore purchases
bp.loadOwnedPurchasesFromGoogle();
Resources res = getResources();
//Declaring the Material Sections
writtenMorse = this.newSection("writtenMorse", new MainFragment());
normalMorse = this.newSection(res.getString(R.string.normalMorse), new MorseFragment());
writtenMorseList = this.newSection("writtenMorse Codes", new writtenMorseListFragment()); //TODO rename
writtenMorseList = this.newSection("writtenMorse Codes", new writtenMorseListFragment());
about = this.newSection(res.getString(R.string.about), new AboutFragment());
donate = this.newSection(res.getString(R.string.donate_title), new MaterialSectionListener() {
@Override
public void onClick(MaterialSection materialSection) {
bp.purchase(MainActivity.this, "donate");
donate.unSelect();
}
}
);
//Adding the Sections
this.addSection(writtenMorse);
this.addSection(normalMorse);
this.addDivisor();
this.addSection(writtenMorseList);
this.addBottomSection(donate);
this.addBottomSection(about);
//set drawer image
this.setDrawerHeaderImage(this.getResources().getDrawable(R.drawable.feature_graphics));
@ -105,6 +126,51 @@ public class MainActivity extends MaterialNavigationDrawer {
}
// IBillingHandler implementation
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (!bp.handleActivityResult(requestCode, resultCode, data))
super.onActivityResult(requestCode, resultCode, data);
}
@Override
public void onBillingInitialized() {
/*
* Called then BillingProcessor was initialized and its ready to purchase
*/
}
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
/*
* Called then requested PRODUCT ID was successfully purchased
*/
}
@Override
public void onBillingError(int errorCode, Throwable error) {
/*
* Called then some error occured. See Constants class for more details
*/
}
@Override
public void onPurchaseHistoryRestored() {
/*
* Called then purchase history was restored and the list of all owned PRODUCT ID's
* was loaded from Google Play
*/
}
@Override
public void onDestroy() {
if (bp != null)
bp.release();
super.onDestroy();
}
public void normalMorseEncode(View view){
try{
EditText input = (EditText) findViewById(R.id.editTextNormalMorse);
@ -286,4 +352,5 @@ public class MainActivity extends MaterialNavigationDrawer {
ClipData clip = ClipData.newPlainText("Message", string);
clipboard.setPrimaryClip(clip);
}
}

View file

@ -36,9 +36,9 @@
<string name="about">Über</string>
<string name="normalMorse">Normales Morse</string>
<string name="aboutBug">Wenn Du einen Fehler gefunden hast, schreibe mit bitte ein Email an marcelmichaelkapfer@yahoo.co.nz</string>
<string name="aboutHow">Du kannst eine ausführliche Anwendung auf marcel-kapfer.de/projects/morse/index.html#howto_android finden.</string>
<string name="aboutHow">Du kannst eine ausführliche Anwendung auf marcel-kapfer.de/writtenmorse/index.html#howto_android finden.</string>
<string name="aboutMissing">Wenn du auf einen fehlenden Code aufmerksam geworden bist, dann schreibe eine Email an marcelmichaelkapfer@yahoo.co.nz.</string>
<string name="aboutVersion">2.1 \n10. März 2015</string>
<string name="aboutVersion">2.2 beta \n15. Mai 2015</string>
<string name="sectionBug">Fehler</string>
<string name="sectionContact">Kontakt</string>
<string name="sectionDeveloper">Entwickler</string>
@ -48,4 +48,7 @@
<!--Output Text Buttons-->
<string name="button_share">TEILEN</string>
<string name="button_copy">KOPIEREN</string>
<!--Donate Dialog-->
<string name="donate_title">Unterstütze den Entwickler</string>
</resources>

View file

@ -82,4 +82,9 @@
<item name="android:layout_width">match_parent</item>
</style>
<style name="RippleField">
<item name="android:background">@drawable/button_action</item>
<item name="android:src">@color/cardview_light_background</item>
</style>
</resources>

View file

@ -43,13 +43,13 @@
<string name="sectionHow">How to</string>
<string name="sectionMissing">Missing Code</string>
<!--About Texts-->
<string name="aboutVersion">2.1\n10th March 2015</string>
<string name="aboutVersion">2.2 beta\n15 May 2015</string>
<string name="aboutDeveloper" translatable="false">Marcel Michael Kapfer</string>
<string name="aboutWebsite" translatable="false">marcel-kapfer.de/projects/morse/</string>
<string name="aboutWebsite" translatable="false">marcel-kapfer.de/writtenmorse</string>
<string name="aboutContact" translatable="false">marcelmichaelkapfer@yahoo.co.nz</string>
<string name="aboutLicense" translatable="false">GNU GPL v3.0</string>
<string name="aboutBug">If you found a bug, please write me a mail to marcelmichaelkapfer@yahoo.co.nz with a short description of the problem.</string>
<string name="aboutHow">You can find a detailed guide on marcel-kapfer.de/projects/morse/index.html#howto_android</string>
<string name="aboutHow">You can find a detailed guide on marcel-kapfer.de/writtenmorse/index.php#howto_android</string>
<string name="aboutMissing">If you discovered, that code is missing, then write me a mail to marcelmichaelkapfer@yahoo.co.nz and tell me about it.</string>
<!--Drawer Titles-->
<string name="about">About</string>
@ -58,6 +58,7 @@
<string name="button_share">SHARE</string>
<string name="button_copy">COPY</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<!--Donate Dialog-->
<string name="donate_title">Donate the developer</string>
</resources>

View file

@ -81,4 +81,9 @@
<item name="android:layout_width">match_parent</item>
</style>
<style name="RippleField">
<item name="android:background">@drawable/button_action</item>
<item name="android:src">@color/cardview_light_background</item>
</style>
</resources>