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

feat: added shortcut to open saved activities from edit activities #538

Merged
merged 3 commits into from
Dec 14, 2019
Merged

feat: added shortcut to open saved activities from edit activities #538

merged 3 commits into from
Dec 14, 2019

Conversation

refactor-droidyy
Copy link
Member

@refactor-droidyy refactor-droidyy commented Nov 27, 2019

Fixes #479 Edit Badge Screen / Edit Clipart Screen

Add an "Open Folder" icon to the edit badge/edit clipart screen on the top right of the screen on the menu bar. The icon should open "Saved Badges" / "Saved Cliparts".

EditBadgeScreen:-

Screenshot_2019-11-28-00-13-02-038_org fossasia badgemagic

EditClipartScreen:-

Screenshot_2019-11-28-00-13-29-569_org fossasia badgemagic

@refactor-droidyy
Copy link
Member Author

@adityastic please review.

@refactor-droidyy
Copy link
Member Author

@yashk2000 please review.

@mariobehling
Copy link
Member

Please use the same white color as the font instead of black.

Copy link
Collaborator

@adityastic adityastic left a comment

Choose a reason for hiding this comment

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

Good Job, make the minor requested changes and we can get this merged :). Sorry for the delay, I am still busy with my mid sems

@@ -62,13 +62,26 @@ class DrawerActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedLi
setupDrawerAndToolbar()

prepareForScan()

val bundle = intent.extras
Copy link
Collaborator

@adityastic adityastic Dec 13, 2019

Choose a reason for hiding this comment

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

lets add this complete block to a function called handleIfReceivedIntents

when (item.itemId) {
R.id.open_Folder -> {
val intent = Intent(this, DrawerActivity::class.java)
intent.putExtra("badge", "badge")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
intent.putExtra("badge", "badge")
intent.putExtra("badge", "badge")
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)

because we want to cancel the last stacked activities.

when (item.itemId) {
R.id.open_Folder -> {
val intent = Intent(this, DrawerActivity::class.java)
intent.putExtra("clipart", "clipart")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
intent.putExtra("clipart", "clipart")
intent.putExtra("clipart", "clipart")
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)

because we want to cancel the last stacked activities.

android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets make it white as said by @mariobehling

val clipart = SavedClipartFragment()
supportFragmentManager.beginTransaction()
.replace(R.id.frag_container, clipart)
.commit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.commit()
.commit()
nav_view.setCheckedItem(R.id.saved_cliparts)

you also should check the navigation drawer when switching fragments as it needs to reflect as soon as you switch to another fragment.

val badge = SavedBadgesFragment()
supportFragmentManager.beginTransaction()
.replace(R.id.frag_container, badge)
.commit()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.commit()
.commit()
nav_view.setCheckedItem(R.id.saved_badges)

same for this

@refactor-droidyy
Copy link
Member Author

@adityastic thanks for the review I will update this PR soon with the requested changes : )

@refactor-droidyy
Copy link
Member Author

EditClipartActivity

Screenshot_2019-12-14-19-31-50-740_org fossasia badgemagic

EditBadgeActivity

Screenshot_2019-12-14-19-32-18-680_org fossasia badgemagic

@refactor-droidyy
Copy link
Member Author

@adityastic @mariobehling Done :)

Copy link
Collaborator

@adityastic adityastic left a comment

Choose a reason for hiding this comment

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

@refactor-droidyy great, looks perfect now 🔥 , also we try to follow semantic naming schemes when dropping a pull request, like this pr can be named 'feat: added shortcut to open saved activities from edit activities'.

@adityastic adityastic changed the title Fixes #479 Edit Badge Screen / Edit Clipart Screen feat: added shortcut to open saved activities from edit activities Dec 14, 2019
@auto-label auto-label bot added the feature label Dec 14, 2019
@adityastic adityastic merged commit 2d7aa55 into fossasia:development Dec 14, 2019
@refactor-droidyy
Copy link
Member Author

@adityastic thankyou loved learning with you :)

@adityastic
Copy link
Collaborator

@adityastic thankyou loved learning with you :)

Sorry again for not being able to review it early, Keep Learning 👍 🚀

@refactor-droidyy refactor-droidyy deleted the clipbadg branch December 26, 2019 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit Badge Screen / Edit Clipart Screen
4 participants