Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11: Introduce Oppia splash screen. #60

Merged
merged 60 commits into from
Oct 1, 2019
Merged
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
cc33261
created splash screen
veena14cs Aug 20, 2019
0e3079d
changed splash image
veena14cs Aug 20, 2019
424e032
added fade transition
veena14cs Aug 21, 2019
a0bf5bd
handle configuration changes
veena14cs Aug 21, 2019
36b6e18
created background for splashtheme
veena14cs Aug 21, 2019
96ba6b5
implemented Logging system
veena14cs Aug 21, 2019
22b913e
fixed issues
veena14cs Aug 22, 2019
14bf295
Update misc.xml
veena14cs Aug 22, 2019
8f15b20
Fixed issues
veena14cs Aug 22, 2019
5ae198c
working on test cases
veena14cs Aug 23, 2019
81f9ce7
resoilved conflicts
veena14cs Aug 26, 2019
92bb196
Update styles.xml
veena14cs Aug 26, 2019
85cb77b
fixed java doc comments
veena14cs Aug 26, 2019
1de5966
Update activity_splash.xml
veena14cs Aug 26, 2019
01e57c9
Fixed issues
veena14cs Aug 26, 2019
f74b077
uncommented some code
veena14cs Aug 26, 2019
ffcf8ea
fixed .idea file
veena14cs Aug 26, 2019
141ae32
writting unit test
veena14cs Aug 27, 2019
e78eaae
Workinh on writting testcase for fragment
veena14cs Aug 28, 2019
451c3a3
Merge branch 'splash-screen' of https://github.com/oppia/oppia-androi…
veena14cs Aug 28, 2019
c48b255
Fixing issue with test case
veena14cs Aug 28, 2019
95688f4
uncommented code
veena14cs Aug 28, 2019
cb09d1c
Merge branch 'develop' into splash-screen
veena14cs Aug 28, 2019
b7bf48c
Merge branch 'develop' into splash-screen
veena14cs Aug 29, 2019
3ef5512
Fixed spacing, rename layout files
veena14cs Aug 30, 2019
709b712
working on test case
veena14cs Aug 30, 2019
4d2f38e
issue in passing test case
veena14cs Aug 30, 2019
0024f52
Update SplashFragment.kt
veena14cs Sep 3, 2019
1dcf71c
Update SplashFragment.kt
veena14cs Sep 3, 2019
e701408
working on testcase
veena14cs Sep 13, 2019
24f4b42
integrated testcase
veena14cs Sep 17, 2019
08e712e
Delete kotlinc.xml
veena14cs Sep 17, 2019
1a934bb
Update build.gradle
veena14cs Sep 17, 2019
98f14c7
Update AndroidManifest.xml
veena14cs Sep 17, 2019
971abc5
fixed issues
veena14cs Sep 18, 2019
5574ca7
Fixed testcases
veena14cs Sep 18, 2019
79d7033
removed unused imports
veena14cs Sep 19, 2019
6063cf2
added comma for dependency
veena14cs Sep 23, 2019
5b00ff4
Merge branch 'develop' into splash-screen
veena14cs Sep 23, 2019
86569bd
fixed minor issues
veena14cs Sep 23, 2019
65ad575
added javadoc comments for activitytestrule
veena14cs Sep 23, 2019
b6d6eb0
removed blank spaces
veena14cs Sep 23, 2019
1b80666
removed splashFragment as its not used anywhere
veena14cs Sep 23, 2019
f58dc0d
Delete splash_fragment.xml
veena14cs Sep 23, 2019
e1c4933
deleted bg_splash
veena14cs Sep 23, 2019
5c1abdd
Update build.gradle
veena14cs Sep 23, 2019
dba0a18
removed blank spaces
veena14cs Sep 23, 2019
fb4b3d3
Update SplashActivityTest.kt
veena14cs Sep 23, 2019
7e86eb6
Update SplashActivityTest.kt
veena14cs Sep 24, 2019
05dea97
Delete AndroidManifest.xml
veena14cs Sep 24, 2019
ad0d6f3
Merge branch 'develop' into splash-screen
veena14cs Sep 24, 2019
c44ee98
Update styles.xml
veena14cs Sep 24, 2019
9986646
Update SplashActivityTest.kt
veena14cs Sep 24, 2019
4f7d1b0
Delete output.json
veena14cs Sep 24, 2019
08cda5c
Delete manifest-merger-debug-report.txt
veena14cs Sep 24, 2019
371d4e5
Update SplashActivityTest.kt
veena14cs Sep 24, 2019
8b95965
Update SplashActivityTest.kt
veena14cs Sep 30, 2019
7de392e
Update SplashActivityTest.kt
veena14cs Oct 1, 2019
849ccda
updated manifest
veena14cs Oct 1, 2019
15adbd5
Update AndroidManifest.xml
veena14cs Oct 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resoilved conflicts
veena14cs committed Aug 26, 2019

Verified

This commit was signed with the committer’s verified signature.
sandhose Quentin Gliech
commit 81f9ce70a00ec54ffafb4ffe263625660e1cd786
48 changes: 26 additions & 22 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
@@ -21,6 +19,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
testOptions {
unitTests {
includeAndroidResources = true
@@ -42,26 +43,29 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
api 'com.google.guava:guava:28.0-android'

testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation "com.google.truth:truth:0.43"
testImplementation 'androidx.test.espresso:espresso-core:3.2.0'

androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation "com.google.truth:truth:0.43"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.hypertrack:hyperlog:0.0.10'

implementation(
'android.arch.lifecycle:extensions:1.1.1',
'androidx.appcompat:appcompat:1.0.2',
'androidx.constraintlayout:constraintlayout:1.1.3',
'androidx.core:core-ktx:1.0.2',
'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha03',
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version",
)
testImplementation(
'androidx.test:core:1.2.0',
'androidx.test.espresso:espresso-core:3.2.0',
'androidx.test.ext:junit:1.1.1',
'com.google.truth:truth:0.43',
'org.robolectric:robolectric:4.3',
)
androidTestImplementation(
'androidx.test:core:1.2.0',
'androidx.test.espresso:espresso-core:3.2.0',
'androidx.test.ext:junit:1.1.1',
'androidx.test:runner:1.2.0',
'com.google.truth:truth:0.43',
)
implementation project(":model")
implementation project(":domain")
implementation project(":utility")
}
42 changes: 2 additions & 40 deletions app/src/main/java/org/oppia/app/HomeActivity.kt
Original file line number Diff line number Diff line change
@@ -1,52 +1,14 @@
package org.oppia.app

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.TextView
import com.google.common.util.concurrent.FutureCallback
import com.google.common.util.concurrent.Futures
import com.google.common.util.concurrent.ListenableFuture
import com.google.common.util.concurrent.MoreExecutors.directExecutor
import org.oppia.app.model.UserAppHistory
import org.oppia.util.data.AsyncDataSource
import androidx.appcompat.app.AppCompatActivity

/** The central activity for all users entering the app. */
class HomeActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.home_activity)
}

override fun onStart() {
super.onStart()
// TODO(BenHenning): Convert this to LiveData rather than risk an async operation completing outside of the
// activity's lifecycle. Also, a directExecutor() in this context could be a really bad idea if it isn't the main
// thread.
Futures.addCallback(getUserAppHistory().pendingOperation, object: FutureCallback<UserAppHistory> {
override fun onSuccess(result: UserAppHistory?) {
if (result != null && result.alreadyOpenedApp) {
getWelcomeTextView().setText(R.string.welcome_back_text)
}
}

override fun onFailure(t: Throwable) {
// TODO(BenHenning): Replace this log statement with a clearer logging API.
Log.e("HomeActivity", "Failed to retrieve user app history = "+ t)
}
}, directExecutor())
}

private fun getWelcomeTextView(): TextView {
return findViewById(R.id.welcome_text_view)
}

private fun getUserAppHistory(): AsyncDataSource<UserAppHistory> {
// TODO(BenHenning): Retrieve this from a domain provider.
return object: AsyncDataSource<UserAppHistory> {
override val pendingOperation: ListenableFuture<UserAppHistory>
get() = Futures.immediateFuture(UserAppHistory.newBuilder().setAlreadyOpenedApp(false).build())
}
supportFragmentManager.beginTransaction().add(R.id.home_fragment_placeholder, HomeFragment()).commitNow()
}
}