Comments (26)
May I work on this?
from travel-mate.
@stupidly-logical
Sure, go ahead with it. Make sure the changes are in accordance with the checkstyle rules.
from travel-mate.
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.
@brijeshshah13
The benefit of creating it for activities:
- Cleaner code
- Less code repetition. (In case
n
activities are callingX
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.
@Swati4star Thank you for listing down the advantages. On it.
from travel-mate.
Yes, Use activity_name.getStartIntent()
this syntax. Will be more readable.
from travel-mate.
No. Leave that Activity.
from travel-mate.
@stupidly-logical sure , go ahead with , make sure u create new branch
from travel-mate.
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.
@stupidly-logical yeah , they should be , u mean SomeActivity.java right...
from travel-mate.
@gugakatsi yes exactly, I'll fix this too. @Swati4star ?
from travel-mate.
@stupidly-logical i like that idea.
from travel-mate.
@stupidly-logical Any updates on this issue? Are you working on this?
from travel-mate.
@Swati4star Yes, I'll send PR soon
from travel-mate.
this issue is being solved in #50
thanks @stupidly-logical
from travel-mate.
@Swati4star Can I start working on this?
from travel-mate.
Sure @brijeshshah13 👍
from travel-mate.
@Swati4star What is User
as stated in the example in the beginning?
from travel-mate.
Specify the line of code you are referring to
from travel-mate.
Parameter passed in public static Intent getStartIntent(Context context, User user)
and public static UserFragment newInstance(User user)
from travel-mate.
@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.
@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.
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.
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.
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.
Fixed by #144
from travel-mate.
Related Issues (20)
- [BUG]Application is unable to fetch data #568
- [BUG]No OSM Maps shown on Android Pie 9.0 ?
- how to change cities from india to another city HOT 1
- Slack account HOT 1
- Database HOT 2
- Unusual behaviour of list view in CityHistoryActivity [BUG] HOT 2
- i signup and give me this error Doctype html error HOT 6
- Unable to sign up. It doesn't let me[BUG] HOT 8
- Access cities in a given country
- local host not getting data HOT 1
- New Account createation error HOT 4
- UI update needed HOT 2
- [BUG] Security Issues found HOT 3
- API returning 502
- [BUG]GMS in F-Droid build
- Fix issues induced by android:drawableTint at API level <= 23
- apis problem
- Love to contribute some effort
- [FEATURE REQUEST] HOT 1
- signup issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from travel-mate.