GithubHelp home page GithubHelp logo

foremwebview-android's Introduction


Forem 🌱

For Empowering Community

Build Status Build Status GitHub commit activity GitHub issues ready for dev GitPod badge

Welcome to the Forem codebase, the platform that powers dev.to. We are so excited to have you. With your help, we can build out Forem’s usability, scalability, and stability to better serve our communities.

What is Forem?

Forem is open source software for building communities. Communities for your peers, customers, fanbases, families, friends, and any other time and space where people need to come together to be part of a collective. See our announcement post for a high-level overview of what Forem is.

dev.to (or just DEV) is hosted by Forem. It is a community of software developers who write articles, take part in discussions, and build their professional profiles. We value supportive and constructive dialogue in the pursuit of great code and career growth for all members. The ecosystem spans from beginner to advanced developers, and all are welcome to find their place within our community. ❤️

Table of Contents

Community

For a place to have open discussions on features, voice your ideas, or get help with general questions please visit the discussions section.

Contributing

We encourage you to contribute to Forem! Please check out the Contributing to Forem guide for guidelines about how to proceed.

Getting Started

This section provides a high-level quick start guide. If you're looking for a more thorough installation guide (for example with macOS, you'll want to refer to our complete Developer Documentation.

We run on a Rails backend, and we are currently transitioning to a Preact-first frontend.

A more complete overview of our stack is available in our docs.

To launch Forem in Gitpod, navigate to https://gitpod.io/#https://github.com/{your_github_username}/forem.

Installation Documentation

Please see our installation guides:

Developer Documentation

Check out our dedicated docs page for more technical documentation.

Vulnerability disclosure

Forem is the open source software which powers DEV.

We welcome security research on DEV under the terms of our vulnerability disclosure policy.

Acknowledgements

Thank you to the Twemoji project for the usage of their emojis.

Thank you to Uffizzi for providing ephemeral environments to preview pull requests.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Please see the LICENSE file in our repository for the full text.

Like many open source projects, we require that contributors provide us with a Contributor License Agreement (CLA). By submitting code to the Forem project, you are granting us a right to use that code under the terms of the CLA.

Our version of the CLA was adapted from the Microsoft Contributor License Agreement, which they generously made available to the public domain under Creative Commons CC0 1.0 Universal.

Any questions, please refer to our license FAQ doc or email [email protected].


Sloan, the sloth mascot
Happy Coding ❤️

⬆ Back to Top

foremwebview-android's People

Contributors

chandra-sekhar-bala avatar maestromac avatar rt4914 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foremwebview-android's Issues

Issues with back navigation button

Describe the bug
One of our long-time moderators, @thomasbnt, pointed out that they’re having mixed results with the back button in the Android app and they outlined a test pattern which I followed and confirmed I was getting the same results.

To Reproduce

Just follow these steps:

  1. Open the app
  2. Click on any post
  3. Try to use the back button with a hand gesture OR back button at the bottom of the screen (depending on your phone setting)
  4. Exit the Forem app without closing it (just go to an another app or the home screen of your phone)
  5. Go back to the Forem app
  6. Click on any post
  7. Try to use the back button
  8. It works now

Expected behavior
Using the back button (whether using a sliding hand gesture or the old school buttons on the bottom) should generally work.

Screenshots
I'm tagging in @thomasbnt to share some video!

Smartphone (please complete the following information):

  • Device: Pixel 5
  • OS: Android
  • Version: 13

WebView status observable

Create a public function which can provide the information about WebView's

Currently we don't know if the webview is loading the website or it has finished loading the website.

We can create and observable which can provide the information about the status of WebView.

List of status it should support:

  • LOADING
  • SUCCESS
  • ERROR

Back navigation does on work for the first time

Describe the bug
Back navigation does on work for the first time

To Reproduce
Steps to reproduce the behavior:

  1. Open the app with already added forem instances.
  2. Open any internal link. like an article
  3. On navigate back
  4. Notice the app closes but instead it should visit the home page.

Reference
Google playstore review on 23rd February 2023

Make VideoPlayerActivity single instance only

If user clicks on video multiple times so as to launch VideoPlayerActivity, the video player will get launched multiple times.

Make sure that there is only once instance of video player possible.

Podcasts should communicate to web code

Describe the bug
Currently we have sort of a bridge between web codebase and android-native code. This bridge helps us in controlling some very specific cases. For example:

  • if user plays a podcast, from the bridge we will get the information in android, and then android native code will play the podcast using notification manager instead of playing it in website-webview.
  • if user plays a video, the bridge passes the information to android, and then android native code will play the video in new full-screen activity.

Now currently for podcast the information can be sent from web-code to android native but we cannot send information from android native to web-code.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any podcast
  2. Play the podcast
  3. Once the podcast plays in android it will be visible in notifications section of the android os.
  4. Pause the podcast in notification.
  5. Notice that the app still shows pause icon in website.

Expected behavior
As soon as we pause the podcast in notification, the change should be reflected correctly in web-code base too.

Similar Issues

  • If we remove the podcast by clearing the notification, the website still shows as if the podcast is playing, the bottom podcast bar in website should get terminated.

Pause video when activity is in background

Description
Pause video when activity is in background

Steps to reproduce

  1. Open app with dev.to
  2. Open Videos
  3. Start any video
  4. One the video player is working, minimise the app or take app to background
  5. Notice that video is still playing as we can hear the audio

Expected behavior
The video should pause when the activity is in background and it should resume when the activity comes back to foreground.

Add Espresso Tests for MainActivity

Add Espresso Tests for MainActivity

  • Default disabled back button
  • Default disabled forward button
  • WebView is displayed
  • Going to next page enables back button
  • Going to next page and then previous page disables back button
  • Go to next page and use native-button to go home
  • Go to next page and use native-button to go home and then close the app
  • Use native back button to directly close the app

Add Progaurd Rules

Add Progaurd Rules to progaurd_rules.pro file:

  • Exoplayer rules
  • WebView JS Rules
  • Line number and source file name should be visible in mapping.txt rules

Add Espresso Tests

Add Espresso Tests for the forem library covering all possible public functions.

Protect github branches

Protect github branches by requiring atleast 1 PR review, and merge from team only and no direct commit to main

Handle errors for WebView in a better way

Handle errors for WebView in a better way

Example: if there is no internet the webpage looks kind of bad.

This issue needs a lot more details but filing this quickly so as to keep this in radar.

Unable to add `Forem.team`

Describe the bug
In Forem android app if we try adding Forem.team via domain, in Preview screen the Add To List button does not activate and as a result we cannot add this forem.

There is some issue in fetching the meta tags correctly.

Image Upload Issue for Create Post

Describe the bug
In create post, there are two places where we can upload an image (a.) cover image and (b.) image within the content.
Doing either one of these is failing and taking users to home page.

While implementing the cover image fix, make sure to upload an image-cropper too.

Can't interact with buttons

Describe the bug
A clear and concise description of what the bug is.
When you scroll, and would like to interact with like, comment and bookmark button, the Forem list show up.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any post
  2. Scroll down
  3. Click on any button on the bottom : like/comment/bookmark
  4. The Forem list show up instead of the reaction

Expected behavior
A clear and concise description of what you expected to happen.

Do not show up the Forem list, just active actions.

Screenshots
If applicable, add screenshots/videos to help explain your problem.

https://user-images.githubusercontent.com/14293805/233388627-1688803e-ddce-42b4-80a4-7d9fcd82fc73.mp4

Environment (please complete the following information):

  • Device: Pixel 6a
  • Android Version: 13
  • Release version:

Additional context
Add any other context about the problem here.

Add CI Checks

Add CI Checks

  • Test cases should run on CI
  • Linter / static checks should run on CI
    More CI checks might be added with time.

Video Player Bug

Describe the bug
Video Player does not work for a specific situation.

To Reproduce
Steps to reproduce the behavior:

  1. Open the app
  2. Go to podcasts
  3. Play one of the podcasts
  4. Stop the podcast
  5. Go back to home page
  6. Go to Videos
  7. Play one of the videos
  8. Video player won't work

Expected behavior
Video player should work in this case too.

Use single version name in build.gradle (foremWebView) file

Currently in build.gradle of foremWebView file we are using versionName at three places separately. Instead it should be a single variable which should be used at all places.

The three places where this versionName is getting used are:

buildConfigField("String", "FOREM_AGENT_EXTENSION", "\"ForemWebView/1.0.10\"")

Issue with Bottom selector when hidden

Describe the bug
In the forem app, the community selector at the bottom hinders functionality after scrolling, even though it's hidden. So it affects reacting to posts and generally any touch action at the bottom.

Steps to reproduce the behaviour:

  1. Open the app
  2. Scroll until the bottom selector is hidden
  3. Try any action in that area
  4. See the error

Expected behavior
To have the functionality of the bottom area when selector is hidden

Screenshots
Video of issue

Environment :

  • Device: Samsung S21FE
  • Android Version:13
  • Release version: v1.0.15

Icon update in website when video is closed

Describe the bug
The play/pause icon does not update and the video is closed in android

To Reproduce
Steps to reproduce the behavior:

  1. Go to any video
  2. Play the video, this will open the video in new screen.
  3. Close the video
  4. Notice that the "Pause" icon is visible on website

Expected behavior
As soon as the video screen is closed the "Pause" icon should change to "Play" icon in website.

ActivityNotFoundException for openCustomTabFunction

In production, in one case there was crash with following log:

Exception : android.content.ActivityNotFoundException	No Activity found to handle Intent { act=android.intent.action.VIEW dat=data
  at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2161)
  at android.app.Instrumentation.execStartActivity (Instrumentation.java:1805)
  at android.app.Activity.startActivityForResult (Activity.java:5805)
  at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.java:597)
  at android.app.Activity.startActivityForResult (Activity.java:5763)
  at androidx.activity.ComponentActivity.startActivityForResult (ComponentActivity.java:583)
  at android.app.Activity.startActivity (Activity.java:6261)
  at androidx.core.content.ContextCompat$Api16Impl.startActivity (ContextCompat.java:830)
  at androidx.core.content.ContextCompat.startActivity (ContextCompat.java:279)
  at androidx.browser.customtabs.CustomTabsIntent.launchUrl (CustomTabsIntent.java:376)
  at com.forem.webview.ForemWebViewClient.openCustomTab (ForemWebViewClient.java:272)
  at com.forem.webview.ForemWebViewClient.shouldOverrideUrlLoading (ForemWebViewClient.java:238)
  at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading (AwContentsClientBridge.java:89)
  at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
  at android.os.MessageQueue.next (MessageQueue.java:339)
  at android.os.Looper.loopOnce (Looper.java:176)
  at android.os.Looper.loop (Looper.java:324)
  at android.app.ActivityThread.main (ActivityThread.java:8460)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:582)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1059)

Although its hard to actually identify which url created this issue because it does work correctly for all valid urls but we can definitely prevent the crash by adding try-catch.

Improvements in Podcast Notification

Required Improvements in Podcast Notification

  • The large icon should be visible for the podcast notification currently its empty.
  • Rewind and Forward icons are actually not clearly, preferably have seconds mentioned in icons.
  • Seek should work for notification
  • Maybe add volume control similar to iOS; if android allows it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.