mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Merge branch 'leaderboard' into merge-master-temp-branch
This commit is contained in:
commit
eec0f14cb5
21 changed files with 810 additions and 624 deletions
|
|
@ -7,10 +7,9 @@ import androidx.test.espresso.intent.Intents
|
|||
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
|
||||
import androidx.test.espresso.intent.rule.IntentsTestRule
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
import androidx.test.filters.MediumTest
|
||||
import androidx.test.runner.AndroidJUnit4
|
||||
import fr.free.nrw.commons.achievements.AchievementsActivity
|
||||
import fr.free.nrw.commons.auth.LoginActivity
|
||||
import fr.free.nrw.commons.profile.ProfileActivity
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
|
@ -32,6 +31,6 @@ class AchievementsActivityTest {
|
|||
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
|
||||
onView(withId(R.id.user_icon)).perform(click())
|
||||
|
||||
Intents.intended(hasComponent(AchievementsActivity::class.java.name))
|
||||
Intents.intended(hasComponent(ProfileActivity::class.java.name))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,8 +137,8 @@
|
|||
/>
|
||||
|
||||
<activity
|
||||
android:name=".achievements.AchievementsActivity"
|
||||
android:label="@string/Achievements" />
|
||||
android:name=".profile.ProfileActivity"
|
||||
android:label="@string/Profile" />
|
||||
|
||||
<activity
|
||||
android:name=".bookmarks.BookmarksActivity"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import javax.inject.Singleton;
|
|||
|
||||
import fr.free.nrw.commons.Media;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.achievements.FeedbackResponse;
|
||||
import fr.free.nrw.commons.profile.achievements.FeedbackResponse;
|
||||
import fr.free.nrw.commons.auth.SessionManager;
|
||||
import fr.free.nrw.commons.mwapi.OkHttpJsonApiClient;
|
||||
import fr.free.nrw.commons.utils.ViewUtilWrapper;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import dagger.Module;
|
|||
import dagger.android.ContributesAndroidInjector;
|
||||
import fr.free.nrw.commons.AboutActivity;
|
||||
import fr.free.nrw.commons.WelcomeActivity;
|
||||
import fr.free.nrw.commons.achievements.AchievementsActivity;
|
||||
import fr.free.nrw.commons.auth.LoginActivity;
|
||||
import fr.free.nrw.commons.auth.SignupActivity;
|
||||
import fr.free.nrw.commons.bookmarks.BookmarksActivity;
|
||||
|
|
@ -15,6 +14,7 @@ import fr.free.nrw.commons.explore.depictions.WikidataItemDetailsActivity;
|
|||
import fr.free.nrw.commons.explore.SearchActivity;
|
||||
import fr.free.nrw.commons.explore.ExploreActivity;
|
||||
import fr.free.nrw.commons.notification.NotificationActivity;
|
||||
import fr.free.nrw.commons.profile.ProfileActivity;
|
||||
import fr.free.nrw.commons.review.ReviewActivity;
|
||||
import fr.free.nrw.commons.settings.SettingsActivity;
|
||||
import fr.free.nrw.commons.upload.UploadActivity;
|
||||
|
|
@ -68,7 +68,7 @@ public abstract class ActivityBuilderModule {
|
|||
abstract ExploreActivity bindExploreActivity();
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract AchievementsActivity bindAchievementsActivity();
|
||||
abstract ProfileActivity bindAchievementsActivity();
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract BookmarksActivity bindBookmarksActivity();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import fr.free.nrw.commons.explore.recentsearches.RecentSearchesFragment;
|
|||
import fr.free.nrw.commons.media.MediaDetailFragment;
|
||||
import fr.free.nrw.commons.media.MediaDetailPagerFragment;
|
||||
import fr.free.nrw.commons.nearby.fragments.NearbyParentFragment;
|
||||
import fr.free.nrw.commons.profile.achievements.AchievementsFragment;
|
||||
import fr.free.nrw.commons.profile.leaderboard.LeaderboardFragment;
|
||||
import fr.free.nrw.commons.review.ReviewImageFragment;
|
||||
import fr.free.nrw.commons.settings.SettingsFragment;
|
||||
import fr.free.nrw.commons.upload.categories.UploadCategoriesFragment;
|
||||
|
|
@ -103,4 +105,10 @@ public abstract class FragmentBuilderModule {
|
|||
|
||||
@ContributesAndroidInjector
|
||||
abstract ParentCategoriesFragment bindParentCategoriesFragment();
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract AchievementsFragment bindAchievementsFragment();
|
||||
|
||||
@ContributesAndroidInjector
|
||||
abstract LeaderboardFragment bindLeaderboardFragment();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package fr.free.nrw.commons.mwapi;
|
|||
import android.text.TextUtils;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.gson.Gson;
|
||||
import fr.free.nrw.commons.achievements.FeaturedImages;
|
||||
import fr.free.nrw.commons.achievements.FeedbackResponse;
|
||||
import fr.free.nrw.commons.profile.achievements.FeaturedImages;
|
||||
import fr.free.nrw.commons.profile.achievements.FeedbackResponse;
|
||||
import fr.free.nrw.commons.campaigns.CampaignResponseDTO;
|
||||
import fr.free.nrw.commons.explore.depictions.DepictsClient;
|
||||
import fr.free.nrw.commons.location.LatLng;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
package fr.free.nrw.commons.profile;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.profile.achievements.AchievementsFragment;
|
||||
import fr.free.nrw.commons.profile.leaderboard.LeaderboardFragment;
|
||||
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ProfileActivity extends NavigationBaseActivity {
|
||||
|
||||
private FragmentManager supportFragmentManager;
|
||||
|
||||
@BindView(R.id.viewPager)
|
||||
ViewPager viewPager;
|
||||
|
||||
@BindView(R.id.tab_layout)
|
||||
TabLayout tabLayout;
|
||||
|
||||
ViewPagerAdapter viewPagerAdapter;
|
||||
private AchievementsFragment achievementsFragment;
|
||||
private LeaderboardFragment leaderboardFragment;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_profile);
|
||||
ButterKnife.bind(this);
|
||||
initDrawer();
|
||||
setTitle(R.string.Profile);
|
||||
|
||||
supportFragmentManager = getSupportFragmentManager();
|
||||
viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());
|
||||
viewPager.setAdapter(viewPagerAdapter);
|
||||
tabLayout.setupWithViewPager(viewPager);
|
||||
setTabs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a way to change current activity to AchievementActivity
|
||||
* @param context
|
||||
*/
|
||||
public static void startYourself(Context context) {
|
||||
Intent intent = new Intent(context, ProfileActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
private void setTabs() {
|
||||
List<Fragment> fragmentList = new ArrayList<>();
|
||||
List<String> titleList = new ArrayList<>();
|
||||
achievementsFragment = new AchievementsFragment();
|
||||
fragmentList.add(achievementsFragment);
|
||||
titleList.add(getResources().getString(R.string.achievements_tab_title).toUpperCase());
|
||||
leaderboardFragment = new LeaderboardFragment();
|
||||
fragmentList.add(leaderboardFragment);
|
||||
titleList.add(getResources().getString(R.string.leaderboard_tab_title).toUpperCase());
|
||||
viewPagerAdapter.setTabData(fragmentList, titleList);
|
||||
viewPagerAdapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
compositeDisposable.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package fr.free.nrw.commons.profile;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ViewPagerAdapter extends FragmentPagerAdapter {
|
||||
private List<Fragment> fragmentList = new ArrayList<>();
|
||||
private List<String> fragmentTitleList = new ArrayList<>();
|
||||
|
||||
public ViewPagerAdapter(FragmentManager manager) {
|
||||
super(manager);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the fragment of the viewpager at a particular position
|
||||
* @param position
|
||||
*/
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return fragmentList.get(position);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the total number of fragments in the viewpager.
|
||||
* @return size
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the fragment and title list in the viewpager
|
||||
* @param fragmentList List of all fragments to be displayed in the viewpager
|
||||
* @param fragmentTitleList List of all titles of the fragments
|
||||
*/
|
||||
public void setTabData(List<Fragment> fragmentList, List<String> fragmentTitleList) {
|
||||
this.fragmentList = fragmentList;
|
||||
this.fragmentTitleList = fragmentTitleList;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the title of the page at a particular position
|
||||
* @param position
|
||||
*/
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return fragmentTitleList.get(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.free.nrw.commons.achievements
|
||||
package fr.free.nrw.commons.profile.achievements
|
||||
|
||||
/**
|
||||
* Represents Achievements class and stores all the parameters
|
||||
|
|
@ -87,12 +87,14 @@ class Achievements {
|
|||
*/
|
||||
@JvmStatic
|
||||
fun from(response: FeedbackResponse): Achievements {
|
||||
return Achievements(response.uniqueUsedImages,
|
||||
return Achievements(
|
||||
response.uniqueUsedImages,
|
||||
response.articlesUsingImages,
|
||||
response.thanksReceived,
|
||||
response.featuredImages.qualityImages
|
||||
+ response.featuredImages.featuredPicturesOnWikimediaCommons, 0,
|
||||
response.deletedUploads)
|
||||
response.deletedUploads
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,61 +1,52 @@
|
|||
package fr.free.nrw.commons.achievements;
|
||||
package fr.free.nrw.commons.profile.achievements;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.appcompat.view.ContextThemeWrapper;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
|
||||
|
||||
import com.dinuscxj.progressbar.CircleProgressBar;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import com.dinuscxj.progressbar.CircleProgressBar;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.Utils;
|
||||
import fr.free.nrw.commons.auth.SessionManager;
|
||||
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
|
||||
import fr.free.nrw.commons.mwapi.OkHttpJsonApiClient;
|
||||
import fr.free.nrw.commons.theme.NavigationBaseActivity;
|
||||
import fr.free.nrw.commons.utils.ViewUtil;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import timber.log.Timber;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* activity for sharing feedback on uploaded activity
|
||||
* fragment for sharing feedback on uploaded activity
|
||||
*/
|
||||
public class AchievementsActivity extends NavigationBaseActivity {
|
||||
public class AchievementsFragment extends CommonsDaggerSupportFragment {
|
||||
|
||||
private static final double BADGE_IMAGE_WIDTH_RATIO = 0.4;
|
||||
private static final double BADGE_IMAGE_HEIGHT_RATIO = 0.3;
|
||||
|
|
@ -64,55 +55,71 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
|
||||
@BindView(R.id.achievement_badge_image)
|
||||
ImageView imageView;
|
||||
|
||||
@BindView(R.id.achievement_badge_text)
|
||||
TextView badgeText;
|
||||
|
||||
@BindView(R.id.achievement_level)
|
||||
TextView levelNumber;
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
|
||||
@BindView(R.id.thanks_received)
|
||||
TextView thanksReceived;
|
||||
|
||||
@BindView(R.id.images_uploaded_progressbar)
|
||||
CircleProgressBar imagesUploadedProgressbar;
|
||||
|
||||
@BindView(R.id.images_used_by_wiki_progress_bar)
|
||||
CircleProgressBar imagesUsedByWikiProgressBar;
|
||||
|
||||
@BindView(R.id.image_reverts_progressbar)
|
||||
CircleProgressBar imageRevertsProgressbar;
|
||||
|
||||
@BindView(R.id.image_featured)
|
||||
TextView imagesFeatured;
|
||||
|
||||
@BindView(R.id.images_revert_limit_text)
|
||||
TextView imagesRevertLimitText;
|
||||
|
||||
@BindView(R.id.progressBar)
|
||||
ProgressBar progressBar;
|
||||
|
||||
@BindView(R.id.layout_image_uploaded)
|
||||
RelativeLayout layoutImageUploaded;
|
||||
|
||||
@BindView(R.id.layout_image_reverts)
|
||||
RelativeLayout layoutImageReverts;
|
||||
|
||||
@BindView(R.id.layout_image_used_by_wiki)
|
||||
RelativeLayout layoutImageUsedByWiki;
|
||||
|
||||
@BindView(R.id.layout_statistics)
|
||||
LinearLayout layoutStatistics;
|
||||
|
||||
@BindView(R.id.images_used_by_wiki_text)
|
||||
TextView imageByWikiText;
|
||||
|
||||
@BindView(R.id.images_reverted_text)
|
||||
TextView imageRevertedText;
|
||||
|
||||
@BindView(R.id.images_upload_text_param)
|
||||
TextView imageUploadedText;
|
||||
|
||||
@BindView(R.id.wikidata_edits)
|
||||
TextView wikidataEditsText;
|
||||
|
||||
|
||||
@Inject
|
||||
SessionManager sessionManager;
|
||||
|
||||
@Inject
|
||||
OkHttpJsonApiClient okHttpJsonApiClient;
|
||||
MenuItem item;
|
||||
|
||||
private CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
||||
// To keep track of the number of wiki edits made by a user
|
||||
private int numberOfEdits = 0;
|
||||
|
||||
MenuItem item;
|
||||
|
||||
/**
|
||||
* This method helps in the creation Achievement screen and
|
||||
* dynamically set the size of imageView
|
||||
|
|
@ -120,15 +127,13 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
* @param savedInstanceState Data bundle
|
||||
*/
|
||||
@Override
|
||||
@SuppressLint("StringFormatInvalid")
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_achievements);
|
||||
ButterKnife.bind(this);
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.fragment_achievements, container, false);
|
||||
ButterKnife.bind(this, rootView);
|
||||
|
||||
// DisplayMetrics used to fetch the size of the screen
|
||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
||||
int height = displayMetrics.heightPixels;
|
||||
int width = displayMetrics.widthPixels;
|
||||
|
||||
|
|
@ -139,37 +144,23 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
params.width = (int) (width * BADGE_IMAGE_WIDTH_RATIO);
|
||||
imageView.requestLayout();
|
||||
|
||||
setSupportActionBar(toolbar);
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
hideLayouts();
|
||||
setWikidataEditCount();
|
||||
setAchievements();
|
||||
initDrawer();
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
compositeDisposable.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* To invoke the AlertDialog on clicking info button
|
||||
*/
|
||||
@OnClick(R.id.achievement_info)
|
||||
public void showInfoDialog(){
|
||||
launchAlert(getResources().getString(R.string.Achievements)
|
||||
,getResources().getString(R.string.achievements_info_message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.menu_about, menu);
|
||||
super.onCreateOptionsMenu(menu, menuInflater);
|
||||
menuInflater.inflate(R.menu.menu_about, menu);
|
||||
item = menu.getItem(0);
|
||||
item.setVisible(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -180,7 +171,7 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
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);
|
||||
View rootView = getActivity().getWindow().getDecorView().findViewById(android.R.id.content);
|
||||
Bitmap screenShot = Utils.getScreenShot(rootView);
|
||||
showAlert(screenShot);
|
||||
}
|
||||
|
|
@ -188,20 +179,39 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* It display the alertDialog with Image of screenshot
|
||||
* @param screenshot
|
||||
*/
|
||||
public void showAlert(Bitmap screenshot){
|
||||
AlertDialog.Builder alertadd = new AlertDialog.Builder(getActivity());
|
||||
LayoutInflater factory = LayoutInflater.from(getActivity());
|
||||
final View view = factory.inflate(R.layout.image_alert_layout, null);
|
||||
ImageView screenShotImage = view.findViewById(R.id.alert_image);
|
||||
screenShotImage.setImageBitmap(screenshot);
|
||||
TextView shareMessage = view.findViewById(R.id.alert_text);
|
||||
shareMessage.setText(R.string.achievements_share_message);
|
||||
alertadd.setView(view);
|
||||
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
|
||||
alertadd.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel());
|
||||
alertadd.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* To take bitmap and store it temporary storage and share it
|
||||
* @param bitmap
|
||||
*/
|
||||
void shareScreen(Bitmap bitmap) {
|
||||
try {
|
||||
File file = new File(this.getExternalCacheDir(), "screen.png");
|
||||
File file = new File(getActivity().getExternalCacheDir(), "screen.png");
|
||||
FileOutputStream fOut = new FileOutputStream(file);
|
||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
|
||||
fOut.flush();
|
||||
fOut.close();
|
||||
file.setReadable(true, false);
|
||||
Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), getPackageName()+".provider", file);
|
||||
grantUriPermission(getPackageName(), fileUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
Uri fileUri = FileProvider
|
||||
.getUriForFile(getActivity().getApplicationContext(), getActivity().getPackageName()+".provider", file);
|
||||
getActivity().grantUriPermission(getActivity().getPackageName(), fileUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
final Intent intent = new Intent(android.content.Intent.ACTION_SEND);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(Intent.EXTRA_STREAM, fileUri);
|
||||
|
|
@ -212,6 +222,15 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To invoke the AlertDialog on clicking info button
|
||||
*/
|
||||
@OnClick(R.id.achievement_info)
|
||||
public void showInfoDialog(){
|
||||
launchAlert(getResources().getString(R.string.Achievements)
|
||||
,getResources().getString(R.string.achievements_info_message));
|
||||
}
|
||||
|
||||
/**
|
||||
* To call the API to get results in form Single<JSONObject>
|
||||
* which then calls parseJson when results are fetched
|
||||
|
|
@ -264,7 +283,6 @@ 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)) {
|
||||
|
|
@ -292,11 +310,11 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
private void showSnackBarWithRetry(boolean tooManyAchievements) {
|
||||
if (tooManyAchievements) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
ViewUtil.showDismissibleSnackBar(findViewById(android.R.id.content),
|
||||
ViewUtil.showDismissibleSnackBar(getActivity().findViewById(android.R.id.content),
|
||||
R.string.achievements_fetch_failed_ultimate_achievement, R.string.retry, view -> setAchievements());
|
||||
} else {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
ViewUtil.showDismissibleSnackBar(findViewById(android.R.id.content),
|
||||
ViewUtil.showDismissibleSnackBar(getActivity().findViewById(android.R.id.content),
|
||||
R.string.achievements_fetch_failed, R.string.retry, view -> setAchievements());
|
||||
}
|
||||
}
|
||||
|
|
@ -305,7 +323,7 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
* Shows a generic error toast when error occurs while loading achievements or uploads
|
||||
*/
|
||||
private void onError() {
|
||||
ViewUtil.showLongToast(this, getResources().getString(R.string.error_occurred));
|
||||
ViewUtil.showLongToast(getActivity(), getResources().getString(R.string.error_occurred));
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
|
@ -355,7 +373,7 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
}
|
||||
|
||||
private void setZeroAchievements() {
|
||||
AlertDialog.Builder builder=new AlertDialog.Builder(this)
|
||||
AlertDialog.Builder builder=new AlertDialog.Builder(getActivity())
|
||||
.setMessage(getString(R.string.no_achievements_yet))
|
||||
.setPositiveButton(getString(R.string.ok), (dialog, which) -> {
|
||||
});
|
||||
|
|
@ -399,20 +417,10 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
levelUpInfoString += " " + levelInfo.getLevelNumber();
|
||||
levelNumber.setText(levelUpInfoString);
|
||||
imageView.setImageDrawable(VectorDrawableCompat.create(getResources(), R.drawable.badge,
|
||||
new ContextThemeWrapper(this, levelInfo.getLevelStyle()).getTheme()));
|
||||
new ContextThemeWrapper(getActivity(), levelInfo.getLevelStyle()).getTheme()));
|
||||
badgeText.setText(Integer.toString(levelInfo.getLevelNumber()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a way to change current activity to AchievementActivity
|
||||
* @param context
|
||||
*/
|
||||
public static void startYourself(Context context) {
|
||||
Intent intent = new Intent(context, AchievementsActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* to hide progressbar
|
||||
*/
|
||||
|
|
@ -447,24 +455,6 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
levelNumber.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* It display the alertDialog with Image of screenshot
|
||||
* @param screenshot
|
||||
*/
|
||||
public void showAlert(Bitmap screenshot){
|
||||
AlertDialog.Builder alertadd = new AlertDialog.Builder(AchievementsActivity.this);
|
||||
LayoutInflater factory = LayoutInflater.from(AchievementsActivity.this);
|
||||
final View view = factory.inflate(R.layout.image_alert_layout, null);
|
||||
ImageView screenShotImage = view.findViewById(R.id.alert_image);
|
||||
screenShotImage.setImageBitmap(screenshot);
|
||||
TextView shareMessage = view.findViewById(R.id.alert_text);
|
||||
shareMessage.setText(R.string.achievements_share_message);
|
||||
alertadd.setView(view);
|
||||
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
|
||||
alertadd.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel());
|
||||
alertadd.show();
|
||||
}
|
||||
|
||||
@OnClick(R.id.images_upload_info)
|
||||
public void showUploadInfo(){
|
||||
launchAlert(getResources().getString(R.string.images_uploaded)
|
||||
|
|
@ -507,7 +497,7 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
* @param message
|
||||
*/
|
||||
private void launchAlert(String title, String message){
|
||||
new AlertDialog.Builder(AchievementsActivity.this)
|
||||
new AlertDialog.Builder(getActivity())
|
||||
.setTitle(title)
|
||||
.setMessage(message)
|
||||
.setCancelable(true)
|
||||
|
|
@ -524,8 +514,8 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
|||
Account currentAccount = sessionManager.getCurrentAccount();
|
||||
if (currentAccount == null) {
|
||||
Timber.d("Current account is null");
|
||||
ViewUtil.showLongToast(this, getResources().getString(R.string.user_not_logged_in));
|
||||
sessionManager.forceLogin(this);
|
||||
ViewUtil.showLongToast(getActivity(), getResources().getString(R.string.user_not_logged_in));
|
||||
sessionManager.forceLogin(getActivity());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.free.nrw.commons.achievements
|
||||
package fr.free.nrw.commons.profile.achievements
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.free.nrw.commons.achievements
|
||||
package fr.free.nrw.commons.profile.achievements
|
||||
|
||||
/**
|
||||
* Represent the Feedback Response of the user
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package fr.free.nrw.commons.achievements
|
||||
package fr.free.nrw.commons.profile.achievements
|
||||
|
||||
import fr.free.nrw.commons.R
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package fr.free.nrw.commons.profile.leaderboard;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
|
||||
|
||||
public class LeaderboardFragment extends CommonsDaggerSupportFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.fragment_leaderboard, container, false);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -26,6 +26,7 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
|||
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
|
||||
import fr.free.nrw.commons.profile.ProfileActivity;
|
||||
import org.wikipedia.dataclient.Service;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
|
@ -37,7 +38,6 @@ import fr.free.nrw.commons.BuildConfig;
|
|||
import fr.free.nrw.commons.CommonsApplication;
|
||||
import fr.free.nrw.commons.R;
|
||||
import fr.free.nrw.commons.WelcomeActivity;
|
||||
import fr.free.nrw.commons.achievements.AchievementsActivity;
|
||||
import fr.free.nrw.commons.auth.LoginActivity;
|
||||
import fr.free.nrw.commons.auth.LogoutClient;
|
||||
import fr.free.nrw.commons.bookmarks.BookmarksActivity;
|
||||
|
|
@ -140,7 +140,7 @@ public abstract class NavigationBaseActivity extends BaseActivity
|
|||
LinearLayout userIcon = navHeaderView.findViewById(R.id.user_details);
|
||||
userIcon.setOnClickListener(v -> {
|
||||
drawerLayout.closeDrawer(navigationView);
|
||||
AchievementsActivity.startYourself(NavigationBaseActivity.this);
|
||||
ProfileActivity.startYourself(NavigationBaseActivity.this);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,495 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:id="@+id/toolbarLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="?attr/actionBarSize">
|
||||
<include layout="@layout/toolbar"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:layout_below="@id/toolbarLayout">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:background="?attr/achievementBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/level"
|
||||
android:id="@+id/achievement_level"
|
||||
android:textAllCaps="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/achievement_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/activity_margin_vertical"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/black"
|
||||
android:layout_marginVertical="@dimen/activity_margin_vertical" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/badge_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/achievement_info"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/achievement_badge_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/badge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/achievement_badge_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/achievement_badge_text"
|
||||
android:textSize="75sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintEnd_toEndOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintStart_toStartOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintVertical_bias="0.58" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_image_uploaded"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/badge_layout"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:id="@+id/images_upload_text_param"
|
||||
android:layout_marginTop="@dimen/achievements_activity_margin_vertical"
|
||||
android:text="@string/images_uploaded" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/quarter_standard_height"
|
||||
android:layout_height="@dimen/quarter_standard_height"
|
||||
android:id="@+id/images_upload_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_toRightOf="@+id/images_upload_text_param"
|
||||
android:layout_toEndOf="@+id/images_upload_text_param"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"/>
|
||||
|
||||
<com.dinuscxj.progressbar.CircleProgressBar
|
||||
android:layout_width="@dimen/dimen_40"
|
||||
android:layout_height="@dimen/dimen_40"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/large_gap"
|
||||
android:layout_marginRight="@dimen/large_gap"
|
||||
android:id="@+id/images_uploaded_progressbar"
|
||||
android:progress="50"
|
||||
app:progress_text_size="@dimen/progressbar_text"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_stroke_width="@dimen/progressbar_stroke"
|
||||
app:progress_text_format_pattern="573/110"
|
||||
app:progress_text_color="@color/secondaryColor"
|
||||
app:style="solid_line" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_image_reverts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/tiny_margin"
|
||||
android:layout_below="@+id/layout_image_uploaded"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:id="@+id/images_reverted_text"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/image_reverts" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:id="@+id/images_reverted_info"
|
||||
android:layout_toRightOf="@+id/images_reverted_text"
|
||||
android:layout_toEndOf="@+id/images_reverted_text"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/achievements_revert_limit_message"
|
||||
android:textSize="@dimen/small_text"
|
||||
android:id="@+id/images_revert_limit_text"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_below="@+id/images_reverted_text"/>
|
||||
|
||||
<com.dinuscxj.progressbar.CircleProgressBar
|
||||
android:layout_width="@dimen/dimen_40"
|
||||
android:layout_height="@dimen/dimen_40"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginRight="@dimen/large_gap"
|
||||
android:layout_marginEnd="@dimen/large_gap"
|
||||
android:progress="50"
|
||||
android:id="@+id/image_reverts_progressbar"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_text_size="@dimen/progressbar_text"
|
||||
app:progress_stroke_width="@dimen/progressbar_stroke"
|
||||
app:progress_text_format_pattern="92%%"
|
||||
app:progress_text_color="@color/secondaryColor"
|
||||
app:style="solid_line" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_image_used_by_wiki"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/tiny_margin"
|
||||
android:layout_below="@+id/layout_image_reverts"
|
||||
android:layout_marginBottom="@dimen/activity_margin_vertical"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/images_used_by_wiki_text"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/achievements_activity_margin_vertical"
|
||||
android:text="@string/images_used_by_wiki" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/images_used_by_wiki_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_toRightOf="@+id/images_used_by_wiki_text"
|
||||
android:layout_toEndOf="@+id/images_used_by_wiki_text"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"/>
|
||||
|
||||
<com.dinuscxj.progressbar.CircleProgressBar
|
||||
android:layout_width="@dimen/dimen_40"
|
||||
android:layout_height="@dimen/dimen_40"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginRight="@dimen/large_gap"
|
||||
android:layout_marginEnd="@dimen/large_gap"
|
||||
android:progress="50"
|
||||
app:progress_text_size="@dimen/progressbar_text"
|
||||
android:id="@+id/images_used_by_wiki_progress_bar"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_stroke_width="2.5dp"
|
||||
app:progress_text_color="@color/secondaryColor"
|
||||
app:progress_text_format_pattern="12/24"
|
||||
app:style="solid_line" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/layout_statistics"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/statistics"
|
||||
style="?android:textAppearanceLarge"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_vertical"
|
||||
android:textAllCaps="true"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/wikidata_edits"
|
||||
android:layout_toLeftOf="@+id/wikidata_edits"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/overflow_icon_dimen"
|
||||
android:layout_height="@dimen/overflow_icon_dimen"
|
||||
android:id="@+id/wikidata_edits_icon"
|
||||
app:srcCompat="@drawable/ic_custom_map_marker" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/statistics_wikidata_edits" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/images_nearby_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/half_standard_height"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="2"
|
||||
android:id="@+id/wikidata_edits"
|
||||
android:layout_marginRight="@dimen/half_standard_height" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/image_featured"
|
||||
android:layout_toLeftOf="@+id/image_featured"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/overflow_icon_dimen"
|
||||
android:layout_height="@dimen/overflow_icon_dimen"
|
||||
android:id="@+id/featured_image_icon"
|
||||
app:srcCompat="@drawable/featured"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/statistics_featured" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/images_featured_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="2"
|
||||
android:id="@+id/image_featured"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/half_standard_height"
|
||||
android:layout_marginRight="@dimen/half_standard_height" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/thanks_received"
|
||||
android:layout_toLeftOf="@+id/thanks_received"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/overflow_icon_dimen"
|
||||
android:layout_height="@dimen/overflow_icon_dimen"
|
||||
android:id="@+id/thanks_image_icon"
|
||||
app:srcCompat="@drawable/ic_thanks"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/statistics_thanks" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/thanks_received_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="2"
|
||||
android:id="@+id/thanks_received"
|
||||
android:layout_marginEnd="@dimen/half_standard_height"
|
||||
android:layout_marginRight="@dimen/half_standard_height" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/drawer_view" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
41
app/src/main/res/layout/activity_profile.xml
Normal file
41
app/src/main/res/layout/activity_profile.xml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/primaryDarkColor">
|
||||
|
||||
<include layout="@layout/toolbar"/>
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:background="?attr/tabBackground"
|
||||
app:tabIndicatorColor="?attr/tabIndicatorColor"
|
||||
app:tabMode="fixed"
|
||||
app:tabSelectedTextColor="?attr/tabSelectedTextColor"
|
||||
app:tabTextColor="?attr/tabTextColor" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar_layout" />
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/drawer_view" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
482
app/src/main/res/layout/fragment_achievements.xml
Normal file
482
app/src/main/res/layout/fragment_achievements.xml
Normal file
|
|
@ -0,0 +1,482 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:background="?attr/achievementBackground"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/level"
|
||||
android:id="@+id/achievement_level"
|
||||
android:textAllCaps="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/achievement_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/activity_margin_vertical"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/black"
|
||||
android:layout_marginVertical="@dimen/activity_margin_vertical" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/badge_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/achievement_info"
|
||||
android:layout_centerHorizontal="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/achievement_badge_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/badge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/achievement_badge_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/achievement_badge_text"
|
||||
android:textSize="75sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintEnd_toEndOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintStart_toStartOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintTop_toTopOf="@+id/achievement_badge_image"
|
||||
app:layout_constraintVertical_bias="0.58" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_image_uploaded"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/badge_layout"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:id="@+id/images_upload_text_param"
|
||||
android:layout_marginTop="@dimen/achievements_activity_margin_vertical"
|
||||
android:text="@string/images_uploaded" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/quarter_standard_height"
|
||||
android:layout_height="@dimen/quarter_standard_height"
|
||||
android:id="@+id/images_upload_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_toRightOf="@+id/images_upload_text_param"
|
||||
android:layout_toEndOf="@+id/images_upload_text_param"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"/>
|
||||
|
||||
<com.dinuscxj.progressbar.CircleProgressBar
|
||||
android:layout_width="@dimen/dimen_40"
|
||||
android:layout_height="@dimen/dimen_40"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="@dimen/large_gap"
|
||||
android:layout_marginRight="@dimen/large_gap"
|
||||
android:id="@+id/images_uploaded_progressbar"
|
||||
android:progress="50"
|
||||
app:progress_text_size="@dimen/progressbar_text"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_stroke_width="@dimen/progressbar_stroke"
|
||||
app:progress_text_format_pattern="573/110"
|
||||
app:progress_text_color="@color/secondaryColor"
|
||||
app:style="solid_line" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_image_reverts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/tiny_margin"
|
||||
android:layout_below="@+id/layout_image_uploaded"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:id="@+id/images_reverted_text"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/image_reverts" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:id="@+id/images_reverted_info"
|
||||
android:layout_toRightOf="@+id/images_reverted_text"
|
||||
android:layout_toEndOf="@+id/images_reverted_text"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/achievements_revert_limit_message"
|
||||
android:textSize="@dimen/small_text"
|
||||
android:id="@+id/images_revert_limit_text"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_below="@+id/images_reverted_text"/>
|
||||
|
||||
<com.dinuscxj.progressbar.CircleProgressBar
|
||||
android:layout_width="@dimen/dimen_40"
|
||||
android:layout_height="@dimen/dimen_40"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginRight="@dimen/large_gap"
|
||||
android:layout_marginEnd="@dimen/large_gap"
|
||||
android:progress="50"
|
||||
android:id="@+id/image_reverts_progressbar"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_text_size="@dimen/progressbar_text"
|
||||
app:progress_stroke_width="@dimen/progressbar_stroke"
|
||||
app:progress_text_format_pattern="92%%"
|
||||
app:progress_text_color="@color/secondaryColor"
|
||||
app:style="solid_line" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layout_image_used_by_wiki"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/tiny_margin"
|
||||
android:layout_below="@+id/layout_image_reverts"
|
||||
android:layout_marginBottom="@dimen/activity_margin_vertical"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal">
|
||||
|
||||
<TextView
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/images_used_by_wiki_text"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/achievements_activity_margin_vertical"
|
||||
android:text="@string/images_used_by_wiki" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/images_used_by_wiki_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_toRightOf="@+id/images_used_by_wiki_text"
|
||||
android:layout_toEndOf="@+id/images_used_by_wiki_text"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"/>
|
||||
|
||||
<com.dinuscxj.progressbar.CircleProgressBar
|
||||
android:layout_width="@dimen/dimen_40"
|
||||
android:layout_height="@dimen/dimen_40"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginRight="@dimen/large_gap"
|
||||
android:layout_marginEnd="@dimen/large_gap"
|
||||
android:progress="50"
|
||||
app:progress_text_size="@dimen/progressbar_text"
|
||||
android:id="@+id/images_used_by_wiki_progress_bar"
|
||||
app:progress_end_color="#8C8B98"
|
||||
app:progress_start_color="#3A3381"
|
||||
app:progress_stroke_width="2.5dp"
|
||||
app:progress_text_color="@color/secondaryColor"
|
||||
app:progress_text_format_pattern="12/24"
|
||||
app:style="solid_line" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/layout_statistics"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/statistics"
|
||||
style="?android:textAppearanceLarge"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_vertical"
|
||||
android:textAllCaps="true"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/wikidata_edits"
|
||||
android:layout_toLeftOf="@+id/wikidata_edits"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/overflow_icon_dimen"
|
||||
android:layout_height="@dimen/overflow_icon_dimen"
|
||||
android:id="@+id/wikidata_edits_icon"
|
||||
app:srcCompat="@drawable/ic_custom_map_marker" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/statistics_wikidata_edits" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/images_nearby_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/half_standard_height"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="2"
|
||||
android:id="@+id/wikidata_edits"
|
||||
android:layout_marginRight="@dimen/half_standard_height" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/image_featured"
|
||||
android:layout_toLeftOf="@+id/image_featured"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/overflow_icon_dimen"
|
||||
android:layout_height="@dimen/overflow_icon_dimen"
|
||||
android:id="@+id/featured_image_icon"
|
||||
app:srcCompat="@drawable/featured"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/statistics_featured" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/images_featured_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="2"
|
||||
android:id="@+id/image_featured"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/half_standard_height"
|
||||
android:layout_marginRight="@dimen/half_standard_height" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_toStartOf="@+id/thanks_received"
|
||||
android:layout_toLeftOf="@+id/thanks_received"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/overflow_icon_dimen"
|
||||
android:layout_height="@dimen/overflow_icon_dimen"
|
||||
android:id="@+id/thanks_image_icon"
|
||||
app:srcCompat="@drawable/ic_thanks"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:text="@string/statistics_thanks" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/medium_width"
|
||||
android:layout_height="@dimen/medium_height"
|
||||
android:id="@+id/thanks_received_info"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginRight="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginEnd="@dimen/activity_margin_horizontal"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_info_outline_24dp"
|
||||
android:tint="@color/primaryDarkColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="?android:textAppearanceMedium"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginStart="@dimen/activity_margin_horizontal"
|
||||
android:layout_marginLeft="@dimen/activity_margin_horizontal"
|
||||
android:layout_centerVertical="true"
|
||||
tools:text="2"
|
||||
android:id="@+id/thanks_received"
|
||||
android:layout_marginEnd="@dimen/half_standard_height"
|
||||
android:layout_marginRight="@dimen/half_standard_height" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<include layout="@layout/drawer_view" />
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
6
app/src/main/res/layout/fragment_leaderboard.xml
Normal file
6
app/src/main/res/layout/fragment_leaderboard.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -397,6 +397,7 @@
|
|||
<string name="nominate_delete">Nominate For Deletion</string>
|
||||
<string name="delete">Delete</string>
|
||||
<string name="Achievements">Achievements</string>
|
||||
<string name="Profile">Profile</string>
|
||||
<string name="statistics">Statistics</string>
|
||||
<string name="statistics_thanks">Thanks Received</string>
|
||||
<string name="statistics_featured">Featured Images</string>
|
||||
|
|
@ -633,7 +634,6 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="use_location_from_similar_image">Did you shoot these two pictures at the same place? Do you want to use the latitude/longitude of the picture on the right?</string>
|
||||
<string name="load_more">Load More</string>
|
||||
<string name="nearby_no_results">No places found, try changing your search criteria.</string>
|
||||
|
||||
<string name="add_picture_to_wikipedia_article_title">Add image to Wikipedia</string>
|
||||
<string name="add_picture_to_wikipedia_article_desc">Do you want to add this picture to the %1$s language Wikipedia article?</string>
|
||||
|
||||
|
|
@ -649,4 +649,6 @@ Upload your first media by tapping on the add button.</string>
|
|||
<string name="wikipedia_instructions_step_6">6. Edit the wikitext for appropriate positioning, if necessary. For more information, see <a href="https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Images#How_to_place_an_image">here</a>.</string>
|
||||
<string name="wikipedia_instructions_step_7">7. Publish the article</string>
|
||||
<string name="copy_wikicode_to_clipboard">Copy wikicode to clipboard</string>
|
||||
<string name="achievements_tab_title">Achievements</string>
|
||||
<string name="leaderboard_tab_title">Leaderboard</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ package fr.free.nrw.commons.delete
|
|||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import fr.free.nrw.commons.Media
|
||||
import fr.free.nrw.commons.achievements.FeedbackResponse
|
||||
import fr.free.nrw.commons.auth.SessionManager
|
||||
import fr.free.nrw.commons.mwapi.OkHttpJsonApiClient
|
||||
import fr.free.nrw.commons.profile.achievements.FeedbackResponse
|
||||
import fr.free.nrw.commons.utils.ViewUtilWrapper
|
||||
import io.reactivex.Single
|
||||
import media
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue