Giter Site home page Giter Site logo

tylerbwong / stack Goto Github PK

View Code? Open in Web Editor NEW
488.0 31.0 32.0 3.79 MB

An Android app for browsing Stack Overflow and other Stack Exchange sites.

Home Page: https://stack.tylerbwong.me

License: GNU General Public License v3.0

Kotlin 99.42% JavaScript 0.12% Astro 0.26% CSS 0.20%
android kotlin stackoverflow stackexchange jetpack-compose kotlin-coroutines dagger-hilt room markdown

stack's Introduction

Stack

Build

Stack

Stack is an Android application that lets you browse stackoverflow.com and other Stack Exchange sites. It is powered by the Stack Exchange API.

Download

Get it on Google Play

Development

The goal of this project is to provide examples for the latest Android libraries and tools. A few noteworthy examples include:

Features

  • View questions, answers, and comments with rich Markdown/LaTeX previews
  • Browse any Stack Exchange site
  • Log in to vote for questions or post new questions, answers, and comments
  • Bookmark questions to save for later (Temporarily broken. See #126)
  • Search for questions with advanced filter controls
  • View other users' profiles
  • Material 3 dynamic theming available
  • Question/answer deep linking

Subprojects

Here you can also find a few useful Gradle modules as well:

License

Copyright (C) 2023 Tyler Wong

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see https://www.gnu.org/licenses.

stack's People

Contributors

androiddevnotes avatar brittanyberlanga avatar cdubthecoolcat avatar doodla avatar g-rath avatar tylerbwong avatar victorvicari avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stack's Issues

Add Better Language Detection for Syntax Highlighting

We can potentially leverage the tags in the question response to determine what code blocks should be highlighted as since most questions on the site do not properly annotate code blocks with the correct language prefix.

Add Ability to Click Tags

Clicking a tag on a question should open a new page with questions containing the same tag.

/2.2/questions?order=desc&sort=activity&tagged=android&site=stackoverflow

Support Deep Linking to Answers

Is your feature request related to a problem? Please describe.
Currently Stack does not resolve links like https://meta.stackexchange.com/a/300389/245360 which link to specific answers in a question.

Describe the solution you'd like
Ideally Stack could at least deep link to the relevant question (and then scroll down to the answer).

Need to handle /a/ and /answer/ URI formats.

"Network error"

Describe the bug
When I open Stack app, I cannot browse anything because it says "Network error"

To Reproduce
Steps to reproduce the behavior:

  1. Open Stack app
  2. Press on a post
  3. "Network error" Screenshot_20201021-145806_Stack

Expected behavior
Load the content

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

Device Info (please complete the following information):

  • Device: Note 8
  • OS: Android 8.0
  • Browser: N/A
  • Version: 1.0.2 (12)

Additional context
This issue didn't exist when I first installed it

Posting Answers Does Not Work

Describe the bug
Attempting to post a well-formed answer does not post successfully.

To Reproduce
Steps to reproduce the behavior:

  1. Pick any question on any site
  2. Attempt to post a well-formed answer
  3. The request should fail
  4. Happens with preview enabled/disabled

Expected behavior
The post answer action should return success for preview enabled/disabled.

Additional context
Seems to be due to an error in parsing the response.

Handle Offline State Better

Currently only a Snackbar is being shown when there is no internet. We can improve this experience by:

  1. Showing an empty view for whichever screen the user is on and
  2. Determine the cause of request failure and if the lack of network is detected, launch a settings Intent or use settings panels (Android 10+) to allow the user to turn their internet back on from within the app.

Crashes on opening some links

Not sure why anyone would go to it instead of just opening the app, but the app crashes nonetheless.

Reproduce:

  1. Open web browser
  2. Google search "stackoverflow."
  3. Select one of the sublinks under the official website, ie. "Questions"
  4. ??
  5. Crashes

It happens with other sublinks as well.

Explore Adding Support for Careers RSS Feed

Stack Overflow has a careers site which can be consumed in the form of an RSS feed. It would be nice to allow users to also browse these job postings.

Not sure if this is something that we can implement cleanly yet or if it fits in with the purpose of this app, but received as feedback from the Play Store.

Add Chipified Text Field When Inputting Tags

When adding tags to either a new question or filter, it would be nice to have each tag "chipfied" after a certain delimiter token (e.g. ",") is inputted.

Ideally this would be implemented as a @Composable since filters is being converted to Compose in #68 and creating a question already uses Compose.

Home Dashboard

The current home tab is not that useful. It currently shows the most recently created questions on the current site. It would be great to have some sort of home dashboard that gives some sort of general overview/feed of curated data for an authenticated user.

The screen could contain:

  1. Bookmarked questions for a particular site (Site filter can be changed based on user's associated accounts)
  2. Saved answer drafts (Site filter can be changed based on user's associated accounts)
  3. Top questions/recently created questions based on associated sites
  4. A history of recently viewed posts (Site filter but can choose any site)

For unauthenticated users, the current experience can be shown.

With Bookmarks and Answer Drafts potentially moving, a 3rd bottom tab can be added to quickly choose a site to browse.

Support Multiple Locales

Is your feature request related to a problem? Please describe.
Currently, there are four localized Stack Exchange sites:

These are all currently accessible in the app via a site change in the settings page, however it would be nice if these could be the default site if a user's default locale is one of the four.

Describe the solution you'd like

  1. We provide localized string resources for all of the current app strings for each of the four languages.
  2. We set the default site to one of the four depending on the user's default locale.

Additional context
Even though other languages are not provided by Stack Overflow, it would be nice to still have localized app string resources for them.

Download the solution OFFLINE

This add-on will solve the problem of using the Stack website from a computer
Download the solution as a text file to copy into the IDE on the computer directly

Answer Draft is Sometimes Not Found

Describe the bug
After saving an answer draft, when clicking it, it shows an empty post answer view.

To Reproduce
Steps to reproduce the behavior:

  1. Save a draft
  2. Go to the question post answer view from a deep link
  3. Draft will not be fetched

Expected behavior
The draft should auto-populate with the saved draft.

Additional context
This has to do with a difference in site parameter.

Use Proper Theme Mechanism for Composable Hierarchies

Currently we're grabbing a lot of color and font resources manually within every new @Composable hierarchy. It would be nice to create a common StackTheme that we can wrap our hierarchies in to automatically propagate the correct styles to each component.

Make Answer Comments more Discoverable

Is your feature request related to a problem? Please describe.
Currently answer comments are hidden behind long pressing the title of an answer. That is not very intuitive and hard to discover/figure out.

Describe the solution you'd like
TBD: Icon, PopupMenu, etc.

No Fallback for Opening Links if Browser is Not Present

Describe the bug
For devices that do not have any browser installed/enabled, there needs to be a fallback for opening web links from within the app:

Fatal Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=https://stackoverflow.com/... (has extras) }
       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2241)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1895)
       at android.app.Activity.startActivityForResult(Activity.java:5205)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:568)
       at android.app.Activity.startActivityForResult(Activity.java:5163)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:554)
       at android.app.Activity.startActivity(Activity.java:5534)
       at androidx.core.content.ContextCompat.startActivity(ContextCompat.java:251)
       at androidx.browser.customtabs.CustomTabsIntent.launchUrl(CustomTabsIntent.java:376)
       at me.tylerbwong.stack.ui.utils.CustomTabsHelperKt.launchCustomTab(CustomTabsHelperKt.java:34)
       at me.tylerbwong.stack.ui.MainActivity$showLogInDialog$1.onClick(MainActivity.java:250)
       at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

This breaks login and other web links throughout the app.

To Reproduce
Steps to reproduce the behavior:

  1. Remove/Disable all internet browsers on any device
  2. Open Stack
  3. Attempt to Login

Expected behavior
The app should fallback to an internal WebView.

Overlapping date and owner name

Describe the bug
When the name of the last edited by user and the name of the owner are both long, the name of the owner spans multiple lines and causes the the date text and the owner name to overlap. Confirmed occurs on the question details view. May also occur on the answer view.

To Reproduce
Visit https://meta.stackexchange.com/q/354390

Expected behavior
The date text should be above the owner name.

Screenshots
photo_2020-10-21_22-33-19

Deep Linking to Question and Clicking Another Uses Wrong Site

Describe the bug
When deep linking into a question that references another question on a different site, clicking back into previous questions will use the wrong site_parameter that's set globally in-memory, resulting in failed requests.

To Reproduce
Steps to reproduce the behavior:

  1. Click this post on Stack Overflow Meta
  2. Open with Stack
  3. Click the link in the first Answer (which should link to Stack Exchange Meta)
  4. Click back
  5. "Network error" should popup repeatedly even if "Retry" is selected

Expected behavior
The correct site_parameter should be used for each new Question visited.

Additional context
Will likely have to store the current site_parameter in a scoped ViewModel and set the global site_parameter every time a new QuestionDetailActivity is visited (onResume).

meta.stackexchange.com Questions Do Not Deep Link Properly

Describe the bug
https://meta.stackexchange.com question links have an extra title descriptor in their URL paths and are not handled properly when selected. Example

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to https://meta.stackexchange.com
  2. Click any question
  3. Stack does not handle the deep link

Expected behavior
Stack should be able to handle question links with trailing title descriptors.

Additional context
https://meta.stackexchange.com/questions/355438/no-feedback-and-cant-offer-bounty
does not work, but
https://meta.stackexchange.com/questions/355438
does.

This could be the case for other sites as well.

Multiple questions opening

Double tapping a question quickly opens it twice. Minor, but doubt it's intended.

Reproduce:

  1. Open app
  2. Double tap a question quickly

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.