Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload answered quests #696

Merged
merged 10 commits into from
Jan 7, 2018

Conversation

errolpais
Copy link
Contributor

Hi @westnordost,

This addresses issue #75. I added a new upload icon into the app bar. I tested it manually prior to the java 8 upgrade and it looked good. I just re based my commits for this pull request. The app deploys and looks alright on my phone, but will test it out manually tomorrow.

I wanted to get some feedback on the pull request. I did pull out the ems configuration to make things fit and it seems alright but I might be missing something, Please let me know what you think and if you'd like me to make any additions/changes.

Thanks

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I've added some comments with remarks. Also, you should probably correct the indentation in the lambdas.

Note that I am not sure if I can squeeze it into v3, because I will be away for the whole of December and want to minimize the risk of bugs popping in that time (= not introduce any new features)

import de.westnordost.streetcomplete.data.QuestStatus;
import de.westnordost.streetcomplete.data.osm.persist.OsmQuestDao;

public class UploadsCounter extends android.support.v7.widget.AppCompatTextView {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name for the new class is confusing. After all, this is the counter of answers that have not been uploaded yet.

The other (original) counter counts the number of quest answers that have been uploaded already. This one counts the number of newly added quest answers that are pending to be uploaded. The class and field names should reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did feel there was something off. How about if I renamed both the classes. UnsyncedAnswersCounter and UploadedAnswersCounter? Both their field names can be answeredQuests since the class name will specify what kind of answered quests they contain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These names would work, yes.

answeredQuests

I meant the names of the fields in MainActivity.

<de.westnordost.streetcomplete.statistics.AnswersCounter
android:id="@+id/answersCounter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:minEms="7"
android:paddingEnd="8dp"
android:paddingStart="8dp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that look very packed on smaller devices? Does it even fit with four-digit counters each?

I think it is not really necessary to display the app's name in the header. This way, there will be more than enough space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the title and moved the counters to the left. I added back the padding. The minEms is adding a lot of space so not sure if its needed. The text being dynamic seems to make enough space for itself and the padding ensures they are not squished. Tested the layout on on a pixel emulator.

android:drawablePadding="2dp"
android:drawableStart="@drawable/ic_file_upload_24dp"
android:gravity="center_vertical"
/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component should have a proper selectable item background because it is clickable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added 'android:background="?android:attr/selectableItemBackground"' to the component. Assuming that's what you had in mind.

@errolpais errolpais force-pushed the UploadAnsweredQuests branch from e481c4b to 710223c Compare December 30, 2017 00:35
@errolpais
Copy link
Contributor Author

  • Corrected the indentation in the lambdas.
  • Renamed counter classes to UnsyncedAnswersCounter and UploadedAnswersCounter
  • Set background property for UnsyncedAnswersCounter to selectableItemBackground since it a button
  • Added Padding back
  • Removed Title and moved Counters to left side of the toolbar

Copy link
Member

@westnordost westnordost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I will merge it soon for v4!

@westnordost westnordost merged commit aa66353 into streetcomplete:master Jan 7, 2018
@errolpais errolpais deleted the UploadAnsweredQuests branch January 9, 2018 06:21
@errolpais
Copy link
Contributor Author

Yay! Thanks for the feedback and for maintaining the app 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants