Skip to content

Commit 8999b68

Browse files
authored
Merge pull request BuildmLearn#246 from BuildmLearn/bug-fixes
Updating master branch from bug-fixes branch
2 parents b05e2f3 + 6688dda commit 8999b68

File tree

67 files changed

+1788
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1788
-1043
lines changed

.travis.yml

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
before_install: cd source-code
22

33
language: android
4-
sudo: true
54
jdk: oraclejdk8
5+
# Turn off caching to avoid any caching problems
6+
cache: false
7+
sudo: true
8+
9+
cache:
10+
directories:
11+
- ${TRAVIS_BUILD_DIR}/gradle/caches/
12+
- ${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/
13+
614
env:
715
matrix:
8-
- ADB_INSTALL_TIMEOUT=12 ANDROID_BUILD_TOOLS_VERSION=23.0.2 ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
16+
- ANDROID_API_LEVEL=23 ADB_INSTALL_TIMEOUT=12 ANDROID_BUILD_TOOLS_VERSION=23.0.2 ANDROID_ABI=armeabi-v7a ANDROID_TAG=google_apis
917

1018
android:
1119
components:
20+
- tools # to get the new repository-11.xml
1221
- platform-tools
13-
- tools
22+
- tools # to install Android SDK tools
1423
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
15-
- $ANDROID_TARGET
16-
- android-23
24+
- android-$ANDROID_API_LEVEL
25+
# For Google APIs
26+
- addon-google_apis-google-$ANDROID_API_LEVEL
1727
# Google Play Services
1828
- extra-google-google_play_services
1929
# Support library
@@ -22,21 +32,10 @@ android:
2232
- extra-google-m2repository
2333
- extra-android-m2repository
2434
# Specify at least one system image,
25-
- sys-img-armeabi-v7a-$ANDROID_TARGET
26-
27-
before_script:
28-
# Create and start emulator
29-
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
30-
- emulator -avd test -no-skin -no-audio -no-window &
31-
- android-wait-for-emulator
32-
- sleep 10
33-
- adb shell settings put global window_animation_scale 0 &
34-
- adb shell settings put global transition_animation_scale 0 &
35-
- adb shell settings put global animator_duration_scale 0 &
36-
- adb shell input keyevent 82 &
35+
- sys-img-armeabi-v7a-android-$ANDROID_API_LEVEL
3736

3837
script:
39-
- ./gradlew check connectedAndroidTest
38+
- ./gradlew assembleRelease
4039

4140
notifications:
4241
email:

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ This repository contains the Android version of the [BuildmLearn Toolkit](https:
66

77
[Toolkit-mobile-templates](https://github.com/BuildmLearn/Toolkit-mobile-templates) contains the template applications of the toolkit.
88

9+
# Application Screenshots
10+
<img src="https://cloud.githubusercontent.com/assets/13872065/20721460/d83d3c9a-b688-11e6-891d-1f28092de314.jpeg" width="250" height="400" />
11+
<img src="https://cloud.githubusercontent.com/assets/13872065/20721466/d8c038fc-b688-11e6-9b9e-1394c6dedc74.jpeg" width="200" height="400" />
12+
<img src="https://cloud.githubusercontent.com/assets/13872065/20721462/d87f6d7c-b688-11e6-82e1-f3faa596d5d0.jpeg" width="200" height="400" />
13+
<img src="https://cloud.githubusercontent.com/assets/13872065/20721464/d8b36672-b688-11e6-897c-8a0c849dbeb0.jpeg" width="200" height="400" />
14+
<img src="https://cloud.githubusercontent.com/assets/13872065/20722851/3542f4de-b68e-11e6-8079-aaa35d5b9943.gif" width="250" height="400" />
15+
<img src="https://cloud.githubusercontent.com/assets/13872065/20722869/427b28ce-b68e-11e6-9885-48147e87b531.jpeg" width="200" height="400" />
16+
<img src="https://cloud.githubusercontent.com/assets/13872065/20722870/42803256-b68e-11e6-966b-2ea24db13a60.jpeg" width="200" height="400" />
17+
<img src="https://cloud.githubusercontent.com/assets/13872065/20722871/428db1e2-b68e-11e6-97cf-5adab6ff0a63.jpeg" width="200" height="400" />
18+
<img src="https://cloud.githubusercontent.com/assets/13872065/20724136/10f7366c-b693-11e6-8c53-a69707f2f9c8.jpeg" width="250" height="400" />
19+
<img src="https://cloud.githubusercontent.com/assets/13872065/20724137/1133c4e2-b693-11e6-9d83-61dc7676f426.jpeg" width="200" height="400" />
20+
<img src="https://cloud.githubusercontent.com/assets/13872065/20724129/0cd258a0-b693-11e6-90f3-66e88aeec244.gif" width="200" height="400" />
21+
<img src="https://cloud.githubusercontent.com/assets/13872065/20724248/83706d30-b693-11e6-8c17-acd711ec11f7.gif" width="200" height="400" />
22+
923
# Development Setup
1024
1. Go to the project repo and click the `Fork` button
1125
2. Clone your forked repository : `git clone git@github.com:your_name/BuildmLearn-Toolkit-Android.git`

source-code/app/build.gradle

+1-8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ android {
4747
lintOptions {
4848
abortOnError false
4949
}
50+
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
5051
}
5152

5253
dependencies {
@@ -55,12 +56,6 @@ dependencies {
5556
compile 'com.android.support:cardview-v7:23.4.0'
5657
compile 'com.android.support:recyclerview-v7:23.4.0'
5758
compile 'com.android.support:design:23.4.0'
58-
compile('com.github.afollestad.material-dialogs:core:0.8.5.3@aar') {
59-
transitive = true
60-
}
61-
compile('com.github.afollestad.material-dialogs:commons:0.8.5.3@aar') {
62-
transitive = true
63-
}
6459
compile 'com.cocosw:bottomsheet:1.3.0@aar'
6560
compile('com.crashlytics.sdk.android:crashlytics:2.3.1@aar') {
6661
transitive = true;
@@ -77,8 +72,6 @@ dependencies {
7772
compile files('libs/axml.jar')
7873
compile 'com.viewpagerindicator:library:2.4.1@aar'
7974
compile 'com.nineoldandroids:library:2.4.0'
80-
compile 'com.daimajia.easing:library:1.0.1@aar'
81-
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
8275
compile 'com.squareup.picasso:picasso:2.5.2'
8376
compile 'org.jsoup:jsoup:1.9.1'
8477
androidTestCompile 'com.android.support:support-annotations:23.4.0'

source-code/app/src/main/AndroidManifest.xml

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="org.buildmlearn.toolkit" >
3+
package="org.buildmlearn.toolkit">
44

55
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
66
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
@@ -17,13 +17,12 @@
1717
android:icon="@mipmap/ic_launcher"
1818
android:label="@string/app_name"
1919
android:supportsRtl="true"
20-
android:theme="@style/AppTheme" >
20+
android:theme="@style/AppTheme">
2121
<activity
2222
android:name=".activity.HomeActivity"
2323
android:configChanges="orientation|screenSize"
2424
android:label="@string/app_name"
25-
android:theme="@style/NoActionBarThemeTransparentStatusBar" >
26-
</activity>
25+
android:theme="@style/NoActionBarThemeTransparentStatusBar"></activity>
2726
<activity
2827
android:name=".simulator.Simulator"
2928
android:label="@string/title_activity_simulator"
@@ -33,7 +32,7 @@
3332
android:name=".activity.TemplateActivity"
3433
android:label="@string/title_activity_template"
3534
android:parentActivityName=".activity.HomeActivity"
36-
android:theme="@style/AppTheme.NoActionBar" >
35+
android:theme="@style/AppTheme.NoActionBar">
3736
<meta-data
3837
android:name="android.support.PARENT_ACTIVITY"
3938
android:value="org.buildmlearn.toolkit.activity.HomeActivity" />
@@ -42,8 +41,7 @@
4241
android:name=".activity.TemplateEditor"
4342
android:configChanges="orientation|screenSize"
4443
android:label="@string/title_activity_template_editor"
45-
android:theme="@style/AppTheme.NoActionBar" >
46-
</activity>
44+
android:theme="@style/AppTheme.NoActionBar"></activity>
4745

4846
<meta-data
4947
android:name="io.fabric.ApiKey"
@@ -52,8 +50,8 @@
5250
<activity
5351
android:name=".activity.FirstRunActivity"
5452
android:label="@string/app_name"
55-
android:theme="@style/Buildmlearn.FullScreen"
56-
android:windowSoftInputMode="adjustPan" >
53+
android:theme="@style/SplashTheme"
54+
android:windowSoftInputMode="adjustPan">
5755
<intent-filter>
5856
<action android:name="android.intent.action.MAIN" />
5957

@@ -63,24 +61,23 @@
6361
<activity
6462
android:name=".activity.TutorialActivity"
6563
android:label="@string/title_activity_tutorial"
66-
android:theme="@style/Buildmlearn.FullScreen" >
67-
</activity>
64+
android:theme="@style/Buildmlearn.FullScreen"></activity>
6865
<activity
6966
android:name=".activity.AboutBuildmLearn"
7067
android:label="@string/title_activity_about_buildm_learn"
7168
android:parentActivityName=".activity.HomeActivity"
72-
android:theme="@style/AppTheme.NoActionBar" >
69+
android:theme="@style/AppTheme.NoActionBar">
7370
<meta-data
7471
android:name="android.support.PARENT_ACTIVITY"
7572
android:value="org.buildmlearn.toolkit.activity.HomeActivity" />
7673
</activity>
7774
<activity
7875
android:name=".activity.DeepLinkerActivity"
79-
android:label="@string/title_activity_deep_linker" >
76+
android:label="@string/title_activity_deep_linker">
8077
<intent-filter
8178
android:icon="@mipmap/ic_launcher"
8279
android:label="@string/app_name"
83-
android:priority="1" >
80+
android:priority="1">
8481
<action android:name="android.intent.action.VIEW" />
8582

8683
<category android:name="android.intent.category.DEFAULT" />
@@ -91,13 +88,13 @@
9188
<data android:pathPattern=".*\\.buildmlearn" />
9289
</intent-filter>
9390
</activity>
94-
<activity
95-
android:name=".activity.SettingsLinkerActivity">
91+
<activity android:name=".activity.SettingsLinkerActivity">
9692
<intent-filter>
9793
<action android:name="android.intent.action.MAIN" />
94+
9895
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES" />
9996
</intent-filter>
10097
</activity>
10198
</application>
10299

103-
</manifest>
100+
</manifest>

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/FirstRunActivity.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import android.support.v7.app.AppCompatActivity;
88
import android.view.KeyEvent;
99
import android.view.View;
10+
import android.view.animation.Animation;
11+
import android.view.animation.AnimationUtils;
1012
import android.widget.EditText;
1113
import android.widget.Toast;
1214

1315
import com.crashlytics.android.Crashlytics;
14-
import com.daimajia.androidanimations.library.Techniques;
15-
import com.daimajia.androidanimations.library.YoYo;
1616

1717
import org.buildmlearn.toolkit.R;
1818
import org.buildmlearn.toolkit.constant.Constants;
@@ -46,14 +46,9 @@ protected void onCreate(Bundle savedInstanceState) {
4646

4747

4848
findViewById(R.id.focus_thief).clearFocus();
49-
YoYo.with(Techniques.BounceInUp)
50-
.duration(2700)
51-
.playOn(findViewById(R.id.first_name));
52-
53-
49+
Animation anim_bounceinup=AnimationUtils.loadAnimation(getBaseContext(),R.anim.bounceinup);
5450
name = (EditText) findViewById(R.id.first_name);
55-
56-
51+
name.startAnimation(anim_bounceinup);
5752
name.setOnKeyListener(new View.OnKeyListener() {
5853
@Override
5954
public boolean onKey(View v, int keyCode, KeyEvent event) {

source-code/app/src/main/java/org/buildmlearn/toolkit/activity/HomeActivity.java

+28-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
import android.app.FragmentManager;
55
import android.app.FragmentTransaction;
66
import android.content.Intent;
7+
import android.content.SharedPreferences;
78
import android.os.Bundle;
9+
import android.os.Handler;
10+
import android.preference.PreferenceManager;
811
import android.support.v4.widget.DrawerLayout;
912
import android.support.v7.app.AppCompatActivity;
1013
import android.support.v7.widget.Toolbar;
14+
import android.widget.Toast;
1115

1216
import org.buildmlearn.toolkit.R;
1317
import org.buildmlearn.toolkit.constant.Constants;
@@ -25,6 +29,8 @@ public class HomeActivity extends AppCompatActivity
2529

2630
private Section currentSection;
2731
private NavigationDrawerFragment mNavigationDrawerFragment;
32+
private boolean atHome = true;
33+
private boolean backPressedOnce = false;
2834

2935
/**
3036
* {@inheritDoc}
@@ -33,6 +39,10 @@ public class HomeActivity extends AppCompatActivity
3339
protected void onCreate(Bundle savedInstanceState) {
3440
super.onCreate(savedInstanceState);
3541

42+
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
43+
SharedPreferences.Editor editor = prefs.edit();
44+
editor.putBoolean("SkipTutorial", true);
45+
editor.apply();
3646

3747
setContentView(R.layout.activity_home);
3848
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
@@ -130,9 +140,24 @@ public void onBackPressed() {
130140
mNavigationDrawerFragment.closeDrawer();
131141
return;
132142
}
133-
if (getFragmentManager().getBackStackEntryCount() <= 1) {
134-
finish();
143+
if(atHome){
144+
if(backPressedOnce){
145+
finish();
146+
}
147+
backPressedOnce=true;
148+
Toast.makeText(this, "Tap back once more to exit.", Toast.LENGTH_SHORT).show();
149+
new Handler().postDelayed(new Runnable()
150+
{
151+
@Override
152+
public void run()
153+
{
154+
backPressedOnce= false;
155+
}
156+
}, 2000);
157+
}
158+
else if(!atHome){
159+
onNavigationDrawerItemSelected(0);
160+
atHome = true;
135161
}
136-
super.onBackPressed();
137162
}
138163
}

0 commit comments

Comments
 (0)