Skip to content

Commit ed241e0

Browse files
resolving Login page switching issue
2 parents c7a6c71 + d960029 commit ed241e0

File tree

55 files changed

+1505
-461
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1505
-461
lines changed

CONTRIBUTING.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,30 @@ If you're not sure where to start head on to [this wiki page](https://github.com
55

66
Here's a gist of the guidelines,
77

8-
# Make separate commits for logically separate changes
8+
1. Make separate commits for logically separate changes
99

10-
# Describe your changes well in the commit message
10+
1. Describe your changes well in the commit message
1111

12-
The first line of the commit message should be a short description of what has
12+
The first line of the commit message should be a short description of what has
1313
changed. It is also good to prefix the first line with "area: " where the "area"
1414
is a filename or identifier for the general area of the code being modified.
1515
The body should provide a meaningful commit message.
1616

17-
# Write tests for your code (if possible)
17+
1. Write Javadocs
1818

19-
# Make sure the Wiki pages don't become stale by updating them (if needed)
19+
We require contributors to include Javadocs for all new methods and classes
20+
submitted via PRs (after 1 May 2018). This is aimed at making it easier for
21+
new contributors to dive into our codebase, especially those who are new to
22+
Android development. A few things to note:
23+
24+
- This should not replace the need for code that is easily-readable in
25+
and of itself
26+
- Please make sure that your Javadocs are reasonably descriptive, not just
27+
a copy of the method name
28+
- Please do not use `@author` tags - we aim for collective code ownership,
29+
and if needed, Git allows us to see who wrote something without needing
30+
to add these tags (`git blame`)
31+
32+
1. Write tests for your code (if possible)
33+
34+
1. Make sure the Wiki pages don't become stale by updating them (if needed)

PULL_REQUEST_TEMPLATE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
## Description
1+
## Description (required)
22

3-
Fixes #{GitHub issue number}
3+
Fixes #{GitHub issue number and title}
44

55
{Describe the changes made and why they were made.}
66

7-
## Tests performed
7+
## Tests performed (required)
88

99
Tested on {API level & name of device/emulator}, with {build variant, e.g. ProdDebug}.
1010

11-
{Please test your PR at least once before submitting.}
12-
13-
## Screenshots showing what changed
11+
## Screenshots showing what changed (optional)
1412

