Code Monkey home page Code Monkey logo

redgram-for-reddit's Introduction

redgram-for-reddit's People

Contributors

bidluo avatar mhdatie avatar ninadmg 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

redgram-for-reddit's Issues

App crashes when a subreddit is requested from the SubscriptionFragment

The app only crashes when the SubscriptionActivity is visited while the SearchFragment is on top the MainActivtiy fragment manager stack, which always has HomeFragment inserted. The problem is hard to debug as it happens at different times due to loss of state.

Basically, IllegalStateExceptionis thrown when a commit is done without guarantee that the state is saved.

Additional read: http://www.androiddesignpatterns.com/2013/08/fragment-transaction-commit-state-loss.html

The solution was found on SO and it explains why the problem happens.

Program to interfaces

In the Todo list I have provided a link that explains what this term means. I was also told in a Reddit comment that I should not add static dependencies to the Application Class and should inject them through Dagger and "program to interfaces." This also applies to the whole application.

I'm currently reading about Dagger in order to apply it throughout the code. If you're familiar with it, and can provide a running example on this code, it would be appreciated.

Interfaces ease unit testing, and to depend on interfaces needs good design and good naming conventions for the code to be easy to read.

The current single network call could be extended to a search function later on, but for now, the goal is to build a reliable base which would explain how things should go on.

I am looking at ways to use RxJava for UI listeners, image and video display as shown in thisrepo: https://github.com/dlew/android-gfycat

Let me hear out your thoughts please. Thanks.

Organizing Views and Presenters

ContentView is extended by both the views of Activities and Fragments that are part of a component. The interface method getContentContext() returns a BaseContextView which calls either getBaseActivity() or getBaseFragment(), which are implemented by the base activity/fragment, depending on the implementing view class.

ContentSubView is implemented by custom views that are used as part of activity or fragment layouts and are part of a sub-component. It extends ContentView. The method setBaseContextView(BaseContextView baseContextView) helps identify whether the custom view is part of an Activity or a Fragment for the RxLifeCycle, since Android's getContext() can never be a Fragment.

BaseContextView is only implemented by BaseActivity and BaseFragment, as well as 'SettingsActivity' which isn't part of a component.

BaseView is extended by all views.


Adding BasePresenter interface to make registerForEvents() and unregisterForEvents available in all sub presenters.


WARNING: Initial commit is not tested yet

Profile Activity - Requirements

This ticket will hold general commits done for implementing the profile activity with its related API endpoints. The following endpoints will be grouped for the sake of clarity:

Subtasks: #62

https://www.reddit.com/dev/api

t1_ Comment
t2_ Account
t3_ Link
UserList_ User List

Account

/api/v1/me: Returns the identity of the user currently authenticated via OAuth. Currently stored in local DB and obtained upon Login.
/blocked: Returns a Listing of type UserList
/friends: Returns a Listing of type UserList
/karma
/prefs: Currently stored in local DB and obtained upon Login.
/trophies
Users

/api/v1/me/friends/username: operates with GET, PUT (add or update a friend), DELETE (remove a friend)
/api/v1/user/username/trophies
/user/username: common prefix
/about: Returns a Listing of type t2
/comments: Returns a Listing of type t1
/submitted: Returns a Listing of type t3
/upvoted: Returns a Listing of type t3
/downvoted: Returns a Listing of type t3
/overview: Returns a Listing of type t1 AND t3
/saved: Returns a Listing of type t1 AND t3
/gilded: Returns a Listing of type ??
Possible:

Friends

/r/friends: To view submissions from friends (common prefix)
/comments: To view comments from friends
/gilded: To view comments friends received gold on

ThreadActivity

  • Add Markdown
  • Comments Operations
    • load more
    • up/down votes
    • etc

Profile Activity - implement user activity

depends on:

  • Refactoring comments
  • Refactoring post item into single item view

implements:

  • combines list and commend feeds
  • ensures limited functionality only (different actions or different set of actions)

Peer review and branching model

Hello,

I have a few suggestions.

Branching model

The status on the README file currently () says:

Implementing the image manager that will be responsible for viewing the possible image types and sizes

There is currently no code in the master branch. I would to suggest the adoption of a branching model. Specifically,
I suggest the one described int this article

Peer review

Can we also use a peer review system. I suggest gerrit since it allows github sign in.

UI

I do not understand what is going on with the Wireframes on the README. Can we please re-do them, and aim use
material design

Custom Navigation Drawer

I was thinking of implementing a drawer like Slack? I like the way it handles multiple accounts and account information (by clicking at username).

Wikis - Android Studio codestyle.xml to help keep coding style consistent

Hey,

What do you guys think of including a codestyle.xml file for this project? This will help keep the code style more consistent between contributors.

