Skip to content

Commit

Permalink
Merge pull request #394 from tejavojjala/iss314
Browse files Browse the repository at this point in the history
Fixes #314
  • Loading branch information
opticod authored Feb 13, 2017
2 parents b932e1b + b844eb0 commit fe089cf
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 16 deletions.
Binary file modified source-code/app/src/main/assets/BasicmLearningApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/ComprehensionApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/DictationApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/FlashCardTemplateApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/LearnSpellingsApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/MatchApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/QuizTemplateApp.apk
Binary file not shown.
Binary file modified source-code/app/src/main/assets/VideoCollectionApp.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.speech.tts.TextToSpeech;
import android.speech.tts.UtteranceProgressListener;
import android.support.v4.app.Fragment;
Expand All @@ -17,6 +18,7 @@
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.method.LinkMovementMethod;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -119,6 +121,25 @@ public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getView().setFocusableInTouchMode(true);
getView().requestFocus();
getView().setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), org.buildmlearn.toolkit.dictationtemplate.fragment.MainActivityFragment.newInstance()).addToBackStack(null).commit();
return true;
}
return false;
}
});

}

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if (null != dictId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.buildmlearn.toolkit.flashcardtemplate.fragment;

import android.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
Expand Down Expand Up @@ -132,7 +131,6 @@ public boolean onMenuItemClick(MenuItem item) {

Fragment frag = MainFragment.newInstance();
frag.setArguments(arguments);
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), frag).addToBackStack(null).commit();

return false;
Expand Down Expand Up @@ -194,7 +192,6 @@ public void onClick(View v) {

Fragment frag = MainFragment.newInstance();
frag.setArguments(arguments);
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), frag).addToBackStack(null).commit();

}
Expand All @@ -214,7 +211,6 @@ public void onClick(View v) {

Fragment frag = MainFragment.newInstance();
frag.setArguments(arguments);
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), frag).addToBackStack(null).commit();


Expand All @@ -223,7 +219,6 @@ public void onClick(View v) {
Bundle arguments = new Bundle();
Fragment frag = LastFragment.newInstance();
frag.setArguments(arguments);
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), frag).addToBackStack(null).commit();

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}


@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if (null != videoId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void onClick(View v) {
Fragment frag = DetailActivityFragment.newInstance();
frag.setArguments(arguments);
getActivity().getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), MainActivityFragment.newInstance()).addToBackStack(null).commit();
getActivity().getSupportFragmentManager().beginTransaction().replace(((ViewGroup) getView().getParent()).getId(), frag).addToBackStack(null).commit();
}
});
Expand Down
19 changes: 8 additions & 11 deletions source-code/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

## Project-wide Gradle settings.
#
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m


# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
#Sat Jan 14 09:01:08 IST 2017

0 comments on commit fe089cf

Please sign in to comment.