Giter Club home page Giter Club logo

courserademoapp's People

Contributors

richk 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

courserademoapp's Issues

Adding more details on Readme.md file

I just across your repo which is very good appreciate by Open Source Community (Stars: 255)
Seeing the repo I could not get an overview of the project so I think need info so it will easy to understand.
Also, it will be good to adding screenshots of applications.

Injections fails witch Fragments

I'm trying to reproduce this architecture in my app. But I'm using Fragments instead Activity.
I've created same approach and it worked fine in an Activity, but when I try to convert to Fragment, the presenter is never injected by dagger. Why?

MyComponent

@FragmentScope
@Component(dependencies = ApplicationComponent.class, modules = {MyModule.class})
public interface MyComponent {
    void inject(Fragment activity);
}

MyModule.java

@Module
public class MyModule {

    private final Fragment fragment;

    public MyModule(Fragment fragment) {
        this.fragment = fragment;
    }

    @Provides
    @Named("fragment")
    @FragmentScope
    Context provideFragmentContext(){
        return fragment.getContext();
    }

    @Provides
    @FragmentScope
    RedePresenter providePresenter(UserInteractor interactor){
        return new MyPresenter(interactor);
    }

    @Provides
    @FragmentScope
    UserInteractor provideInteractor(VeekerNetworkService networkService){
        return new UserInteractor(networkService);
    }

    @Provides
    @FragmentScope
    NetworkUsersAdapter providesNetworkAdapter(){
        return new NetworkUsersAdapter(fragment.getContext());
    }
}

MyFragment.java

public class MyFragment extends Fragment {
    @Inject
    NetworkUsersAdapter mAdapter;

    @Inject
    MyPresenter mPresenter;

    private MyComponent mComponent;
    private Subscription mViewModelSubscription;


    public MyFragment() {
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mComponent = DaggerMyComponent.builder()
                .applicationComponent(((MyApplication) getActivity().getApplication()).getAppComponent())
                .myModule(new MyModule(this))
                .build();

        mComponent.inject(this);
        mPresenter.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_layou container, false);
        return rootView;
    }

    @Override
    public void onResume() {
        super.onResume();
        mViewModelSubscription = mPresenter.onResume(new Action1<NetworkParceableViewModel>() {
            @Override
            public void call(NetworkParceableViewModel viewModel) {
                final List<User> users = viewModel.userList();
                mAdapter.setNewData(users);
                mAdapter.notifyDataSetChanged();
            }
        });
    }

    @Override
    public void onPause() {
        super.onPause();
        mViewModelSubscription.unsubscribe();
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        mPresenter.onPause(outState);
    }

Screen rotation

I think there is a problem when rotating screen while background task is running. When I start the screen for the first time and interactor starts network request and I rotate the screen 2 requests are triggerred. How should we fix this in order to make interactor requests survive orientation and just delivere results like with Nucleus mvp implementation.

URLs provided in app source code are not working #error 404 files not found

Retrofit giving error 404 for URLs provided in app. Please update URLs.

06-11 02:34:57.490 20630-20658/demo.catalog.coursera.org.courserademoapp D/Retrofit: ---> HTTP GET https://api.coursera.org/api/catalog.v1/courses?fields=smallIcon
06-11 02:34:57.490 20630-20658/demo.catalog.coursera.org.courserademoapp D/Retrofit: ---> END HTTP (no body)
06-11 02:34:57.491 20630-20658/demo.catalog.coursera.org.courserademoapp D/NetworkSecurityConfig: No Network Security Config specified, using platform default
06-11 02:34:57.716 20630-20650/demo.catalog.coursera.org.courserademoapp D/EGL_emulation: eglMakeCurrent: 0xa92050c0: ver 2 0 (tinfo 0xa92031f0)
06-11 02:34:59.110 20630-20658/demo.catalog.coursera.org.courserademoapp D/Retrofit: <--- HTTP 404 https://api.coursera.org/api/catalog.v1/courses?fields=smallIcon (1619ms)
06-11 02:34:59.110 20630-20658/demo.catalog.coursera.org.courserademoapp D/Retrofit: : HTTP/1.1 404 Not Found

Showing events like Toast in view from view Model

Hi,

I am trying to implement the architecture for my new project. It was working fine for simple cases like showing list and inflating data in views.

Now, I want to try few more simpler events like Toast or showing error messages from viewmodel.

Please share how do you solve this problem.

Thanks

launchCatalogActivity in onCreate?

Hi, I saw you talk in youtube and was looking in your code, so I wonder why you navigate to the CatalogActivity in the MainActivity onCreate?
Is MainActivity even necessary?
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); FlowController.launchCatalogActivity(this); }

Great talk by the way!

UI bug

Hello,
there's currently a UI bug in your application, specifically when hitting the back button from CatalogActivity.
EXPECTED RESULT:
should exit the app
ACTUAL RESULT:
shows a blank activity (MainActivity)

See screenshot
device-2015-12-21-013159
:

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.