Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
feat: Improve scrolling experience on Discover title
Browse files Browse the repository at this point in the history
Fixes: LEARNER-9514
  • Loading branch information
HamzaIsrar12 committed Aug 18, 2023
1 parent 8366f1f commit 44a15a7
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 50 deletions.
99 changes: 61 additions & 38 deletions OpenEdXMobile/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<uses-permission android:name="com.android.vending.BILLING" />

<!-- Required by app to to post notifications -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<!-- Setup for Code Coverage -->
<instrumentation
Expand All @@ -45,32 +45,35 @@

<!-- Required by branch.io -->
<!-- ref: https://help.branch.io/developers-hub/docs/android-basic-integration#configure-app -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />

<application
android:name=".base.RuntimeApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
tools:replace="android:supportsRtl"
android:supportsRtl="${supportsRtl}"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="${supportsRtl}"
android:theme="@style/AppTheme"
tools:replace="android:supportsRtl"
tools:targetApi="n">

<activity
android:name="org.edx.mobile.view.SplashActivity"
android:exported="true"
android:label="@string/app_shortcut_name"
android:theme="@style/AppTheme.NoDisplayTheme"
android:exported="true">
android:theme="@style/AppTheme.NoDisplayTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<data android:scheme="edx" android:host="open" />
<data
android:host="open"
android:scheme="edx" />
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
Expand All @@ -88,8 +91,8 @@
<activity
android:name="org.edx.mobile.view.login.LoginActivity"
android:configChanges="keyboardHidden|orientation"
android:windowSoftInputMode="adjustNothing"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar" />
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar"
android:windowSoftInputMode="adjustNothing" />

<activity
android:name="org.edx.mobile.view.RegisterActivity"
Expand All @@ -101,6 +104,7 @@
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

Expand Down Expand Up @@ -187,14 +191,14 @@

<activity
android:name=".view.DiscoveryActivity"
android:label="@string/label_discover"
android:label="@string/label_explore_the_catalog"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar" />

<activity
android:name="org.edx.mobile.view.CertificateActivity"
android:label="@string/tab_label_certificate"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar"/>
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar" />

<activity
android:name=".profiles.UserProfileActivity"
Expand Down Expand Up @@ -228,12 +232,12 @@
<activity
android:name=".view.CourseTabsDashboardActivity"
android:label=""
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar"/>
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar" />

<activity
android:name=".view.dialog.WebViewActivity"
android:screenOrientation="portrait"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
Expand All @@ -249,29 +253,31 @@

<activity
android:name=".view.CourseUpgradeWebViewActivity"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar"
android:screenOrientation="portrait"/>
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar" />

<!--Google cast expanded controls activity-->
<activity
android:name="org.edx.mobile.googlecast.ExpandedControlsActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/Theme.CastVideosTheme"
android:exported="true">
android:theme="@style/Theme.CastVideosTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>

<activity
android:name="org.edx.mobile.view.AuthenticatedWebViewActivity"
android:theme="@style/AppTheme.NoActionBar.TranslucentStatusBar" />

<receiver android:name="org.edx.mobile.module.download.DownloadCompleteReceiver"
<receiver
android:name="org.edx.mobile.module.download.DownloadCompleteReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
<action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
Expand All @@ -284,34 +290,47 @@
<intent-filter>
<action android:name="android.intent.action.MEDIA_UNMOUNTED" />
<action android:name="android.intent.action.MEDIA_REMOVED" />
<action android:name="android.intent.action.MEDIA_MOUNTED"/>
<action android:name="android.intent.action.MEDIA_MOUNTED" />

<data android:scheme="file" />
</intent-filter>
</receiver>

<!-- adb shell am broadcast -a org.edx.mobile.END_EMMA -->
<receiver android:name="org.edx.mobile.instrumentation.EndEmmaBroadcast"
<receiver
android:name="org.edx.mobile.instrumentation.EndEmmaBroadcast"
android:exported="true">
<intent-filter>
<action android:name="org.edx.mobile.END_EMMA" />
</intent-filter>
</receiver>

<!-- Setup Facebook -->
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="${fbLoginProtocolScheme}"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="${fbClientToken}"/>
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="${fbLoginProtocolScheme}" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="${fbClientToken}" />
<meta-data
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
android:value="false" />
<meta-data
android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled"
android:value="false" />

<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="${fbLoginProtocolScheme}" />
</intent-filter>
</activity>
Expand All @@ -322,33 +341,37 @@
android:value="@integer/google_play_services_version" />

<!-- Setup Firebase -->
<meta-data android:name="firebase_analytics_collection_enabled"
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="${firebaseEnabled}" />

<!-- Branch -->
<meta-data android:name="io.branch.sdk.BranchKey" android:value="${branchKey}" />
<meta-data
android:name="io.branch.sdk.BranchKey"
android:value="${branchKey}" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/image_provider"/>
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/image_provider" />
</provider>

<service android:name="org.edx.mobile.services.DownloadSpeedService" />

<!-- Notifications through Firebase Cloud Messaging (FCM) -->
<meta-data android:name="firebase_messaging_auto_init_enabled"
<meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="${fcmEnabled}" />
<service
android:name="org.edx.mobile.notifications.services.NotificationService"
android:enabled="${fcmEnabled}"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

Expand Down
5 changes: 2 additions & 3 deletions OpenEdXMobile/res/layout/fragment_webview_discovery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
<include
android:id="@+id/toolbar"
layout="@layout/collapsible_toolbar_layout"
android:visibility="gone" />
android:visibility="invisible" />

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/content_error_root"
Expand Down
3 changes: 3 additions & 0 deletions OpenEdXMobile/res/values/strings_2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@
<string name="continue_with_social">Continue with %s</string>
<!-- Message shown while user waits for response to a sign in request-->
<string name="signing_in">Signing in</string>

<!-- Title of Discover screen -->
<string name="label_explore_the_catalog">Explore the catalog</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Fragment getFirstFragment() {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(R.string.label_discover);
setTitle(R.string.label_explore_the_catalog);
environment.getAnalyticsRegistry().trackScreenView(Analytics.Screens.FIND_COURSES);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.os.Bundle;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -22,7 +23,6 @@
import org.edx.mobile.model.api.EnrolledCoursesResponse;
import org.edx.mobile.util.UiUtils;
import org.edx.mobile.util.UrlUtil;
import org.edx.mobile.util.ViewAnimationUtil;
import org.edx.mobile.util.links.DefaultActionListener;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
Expand Down Expand Up @@ -84,22 +84,19 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
private void initTitle() {
Bundle args = getArguments();
if (args != null && !TextUtils.isEmpty(args.getString(Router.EXTRA_SCREEN_TITLE))) {
binding.toolbar.getRoot().setVisibility(View.VISIBLE);
binding.toolbar.tvTitle.setText(args.getString(Router.EXTRA_SCREEN_TITLE));
binding.toolbar.tvTitle.setText(getString(R.string.label_explore_all_courses));
binding.toolbar.tvTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.edx_large));
ToolbarExtKt.setTitleStateListener(binding.toolbar.appbar,
binding.toolbar.collapsingToolbar,
new CollapsingToolbarStatListener() {
@Override
public void onExpanded() {
ViewAnimationUtil.animateTitleSize(
binding.toolbar.tvTitle,
getResources().getDimension(R.dimen.edx_x_large));
binding.toolbar.getRoot().setVisibility(View.INVISIBLE);
}

@Override
public void onCollapsed() {
ViewAnimationUtil.animateTitleSize(binding.toolbar.tvTitle,
getResources().getDimension(R.dimen.edx_large));
binding.toolbar.getRoot().setVisibility(View.VISIBLE);
}
});
} else {
Expand Down

0 comments on commit 44a15a7

Please sign in to comment.