1513
{Only for user interface changes, otherwise remove this section. See [how to take a screenshot](https://android.stackexchange.com/questions/1759/how-to-take-a-screenshot-with-an-android-device)}
14+
15+
_Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request._

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ dependencies {
2525
transitive=true
2626
}
2727

28+
implementation "com.github.deano2390:MaterialShowcaseView:1.2.0"
29+
2830
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
2931
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
3032
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
@@ -49,6 +51,8 @@ dependencies {
4951
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.0.0'
5052
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
5153

54+
implementation 'org.jsoup:jsoup:1.11.3'
55+
5256
implementation 'com.facebook.fresco:fresco:1.5.0'
5357
implementation 'com.facebook.stetho:stetho:1.5.0'
5458

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@
9292
android:label="@string/navigation_item_notification" />
9393

9494
<activity
95-
android:name=".featured.FeaturedImagesActivity"
96-
android:label="@string/title_activity_featured_images" />
95+
android:name=".category.CategoryImagesActivity"
96+
android:label="@string/title_activity_featured_images"
97+
android:parentActivityName=".contributions.ContributionsActivity" />
9798

9899
<service android:name=".upload.UploadService" />
99100

app/src/main/java/fr/free/nrw/commons/CommonsApplication.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,19 @@ public void clearApplicationData(Context context, LogoutListener logoutListener)
136136
}
137137

138138
sessionManager.clearAllAccounts()
139-
.subscribeOn(Schedulers.io())
140-
.observeOn(AndroidSchedulers.mainThread())
141-
.subscribe(() -> {
142-
Timber.d("All accounts have been removed");
143-
//TODO: fix preference manager
144-
defaultPrefs.edit().clear().apply();
145-
applicationPrefs.edit().clear().apply();
146-
applicationPrefs.edit().putBoolean("firstrun", false).apply();
147-
otherPrefs.edit().clear().apply();
148-
updateAllDatabases();
149-
150-
logoutListener.onLogoutComplete();
151-
});
139+
.subscribeOn(Schedulers.io())
140+
.observeOn(AndroidSchedulers.mainThread())
141+
.subscribe(() -> {
142+
Timber.d("All accounts have been removed");
143+
//TODO: fix preference manager
144+
defaultPrefs.edit().clear().apply();
145+
applicationPrefs.edit().clear().apply();
146+
applicationPrefs.edit().putBoolean("firstrun", false).apply();
147+
otherPrefs.edit().clear().apply();
148+
updateAllDatabases();
149+
150+
logoutListener.onLogoutComplete();
151+
});
152152
}
153153

154154
/**

app/src/main/java/fr/free/nrw/commons/MediaDataExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public void fetch(String filename, LicenseList licenseList) throws IOException {
6161
}
6262

6363
try{
64-
Timber.d("Nominated for deletion: " + mediaWikiApi.pageExists("Commons:Deletion_requests/"+filename));
65-
deletionStatus = mediaWikiApi.pageExists("Commons:Deletion_requests/"+filename);
64+
deletionStatus = mediaWikiApi.pageExists("Commons:Deletion_requests/" + filename);
65+
Timber.d("Nominated for deletion: " + deletionStatus);
6666
}
6767
catch (Exception e){
6868
Timber.d(e.getMessage());

app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import android.accounts.AccountAuthenticatorActivity;
55
import android.accounts.AccountAuthenticatorResponse;
66
import android.accounts.AccountManager;
7-
import android.app.Activity;
87
import android.app.ProgressDialog;
9-
import android.content.DialogInterface;
108
import android.content.Intent;
119
import android.content.SharedPreferences;
1210
import android.net.Uri;
@@ -25,7 +23,6 @@
2523
import android.view.MenuItem;
2624
import android.view.View;
2725
import android.view.ViewGroup;
28-
import android.view.inputmethod.InputMethodManager;
2926
import android.widget.Button;
3027
import android.widget.EditText;
3128
import android.widget.TextView;
@@ -39,16 +36,13 @@
3936
import butterknife.BindView;
4037
import butterknife.ButterKnife;
4138
import butterknife.OnClick;
42-
import fr.free.nrw.commons.AboutActivity;
4339
import fr.free.nrw.commons.BuildConfig;
44-
import fr.free.nrw.commons.CommonsApplication;
4540
import fr.free.nrw.commons.PageTitle;
4641
import fr.free.nrw.commons.R;
4742
import fr.free.nrw.commons.Utils;
4843
import fr.free.nrw.commons.WelcomeActivity;
4944
import fr.free.nrw.commons.contributions.ContributionsActivity;
5045
import fr.free.nrw.commons.di.ApplicationlessInjection;
51-
import fr.free.nrw.commons.featured.FeaturedImagesActivity_MembersInjector;
5246
import fr.free.nrw.commons.mwapi.MediaWikiApi;
5347
import fr.free.nrw.commons.nearby.NearbyActivity;
5448
import fr.free.nrw.commons.theme.NavigationBaseActivity;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package fr.free.nrw.commons.category;
2+
3+
import java.util.List;
4+
5+
import javax.inject.Inject;
6+
import javax.inject.Singleton;
7+
8+
import fr.free.nrw.commons.Media;
9+
import fr.free.nrw.commons.mwapi.MediaWikiApi;
10+
11+
@Singleton
12+
public class CategoryImageController {
13+
14+
private MediaWikiApi mediaWikiApi;
15+
16+
@Inject
17+
public CategoryImageController(MediaWikiApi mediaWikiApi) {
18+
this.mediaWikiApi = mediaWikiApi;
19+
}
20+
21+
/**
22+
* Takes a category name as input and calls the API to get a list of images for that category
23+
* @param categoryName
24+
* @return
25+
*/
26+
public List<Media> getCategoryImages(String categoryName) {
27+
return mediaWikiApi.getCategoryImages(categoryName);
28+
}
29+
}

0 commit comments

Comments
 (0)