Skip to content

Commit

Permalink
Merge pull request #39 from StepicOrg/release/1.6
Browse files Browse the repository at this point in the history
Release/1.6
  • Loading branch information
KirillMakarov committed Apr 22, 2016
2 parents 0a543f6 + 14ab5f4 commit fce240d
Show file tree
Hide file tree
Showing 375 changed files with 1,959 additions and 2,487 deletions.
4 changes: 3 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/src/sb
/build
/build
src/classic/google-services.json
/src/releasedev
36 changes: 18 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.neenbedankt.android-apt' //needed for source code generation


android {

compileSdkVersion 23
Expand All @@ -12,8 +11,8 @@ android {
applicationId "org.stepic.droid"
minSdkVersion 14
targetSdkVersion 23
versionCode 41
versionName "1.5.3"
versionCode 49
versionName "1.6.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Enabling multidex support.
multiDexEnabled true
Expand All @@ -36,6 +35,9 @@ android {
classic {
applicationId "org.stepic.droid"
}
releasedev{
applicationId "org.stepic.droid.release"
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -45,13 +47,13 @@ android {
abi {
enable true
reset()
include 'armeabi', 'armeabi-v7a', 'mips', 'x86' //select ABIs to build APKs for
include 'armeabi-v7a', 'mips', 'x86' //select ABIs to build APKs for
universalApk true //generate an additional APK that contains all the ABIs
}
}

// map for the version code
project.ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'mips': 5, 'x86': 8]
project.ext.versionCodes = ['armeabi-v7a': 2, 'mips': 5, 'x86': 8]

android.applicationVariants.all { variant ->
// assign different version code for each output
Expand All @@ -76,6 +78,8 @@ dependencies {
provided 'org.glassfish:javax.annotation:10.0-b28'
//needed to resolve compilation errors, thanks to tutplus.org for finding the dependency
compile 'com.jakewharton:butterknife:7.0.1'

compile 'javax.annotation:jsr250-api:1.0'
//</DI>

compile 'com.android.support:multidex:1.0.1'
Expand Down Expand Up @@ -116,17 +120,9 @@ dependencies {
// Optional -- Mockito framework
testCompile 'org.mockito:mockito-core:1.10.19'

androidTestCompile 'com.android.support:support-annotations:23.1.1'
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
// Optional -- Hamcrest library
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'

debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1' // or 1.3.1
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1' // or 1.3.1
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1' // or 1.3.1
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta2' // or 1.3.1
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' // or 1.3.1
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2' // or 1.3.1

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

Expand All @@ -136,7 +132,9 @@ dependencies {
compile files('libs/log4j-api-2.4.1.jar')
compile files('libs/slf4j-api-1.7.12.jar')

compile 'de.mrmaffen:vlc-android-sdk:3.0.0'
compile 'de.mrmaffen:vlc-android-sdk:1.9.0'

compile "com.google.android.gms:play-services-gcm:8.4.0"
}

repositories {
Expand All @@ -150,4 +148,6 @@ buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

}
apply plugin: 'com.google.gms.google-services'
13 changes: 0 additions & 13 deletions app/src/androidTest/java/org/stepic/droid/ApplicationTest.java

This file was deleted.

13 changes: 0 additions & 13 deletions app/src/androidTest/java/org/stepic/droid/util/JsonHelperTest.java

This file was deleted.

3 changes: 2 additions & 1 deletion app/src/classic/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">

<application>
<application
android:allowBackup="false">

<activity
android:name="org.stepic.droid.view.activities.LoginActivity">
Expand Down
85 changes: 76 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,30 @@
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" android:maxSdkVersion="22" />
<uses-permission
android:name="android.permission.READ_PHONE_STATE"
android:maxSdkVersion="22"/>

<permission
android:name="org.stepic.droid.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>

<uses-permission android:name="org.stepic.droid.permission.C2D_MESSAGE"/>

<uses-permission android:name="android.permission.VIBRATE"/>

<application
android:largeHeap="true"
android:name="org.stepic.droid.base.MainApplication"
android:allowBackup="false"
android:icon="@drawable/stepic_logo"
android:icon="@mipmap/ic_app_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="false"
android:theme="@style/AppTheme">

<activity
android:name="org.stepic.droid.view.activities.SplashActivity">
android:name="org.stepic.droid.view.activities.SplashActivity"
android:theme="@style/AppTheme.BrandedLaunch">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -43,7 +53,8 @@

<activity
android:name="org.stepic.droid.view.activities.MainFeedActivity"
android:label="@string/my_courses_title">
android:label="@string/my_courses_title"
android:launchMode="singleTop">

<meta-data
android:name="android.app.default_searchable"
Expand All @@ -57,7 +68,12 @@

<activity
android:name=".view.activities.SectionActivity"
android:label="@string/syllabus_title">
android:label="@string/syllabus_title"
android:parentActivityName=".view.activities.MainFeedActivity">
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".view.activities.MainFeedActivity"/>

</activity>

Expand Down Expand Up @@ -132,12 +148,63 @@
</activity>

<activity
android:hardwareAccelerated="false"
android:name=".view.activities.VideoActivity"
android:theme="@style/AppTheme.VideoPlayer"
android:configChanges="orientation|screenSize"
android:label="@string/video_title"/>
android:hardwareAccelerated="false"
android:label="@string/video_title"
android:theme="@style/AppTheme.VideoPlayer"/>

<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>

<category android:name="org.stepic.droid"/>
</intent-filter>
</receiver>

<service
android:name=".notifications.StepicGcmListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</service>
<service
android:name=".notifications.StepicInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>

<service
android:name=".notifications.RegistrationIntentService"
android:exported="false">
</service>

<activity
android:name=".view.activities.SettingsActivity"
android:label="@string/settings_title"
android:parentActivityName=".view.activities.MainFeedActivity">
<!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".view.activities.MainFeedActivity"/>

<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES"/>
</intent-filter>
</activity>

<receiver android:name=".notifications.NotificationBroadcastReceiver">
<intent-filter>
<action android:name="notification_cancelled"/>
</intent-filter>
</receiver>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.stepic.droid.core.ILessonSessionManager;
import org.stepic.droid.core.ILoginManager;
import org.stepic.droid.core.IShell;
import org.stepic.droid.notifications.INotificationManager;
import org.stepic.droid.preferences.SharedPreferenceHelper;
import org.stepic.droid.preferences.UserPreferences;
import org.stepic.droid.store.operations.DatabaseFacade;
import org.stepic.droid.util.resolvers.CoursePropertyResolver;
Expand All @@ -28,6 +30,12 @@

public abstract class FragmentActivityBase extends AppCompatActivity {

@Inject
protected INotificationManager notificationManager;

@Inject
protected SharedPreferenceHelper mSharedPreferenceHelper;

@Inject
protected ILessonSessionManager mLessonManager;

Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/org/stepic/droid/base/StepBaseFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
bus.register(this);
}


@Override
public void onResume() {
super.onResume();
hideSoftKeypad();
}

@Override
public void onDestroyView() {
bus.unregister(this);
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/org/stepic/droid/core/IScreenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ public interface IScreenManager {
void showDownload();

void showVideo(Activity sourceActivity, String source);

void showSettings(Activity sourceActivity);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import org.stepic.droid.concurrency.IMainHandler
import org.stepic.droid.events.IncomingCallEvent
import javax.inject.Inject

class MyStatePhoneListener: PhoneStateListener() {

class MyPhoneStateListener : PhoneStateListener() {
init {
MainApplication.component().inject(this)
}
Expand All @@ -24,4 +23,4 @@ class MyStatePhoneListener: PhoneStateListener() {
mHandler.post { mBus.post(IncomingCallEvent()) }
}
}
}
}
8 changes: 8 additions & 0 deletions app/src/main/java/org/stepic/droid/core/ScreenManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.stepic.droid.view.activities.MainFeedActivity;
import org.stepic.droid.view.activities.RegisterActivity;
import org.stepic.droid.view.activities.SectionActivity;
import org.stepic.droid.view.activities.SettingsActivity;
import org.stepic.droid.view.activities.StepsActivity;
import org.stepic.droid.view.activities.TextFeedbackActivity;
import org.stepic.droid.view.activities.UnitsActivity;
Expand Down Expand Up @@ -184,6 +185,13 @@ public void showVideo(Activity sourceActivity, String videoPath) {
}
}

@Override
public void showSettings(Activity sourceActivity) {
Intent intent = new Intent(sourceActivity, SettingsActivity.class);
sourceActivity.startActivity(intent);
sourceActivity.overridePendingTransition(org.stepic.droid.R.anim.push_up, org.stepic.droid.R.anim.no_transition);
}

@Override
public void showSections(Context sourceActivity, @NotNull Course course) {
YandexMetrica.reportEvent("Screen manager: show section", JsonHelper.toJson(course));
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/org/stepic/droid/core/StepicCoreComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import org.stepic.droid.concurrency.tasks.UpdateCourseTask;
import org.stepic.droid.model.Course;
import org.stepic.droid.model.Section;
import org.stepic.droid.notifications.NotificationBroadcastReceiver;
import org.stepic.droid.notifications.RegistrationIntentService;
import org.stepic.droid.notifications.StepicGcmListenerService;
import org.stepic.droid.receivers.DownloadClickReceiver;
import org.stepic.droid.receivers.DownloadCompleteReceiver;
import org.stepic.droid.receivers.InternetConnectionEnabledReceiver;
Expand Down Expand Up @@ -118,5 +121,11 @@ public interface StepicCoreComponent {

void inject(FromDbCoursesTask fromDbCoursesTask);

void inject(MyStatePhoneListener listener);
void inject(MyPhoneStateListener receiver);

void inject(RegistrationIntentService service);

void inject(StepicGcmListenerService listenerService);

void inject (NotificationBroadcastReceiver receiver);
}
Loading

0 comments on commit fce240d

Please sign in to comment.