# **Improvement on the custom picture selector - Make it easier for contributors to choose pictures for upload on Commons Android app**
**Project Repository:** [https://github.com/commons-app/apps-android-commons](https://github.com/commons-app/apps-android-commons)
**GSoC Idea Link:** [https://github.com/commons-app/commons-app-documentation/blob/master/android/Students.md#task-ideas](https://github.com/commons-app/commons-app-documentation/blob/master/android/Students.md#task-ideas)
### **Profile:**
**Name:** Ayan Sarkar
**Email:** [ayansarkar1810@gmail.com](mailto:ayansarkar1810@gmail.com)
**Linkedin Profile:** [ayan-sarkar-44728a1a7](https://www.linkedin.com/in/ayan-sarkar-44728a1a7/)
**Github Profile:** [Ayan-10](https://github.com/Ayan-10)
**Other Communication Method:** Google Hangouts, Zulip
**Blogs on GeeksforGeeks:** [Articles](https://auth.geeksforgeeks.org/user/ayansarkar1810/articles)
**Location during GSoC:** West Bengal, India (UTC +5:30)
**Education:** B.TECH In Information Technology at Haldia Institute of Technology
**Typical working hours (include your timezone) during GSoC:** Between IST 5 pm to IST 2 am (UTC +5:30)
== Relevant Skills ==
- Experience of Android Development in Kotlin / Java
- Github Workflow and Git Version Control
- Retrofit and OkHttp
- Android UI design
- Experience of working with MVVM, MVP, MVC architecture
- Experience of working with Android Architecture Components
- Basic Understanding of RxJava, Dagger2, Androidx
- Unit testing in Android (Robolectric and Mockito)
- Understanding of REST APIs
- Basic knowledge of Wikimedia APIs
## **Synopsis**
The [Wikimedia Commons Android app](https://github.com/commons-app/apps-android-commons) allows users to upload pictures from their Android phone/tablet to [Wikimedia Commons](https://commons.wikimedia.org/wiki/Main_Page). Commons is not only the image repository for Wikipedia but an independent project that seeks to document the world with photos, videos, and recordings.
Github link: [https://github.com/commons-app/apps-android-commons/issues/4764](https://github.com/commons-app/apps-android-commons/issues/4764)
Commons Android App Repo (for UI): [https://github.com/commons-app/apps-android-commons/](https://github.com/commons-app/apps-android-commons/)
The goal of this GSoC project is to make it easier for contributors to choose pictures for upload. The feature will include UI to mark some pictures as "not for upload" (for instance family pictures), hide/unhide marked pictures, minor change to the selection indicator, gestures and indicator when previewing a picture full-screen, efficient and fast scrolling.
### **Possible Mentor(s)**
**Mentor:** @Nicolas_Raoul (Nicolas Raoul)
**Mentor:** @AdityaSrivastav2009 (Aditya Srivastav)
## **About Me**
I am a second-year Information Technology undergraduate student at **Haldia Institute of Technology.**
I am passionate about android development and I have been doing it for almost more than 2 years. I am an enthusiast about open source and love to learn and share. Since I get to know about open source I have been contributing to various open-source projects regularly. Thanks to GSOC and Wikimedia that I found this project and I found it very interesting. I think this project will be a great platform for me to learn a lot and I will give my 100% to contribute to this project.
### **Activies**
* **[Microsoft Learn Student Ambassador (MLSA''21):](https://studentambassadors.microsoft.com/en-US/profile/98148)** learn basics of Azure fundamentals, Learn and host a WordPress website in Azure Developing a Web App in using Azure with Java
* **MEMBER OF GOOGLE DEVELOPER CLUB ( KOLKATA )**
## **Past Experience**
### **Work Experience**
* **GIRLSCRIPT SUMMER OF CODE 2021** ( It will be over 31 May before GSOC coding period starts )
* **Study Partner App:** [Fixed Sign in failed state. User did not get any response if sign-in failed for API 10 exception. Responsible for handling that state using StyleableToast.](https://github.com/krayong/Study_Partner/pull/81) ( Merged )
* [Solved many programming problems related to Graph and other DS Algo.](https://github.com/Algo-Phantoms/Algo-Tree/pulls/Ayan-10) ( Not reviewed yet )
* **WINNER OF HACKTOBERFEST 2020**
* Got merged 4 Pull requests. Contributed to various projects mentioned in other contributions ( Merged )
* **OTHER OPEN SOURCE CONTRIBUTIONS**
* **Fossasia Neurolab:** [In an activity Cardviews are hardcoded, I generated the Cardviews with Recyclerview and maintain a header image that the header image can be scrollable with Cardviews.](https://github.com/fossasia/neurolab-android/pull/676) ( Not reviewed yet )
* **Amahi Android:** [Give localization support for the Hindi language.](https://github.com/amahi/android/pull/699) ( Merged )
* **Amahi Android:** [Give localization support for the Bengali language.](https://github.com/amahi/android/pull/675) ( Merged )
* **GEEKSFORGEEKS INTERN ( TECHNICAL CONTENT WRITER )**
* Responsible for writing technical blogs on various technical topics.
### **Personal Projects**
* [Conduit App: Medium Website Clone](https://github.com/Ayan-10/Conduit) - Make a clone of the renowned blog app Medium. To build this project used a backed API called realworld.io. In the app, you can login/sign up and write a blog, and read others' blogs.
* Used Retrofit and Gson for API calls
* Used Junit for tests
* Used LiveData and ViewModel
* Used Navigation Architecture
* [Sun Shine: Weather App](https://github.com/Ayan-10/Sun-Shine) - This app helps you see the weather forecast of your favorite cities.
* API calls using volley library.
* Notification
* Used content provider.
* [Emojify App](https://github.com/Ayan-10/Emojify) - This app can detect your face then classify it. According to your mood, the app can cover an emoji on your face.
* used mobile vision library for face recognization
* [L.O.L: Meme Generator App](https://github.com/Ayan-10/L.O.L-meme-generator-app) - make a meme share app using API and volley and glide library.
## **Contributions For Commons App**
### **Bug fixs:**
[[ https://github.com/commons-app/apps-android-commons/pulls?q=is%3Apr+author%3AAyan-10+ | Here ]] you can see all PRs that I made.
|||||
|--- |--- |--- |--- |
|**PR Number**|**About Bug Fix**|**Issue Number**|**Status**|
|[4315](https://github.com/commons-app/apps-android-commons/pull/4315)|In Achievements for each of the help popups, it would be great to have a link that a wiki page that explains things much more deeply. So I added a link to each info button that shows an alert dialogue and there I add a READ ME button from where the user can open the following custom webpage.|[3433](https://github.com/commons-app/apps-android-commons/issues/3433)|Merged|
|[4333](https://github.com/commons-app/apps-android-commons/pull/4333)|Fixed this issue with androidx.appcompat.widget.SearchView and rxBinding3 to show the searchview in lower API devices.|[4327](https://github.com/commons-app/apps-android-commons/issues/4327)|Merged|
|[4341](https://github.com/commons-app/apps-android-commons/pull/4341)|Toggling the info on the fields in the achievement tab is difficult because the icons are so small. So I make the whole label clickable. Now users can anywhere in the label to see the dialog. I don't remove the icon because It will help the user to understand that the label is clickable..|[4318](https://github.com/commons-app/apps-android-commons/issues/4318)|Merged|
|[4323](https://github.com/commons-app/apps-android-commons/pull/4323)|The help icon was getting invisible for small screen devices. After fixing, now the icon is visible for every device cause it's adjusting its lines instead of overlapping.|[3434](https://github.com/commons-app/apps-android-commons/issues/3434)|Merged|
### **Code Reviews:**
||||
|--- |--- |--- |
|**PR Number**|**About Review**|**Issue Number**|
|[4306](https://github.com/commons-app/apps-android-commons/pull/4306)|Added before and after merge differences, found some minor code style mistake and java modifier issues |[4299](https://github.com/commons-app/apps-android-commons/issues/4299)|
### **Issues:**
[[ https://github.com/commons-app/apps-android-commons/issues?q=is%3Aissue+author%3AAyan-10 | Here ]] you can see all issues that I created.
||||
|--- |--- |--- |--- |
|**Issue Number**|**About Issue**|**Status**|
|[4320](https://github.com/commons-app/apps-android-commons/pull/4320)|If GPS is not turned on and user click YES in the Turn on location dialog. It should turn on GPS directly instead of going to Settings like Google Maps.|Open|
|[4312](https://github.com/commons-app/apps-android-commons/pull/4312)|There should be a back button on the top of ProfileActivity like in Settings and Review Activity and also the title bar is a little blank it can contain many feature|Open|
|[4327](https://github.com/commons-app/apps-android-commons/pull/4327)|On Nearby Fragment Place type SearchView is visible properly in higher API devices like API 27 but Place type SearchView is not visible properly in lower API devices like API 23.|Closed|
|[4335](https://github.com/commons-app/apps-android-commons/pull/4335)|If the location is not available and user clicks to Exists and Needs Photo chip, it does not respond. In that state, if user clicks those chip it should show a Toast saying " Location not available ".|Open|
|[4343](https://github.com/commons-app/apps-android-commons/pull/4343)|Elements of ReviewActivity is not visible to user in landscape. We should make a landscape layout for it.|Open|
## **Implementation**
**Describe what you will implement**
I will implement some features from GSoC 2021 [idea list](https://github.com/commons-app/commons-app-documentation/blob/master/android/Students.md#task-ideas) of this project.
* **An activity for crop/blur pictures for privacy purposes**
Privacy is one of the most important parts of an app. In this current state, user can upload pictures but if they want to hide some places of a picture it can't be done. Users may want to crop out a passer-by, blur a car's number plate or faces, or may anything related to privacy. In the current state of the app, If the user wants to hide something they have to take a picture and edit with any other editing app or software. So I will implement a new activity from where user can edit images if they want. Mainly user can crop out something or blur some portion of the image. The edit button can be implemented in UploadActivity from where a new activity will open where user can edit and after editing they can upload the new image. The new image URI will be replaced with the old image URI in and also the app will be posting the new image on the server. //Rotate feature is not the task list. But I think sometimes user may need to rotate the image. So If I get some extra time in GSoC I will implement a rotate feature also otherwise I will implement rotate feature after GSoC ends.//
* **Edit uploaded pictures:Edit title/description, add depictions, add coordinates**
At the current state, after uploading contributions user can not edit them. The edit feature is only available for categories. But It should be available for
* Title
* Description
* Depicts
* Coordinates
Because user may want to edit any wrong information or any missing information, which is too much important for this app. So that the app becomes less error-prone and more informative and user-friendly. So an edit button can be implemented for each above-mentioned item in MediaDetailFragment. If user can click the edit button, then edit and upload the current information in place of old information. By clicking the upload button the current formation will be posted in the server in place of the old one by Wikimedia API.
* **Issue Number:** [4312](https://github.com/commons-app/apps-android-commons/pull/4312)
At the current state of the app in ProfileActivity title bar is blank and it's giving a very awkward look in the app as compared to other screens. There are many things we can do with the black space. Even the activity doesn't have any back button. So I will set a back button in this activity. As I discussed with the mentor we think the title bar should display username. I can put the username in the title bar and also we can make the app more user-friendly. So I will add a share button that will allow the users to share their achievements with the world and engage more people.
* **Issue Number:** [4320](https://github.com/commons-app/apps-android-commons/pull/4320)
At the current state of the app in Nearby Fragment when user clicks to recenter button if at that time device GPS is off. The app shows a dialog and the dialog leads the user to settings menu to turn on the mobile GPS. But I think we can improve that feature. Like Google Maps when device GPS is not turned on. Maps show an alert from where we can directly turn on GPS directly without going to the settings activity. It will be more efficient.
**How can it be implemented?**
* **An activity for crop/blur pictures for privacy purposes**
In the current state of the app, MainActivity calls handleActivityResult and FilePicker.handleActivityResult pick images from camera/gallery and put the image URIs in a class called UploadableFile. After that, the List<UploadableFile> was sent to UploadActivity from where the rest of the work happens for each UploadableFiles more specifically URIs. I will implement an edit button on UploadActivity from where a new Activity will open where each URI of UploadableFile can be cropped or blurred and modify the List<UploadableFile> with new URIs by replacing old ones and also display edited images in UploadActivity. Then UploadActivity will run as it is.
* **Crop:** For crop I will be using Ucrop library. It's a well-maintained library for cropping images. I will take the image URI from UploadableFile and crop it. I will also design the UI of this Activity according to App Theme. OR I can implement the whole crop feature also.
* **Blur:** I thought about the idea to do it which I think is more efficient is that I will store some blur or pixel blur images in the asset folder. The blurry assets will be of different sizes like oval, circle, square, rectangle. Users can pick those assets from a drop bottom-up menu and resize the picked asset and put the asset on that part of an image that is hidable according to user and make a new image URI with the added asset. We will do everything converting into a bitmap. Thus A new image URI we will get with blurred image.
* **Rotate:** I will use BufferedImage class in java to rotate an image.
**//Adding a Flowchart to describe the tentative workflow//**.{F34294278}
* **Edit uploaded pictures:Edit title/description, add depictions, add coordinates**
I will edit or add title/description, coordinates and depictions and display them in layout and also send them to the server using existing APIs. The way of adding title/description or coordinates and adding depictions are different which is described below.
* **Add depictions:** First I will add an edit button beside depictions in MediaDetail layout. Then I will populate an update screen where I put a searchView and RecyclerView from where user can pick suitable depictions by searching and filtering and update them on screen and server. The searching and filtering process will be done in MediaDetailFragment. In onResume I will call an existing function displayMediaDetails. From where with mediaDataExtractor will do
```
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::onDepictsRefreshed, Timber::e)
```
In onDepictsRefreshed I will call `setupDepicts` from here I will filter and set selected depicts and then after clicking the Update button. From MediaDetailFragment I will update categories with help of `DepictsEditSeearchRecyclerViewAdapter` and `DepictsEditHelper` I will update new depicts.** I attached tentative workflow below.**
* **Add title/description, coordinates:**
Add edit button in MediaDetail layout for each editable item. From where the items can be edited. Title/description, coordinates are all strings so user just edits the string s their preference. I will take those edited string and replace with old strings. And also post the new media API call with existing APIs to the server with replaced string. One thing I have to do that Title can't be blank for any media object. So if user puts a null or empty string I will handle that situation.
**//Add depicts flowchart//**:{F34294460}
* **Issue Number:** [4312](https://github.com/commons-app/apps-android-commons/pull/4312)
So I will set a back button in this ProfileActivity. As I discussed with the mentor we think the titlebar should display username. From MoreBottamSheetFragment I will send an intent with username and set the username in a text field of the titlebar. I will add a share button that will allow the users to share their achievements with the world and engage more people.
* **Issue Number:** [4320](https://github.com/commons-app/apps-android-commons/pull/4320)
I will use LocationRequest class. I will create and build the location request. also, create a task of locationSettingsResponse. Add an onCompleteListener and get a result. If GPS not on I will show a dialog to turn on location. Thus we user can able to turn on GPS directly.
##Mockups
**Tentative mockup for crop:**{F34317109}
**Tentative mockup for blur:**{F34317111}
**Tentative feagment_media_detail.xml:**{F34317222}
## **Timeline**
|||||
|--- |--- |--- |--- |
|**Timeframe**|**Start Date**|**End Date**|**Task**|
|**Community Bonding Period**|**May 17, 2021**|**June 7, 2021**|**Getting involved with organization and mentors, Getting a depth knowledge of RxJava and Wikimedia APIs, Brushing up on testing skills. Getting more Familiarized with the project structure, Read Documentation, and Code of Conduct once again. I will learn everything that will help me to contribute here in this period.**|
|**Week 1**|**June 7, 2021**|**June 14, 2020**|**Create UI of EditActivity .**|
|(SubTask)|7-June-2021|10-June-2021|Disscuss and Complete the EditActivity UI|
|(SubTask)|10-June-2021|12-June-2021|Add two tabs in EditActivity for crop and blur.|
|(SubTask)|13-June-2021|13-June-2021|Link the EditActivity with UploadActivity via a button.|
|(SubTask)|14-June-2021|14-June-2021|Test the implementation till now.|
|**Week 2**|**June 15, 2021**|**June 21, 2021**|**Implement Crop Feature.**|
|(SubTask)|15-June-2021|19-June-2021|Implementation of crop feature|
|(SubTask)|20-June-2021|21-June-2021|Test crop feature and bug fix.|
|**Week 3**|**June 22, 2021**|**June 28, 2021**|**Implement Blur Feature.**|
|(SubTask)|22-June-2021|26-June-2021|Implementation of blur feature|
|(SubTask)|27-June-2021|28-June-2021|Test blur effect and bug fix.|
|**Week 4**|**June 29, 2021**|**July 5, 2021**|**Adding created newly edited image in API call, Finishing of Edit feature.**|
|(SubTask)|29-June-2021|2-July-2021|Creating new images, replace them into uploadedfiles, display them and post API call, Finish implementation of the whole Edit|
|(SubTask)|3-July-2021|4-July-2021|Write Test for this feature|
|(SubTask)|4-July-2021|5-July-2021|Test the overall edit feature and bug fix|
|**Week 5**|**July 6, 2021**|**July 11, 2020**|**Fixing Issue Number: [4312](https://github.com/commons-app/apps-android-commons/pull/4312) and [4320](https://github.com/commons-app/apps-android-commons/pull/4320) .**|
|(SubTask)|6-July-2021|7-July-2021|Direct GPS on implementation|
|(SubTask)|7-July-2021|9-July-2021|Add back button, fetch username, and add share feature|
|(SubTask)|10-July-2021|11-July-2021|Test implementation and bug fix|
|**Week 6**|**July 12, 2021**|**July 19, 2021**|**UI of Updates**|
|(SubTask)|12-July-2021|16-July-2021|First Evaluation|
|(SubTask)|12-July-2020|16-July-2020|Discuss and Complete UI of all edit screens|
|(SubTask)|17-July-2020|19-July-2020|Test of the implementation and bug fix|
|**Week 7**|**July 20, 2021**|**July 26, 2021**|**Implement Update Depicts.**|
|(SubTask)|20-July-2021|24-July-2020|Implement classes and Adapters for depicts and make the API call with existing post functions|
|(SubTask)|24-July-2021|26-July-2021|Linking the UI with update depicts and display changes|
|**Week 8**|**July 27, 2021**|**August 2, 2021**|**Tests Depicts and other updates**|
|(SubTask)|27-July-2021|29-July-2021|Write Tests for Depicts Update|
|(SubTask)|30-July-2021|31-July-2021|Tests for Depicts and bug fix|
|(SubTask)|1-August-2021|2-August-2021|Started work on other updates UI|
|**Week 9**|**August 3, 2021**|**August 9, 2021**|**Finish All Update Feature**|
|(SubTask)|3-August-2021|6-August-2021|Take the new string from user for title/description, coordinates and replace old data with new one and update by doing the API calls with existing post functions|
|(SubTask)|7-August-2021|8-August-2020|Write tests using JUnit|
|(SubTask)|8-August-2021|9-August-2021|Tests for this implementation and bug fix|
|**Week 10 Final**|**August 10, 2021**|**August 16, 2021**|**Finish all over tasks and bug fixes**|
|(SubTask)|10-August-2021|13-August-2021|Overall Tests|
|(SubTask)|14-August-2021|16-August-2021|Remaining Bug fix and suggestions|
|(SubTask)|16-August-2020|23-August-2020|Final Evaluation|
### **Availability**
* **Are you eligible for Google Summer of Code?**
Yes, I am eligible for Google Summer of Code.
* **Do you plan to submit any other proposal apart from this one?**
No, I am only submitting this proposal.
* **Do you have any other plans during the period of GSoC?**
No, I don’t have any other plans during the period of GSoC. I was selected for Girlscript Summer of Code 2021 but It will be over before GSOC starts. I haven't any examinations during the GSoC period and also I am not applying for any other program. Google Summer of Code is the topmost priority for me.
* **How many hours per week can you dedicate to this?**
I will dedicate as much as need. Minimum 20-30 hours each week I will definitely give but I am willing to dedicate more if needed.
* **Have you been accepted to GSoC before?**
No, I have never been accepted to GSOC before.
### **Participation**
* **What is the current state of the App/Project?**
User around the world can upload images and information about images in the app and there is a leaderboard section where people can see their contribution compare to others. But now in this app, there is a little privacy issue before uploading images people can't edit that image which is a privacy concern for users which is very crucial and also there is no way to correct or update wrong or misguiding information about any image.
* **What is your goal for this GSoC Task and how will it benefit Wikimedia projects?**
The goals are to make an **edit screen** for user where user can edit their images before uploading and also **edit any uploaded wrong information for an image** and also make some enhancement in the app. User can get a more satisfying experience from the app after this contribution and the biggest benefit of being able to edit pictures before upload is it will improved image searchability.
### **Involvement**
* **Why you want to contribute to this project?**
After I found the organization I absolutely loved the way this community works. Community members are so helpful and generous to everyone. I am going to learn and gain experience so much from this project and can come up with new ideas. Other than that I found this project very interesting. So I want to mention that I already go through the codebase and project structure in where I want to contribute related to what I want to contribute in this project as you can see in the implementation section in the proposal.
* **What does open-source mean to you?**
Open Source is a platform for learning. People say "learning while doing" is the best way to learn and Open Source is the way to do so. It helps to challenge yourself and helps to get that potential out of you. It gives a lot of exposure to a student. It also helps to build a great community and helps to promote diversity. It's a way to learn and give it back to the community by contributing and helping others.
* **What does GSoC mean to you?**
For me, GSoC is a platform to learn and gain experience and also give something to the community, and also GSoC is not just about selection. It's more than that. It's about staying with the organization even after GSoC ends and give my 100% to complete tasks that I committed to do and also I can get to learn new things so much here.