We could use some that are hosted by some bigger companies, for example here is the Google codestyle file:
https://github.com/android/platform_development/blob/master/ide/intellij/codestyles/AndroidStyle.xml

Here is Square's:
https://github.com/square/java-code-styles

Here are some instructions on how to import a codestyle into your configuration:
https://androidbycode.wordpress.com/2015/02/14/applying-the-aosp-coding-style-in-android-studio/

Here is how to apply the imported codestyle to the current project:
https://www.jetbrains.com/help/idea/2016.1/copying-code-style-settings.html

Wikis

Hey everyone, I want to start a Wiki page to explain everything about this project. Here's a list of what I will be writing about:

  • Introduction
  • Purpose
  • Installation
  • Libraries
  • File Structure
  • Contribution
  • Supported Features
  • Design
  • Code Style
  • Build Architecture
  • Release Notes
  • What's Next

Can you suggest a better structure for the pages? Can you break it down further? Am I missing something?

Configuring Realm

At this moment Realm is configured to store a single Session, which holds the User information. The User object hold the token information.

Getting rid of SharedPreferences for two things:

  • NSFW flag.
  • Subreddits list.

Subreddits and user Settings should be stored under the User object, and have a one-to-one relationship to each of them.

In the case when switching a user is performed, only the User the object is updated. This means the session stores application (or global) settings only.

Organizing releases and splitting work

Hey all, I will be attempting to look at open source builds so that whenever code is committed, we want to make sure no one breaks the build or create a merge conflict. This is bound to happen as more people will be working on this project.

Also, I would like to suggest following this branching model http://nvie.com/posts/a-successful-git-branching-model/. Please go through when you have the time.

We should work in parallel. As soon as you are comfortable with the code, we will start splitting teams and create branches for bug fixes, enhancements and new features.

This should be a good experience to everyone, and I'm excited about it.

Please, if you run into the app and find issues, create an issue immediately and explain what the problem is, not what the code does, the latter should be explained in the comments as we are debugging the issue.

Please let me know if you have any suggestions.

App - Test Coverage

The application currently has 0 test coverage. I can only unit test, but have no experience in UI testing.

I think we should start with testing the API calls from RedditClient.java

ProfileActivity - Profile Implementation

This ticket will hold general commits done for implementing the profile activity with its related API endpoints. The following endpoints will be grouped for the sake of clarity:

https://www.reddit.com/dev/api

t1_ Comment
t2_ Account
t3_ Link
UserList_ User List

Account

  • /api/v1/me: Returns the identity of the user currently authenticated via OAuth. Currently stored in local DB and obtained upon Login.
    • /blocked: Returns a Listing of type UserList
    • /friends: Returns a Listing of type UserList
    • /karma
    • /prefs: Currently stored in local DB and obtained upon Login.
    • /trophies

Users

  • /api/v1/me/friends/username: operates with GET, PUT (add or update a friend), DELETE (remove a friend)
  • /api/v1/user/username/trophies
  • /user/username: common prefix
    • /about: Returns a Listing of type t2
    • /comments: Returns a Listing of type t1
    • /submitted: Returns a Listing of type t3
    • /upvoted: Returns a Listing of type t3
    • /downvoted: Returns a Listing of type t3
    • /overview: Returns a Listing of type t1 AND t3
    • /saved: Returns a Listing of type t1 AND t3
    • /gilded: Returns a Listing of type ??

Possible:

Friends

  • /r/friends: To view submissions from friends (common prefix)
    • /comments: To view comments from friends
    • /gilded: To view comments friends received gold on

Add network calls to getHomeViewWrapper()

I'm consolidating network calls to a main one so it gathers everything and present it to the views. So far it only fetches the subscriptions. I want to fetch the links as well and pass the results to the linkContainerView which is basically a component that deals with anything related to links.

Account Manager

I'm going to advocate that you remove functionality from presenters related to a user performing an action on something. Things like voting, reporting, saving etc will crop up quite often which means code is likely to be duplicated across presenters.

It would probably make sense to inject an AccountManager into each presenter that takes care of these kind of things. It can have a method for each action that can be performed and take the id of the Thing to perform it on and provide callbacks to let the Presenter know whether or not the action succeeded.

Multiple Accounts Implementation - Support for Application OAuth

The following tasks are required for this ticket:

  • Moving the account list in the drawer to a sub-component to be used within other components.
  • Adding the logic to:
    • Account switch
    • Account removal
    • Account addition
  • Implementing support for multiple accounts by making sure the above work.
  • Implementing Application OAuth for when no account is selected.
  • Adding a constraint on API calls that require authentication.

Slack Invite

@Redgram/redributors
CC: all

Please provide me with your emails for everyone looking to keep track of code changes and engage in future discussions on development.

I added Github and Travis integration so we can get notified of code changes and build status.

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.