Code Monkey home page Code Monkey logo

Comments (26)

stupidly-logical avatar stupidly-logical commented on June 19, 2024 1

May I work on this?

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024 1

@stupidly-logical
Sure, go ahead with it. Make sure the changes are in accordance with the checkstyle rules.

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024 1

That was just an example.
For city related fragment/activities, pass City object
Whatever seems to be relevant to be passed to the corresponding activity/fragment, add that parameter. If nothing seems to be relevant, don't add any parameter.
@brijeshshah13

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024 1

@brijeshshah13
The benefit of creating it for activities:

  • Cleaner code
  • Less code repetition. (In case n activities are calling X activity)
  • Promotes abstraction: handle complexity by hiding unnecessary details from other classes(Activities).

And about 2 copies, we won't be having 2 copies. At any point in time, there will be only 1 copy in the memory.

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024 1

@Swati4star Thank you for listing down the advantages. On it.

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024 1

Yes, Use activity_name.getStartIntent() this syntax. Will be more readable.

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024 1

No. Leave that Activity.

from travel-mate.

gugakatsi avatar gugakatsi commented on June 19, 2024

@stupidly-logical sure , go ahead with , make sure u create new branch

from travel-mate.

stupidly-logical avatar stupidly-logical commented on June 19, 2024

One issue I encountered while solving this issue is that Activities and Fragments file names are not ending with "Activity"/"Fragment" respectively.
Your views on this : @Swati4star @gugakatsi ?

from travel-mate.

gugakatsi avatar gugakatsi commented on June 19, 2024

@stupidly-logical yeah , they should be , u mean SomeActivity.java right...

from travel-mate.

stupidly-logical avatar stupidly-logical commented on June 19, 2024

@gugakatsi yes exactly, I'll fix this too. @Swati4star ?

from travel-mate.

gugakatsi avatar gugakatsi commented on June 19, 2024

@stupidly-logical i like that idea.

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024

@stupidly-logical Any updates on this issue? Are you working on this?

from travel-mate.

stupidly-logical avatar stupidly-logical commented on June 19, 2024

@Swati4star Yes, I'll send PR soon

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024

this issue is being solved in #50
thanks @stupidly-logical

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

@Swati4star Can I start working on this?

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024

Sure @brijeshshah13 👍

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

@Swati4star What is User as stated in the example in the beginning?

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024

Specify the line of code you are referring to

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

Parameter passed in public static Intent getStartIntent(Context context, User user) and public static UserFragment newInstance(User user)

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

@Swati4star Thinking it in detail, do we really require getStartIntent() for Activities because when we will be wanting an Intent for a certain activity, we are passing the Context and reference of the Activity anyway. Plus, if we implement this for Acitivities, we will be creating 2 copies of Intent even though one is enough. To the best of my knowledge, I think we should implement this functionality only for Fragments. Please share your views.

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

@Swati4star By using the same method name getStartIntent() for all activities will result into confusion as it will be directly called, so shall I add the name of the activity in the method?

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024

the method will be static, so it will be called using the ClassName of particular activity/fragment. I don't think it will create confusion. Rather, it would make it easier.

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

That will be for Fragments, when I use activity_name.getStartIntent(), Android Studio tells me to directly refer the method without using the reference of activity getStartIntent() as it will directly import that method. Still, I can use the former syntax though. Shall I go with it?

from travel-mate.

brijeshshah13 avatar brijeshshah13 commented on June 19, 2024

What about the ImagePickerActivity? Wanted to assure if I should add the method to that activity as it is decompiled .class file with a different package name all together.

from travel-mate.

Swati4star avatar Swati4star commented on June 19, 2024

Fixed by #144

from travel-mate.

Related Issues (20)

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.