mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
* achievements/: add Javadocs * actions/: add Javadocs * WikiAccountAuthenticator: add Javadocs * ReasonBuilder: add Javadocs * di: Add javadocs to DI files * bookmarks: add Javadocs to bookmarks files * di: Added more Javadocs * file: add Javadocs for file picker * actions: add proper decription to the classes
This commit is contained in:
parent
803bed43d7
commit
0affe71745
25 changed files with 269 additions and 5 deletions
|
|
@ -169,9 +169,13 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* To receive the id of selected item and handle further logic for that selected item
|
||||
*/
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
// take screenshot in form of bitmap and show it in Alert Dialog
|
||||
if (id == R.id.share_app_icon) {
|
||||
View rootView = getWindow().getDecorView().findViewById(android.R.id.content);
|
||||
Bitmap screenShot = Utils.getScreenShot(rootView);
|
||||
|
|
@ -241,13 +245,18 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To call the API to fetch the count of wiki data edits
|
||||
* in the form of JavaRx Single object<JSONobject>
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
private void setWikidataEditCount() {
|
||||
String userName = sessionManager.getUserName();
|
||||
if (StringUtils.isBlank(userName)) {
|
||||
return;
|
||||
}
|
||||
compositeDisposable.add(okHttpJsonApiClient.getWikidataEdits(userName)
|
||||
compositeDisposable.add(okHttpJsonApiClient
|
||||
.getWikidataEdits(userName)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(edits -> wikidataEditsText.setText(String.valueOf(edits)), e -> {
|
||||
|
|
@ -255,6 +264,10 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a snack bar which has an action button which on click dismisses the snackbar and invokes the
|
||||
* listener passed
|
||||
*/
|
||||
private void showSnackBarWithRetry() {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
ViewUtil.showDismissibleSnackBar(findViewById(android.R.id.content),
|
||||
|
|
|
|||
|
|
@ -2,4 +2,11 @@ package fr.free.nrw.commons.achievements
|
|||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
class FeaturedImages(@field:SerializedName("Quality_images") val qualityImages: Int, @field:SerializedName("Featured_pictures_on_Wikimedia_Commons") val featuredPicturesOnWikimediaCommons: Int)
|
||||
/**
|
||||
* Represents Featured Images on WikiMedia Commons platform
|
||||
* Used by Achievements and FeedbackResponse (objects) of the user
|
||||
*/
|
||||
class FeaturedImages(
|
||||
@field:SerializedName("Quality_images") val qualityImages: Int,
|
||||
@field:SerializedName("Featured_pictures_on_Wikimedia_Commons") val featuredPicturesOnWikimediaCommons: Int
|
||||
)
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
package fr.free.nrw.commons.achievements
|
||||
|
||||
/**
|
||||
* Represent the Feedback Response of the user
|
||||
*/
|
||||
data class FeedbackResponse(val uniqueUsedImages: Int,
|
||||
val articlesUsingImages: Int,
|
||||
val deletedUploads: Int,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue