mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Add missing @Override annotations
This commit is contained in:
parent
f5892ca34b
commit
c1bcd921e3
22 changed files with 98 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ public class AboutActivity extends Activity {
|
|||
private TextView privacyPolicyText;
|
||||
private TextView uploadsToText;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_about);
|
||||
|
|
|
|||
|
|
@ -157,10 +157,12 @@ public class CommonsApplication extends Application {
|
|||
public com.android.volley.toolbox.ImageLoader getImageLoader() {
|
||||
if(imageLoader == null) {
|
||||
imageLoader = new com.android.volley.toolbox.ImageLoader(volleyQueue, new com.android.volley.toolbox.ImageLoader.ImageCache() {
|
||||
@Override
|
||||
public Bitmap getBitmap(String key) {
|
||||
return imageCache.get(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putBitmap(String key, Bitmap bitmap) {
|
||||
imageCache.put(key, bitmap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,10 +15,12 @@ import java.util.regex.Pattern;
|
|||
public class Media implements Parcelable {
|
||||
|
||||
public static Creator<Media> CREATOR = new Creator<Media>() {
|
||||
@Override
|
||||
public Media createFromParcel(Parcel parcel) {
|
||||
return new Media(parcel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Media[] newArray(int i) {
|
||||
return new Media[0];
|
||||
}
|
||||
|
|
@ -204,10 +206,12 @@ public class Media implements Parcelable {
|
|||
this.creator = creator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeParcelable(localUri, flags);
|
||||
parcel.writeString(imageUrl);
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ public class MediaWikiImageView extends ImageView {
|
|||
public void onErrorResponse(final VolleyError error) {
|
||||
if(!tryOriginal) {
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
loadImageIfNecessary(false, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
|
|||
|
||||
licensePreference.setSummary(getString(fr.free.nrw.commons.Utils.licenseNameFor(licensePreference.getValue())));
|
||||
licensePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
preference.setSummary(getString(fr.free.nrw.commons.Utils.licenseNameFor((String)newValue)));
|
||||
return true;
|
||||
|
|
@ -61,6 +62,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
|
|||
.unregisterOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
|
||||
}
|
||||
|
|
@ -128,6 +130,7 @@ public class SettingsActivity extends PreferenceActivity implements SharedPrefer
|
|||
getDelegate().onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidateOptionsMenu() {
|
||||
getDelegate().invalidateOptionsMenu();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class WelcomeActivity extends Activity {
|
|||
if (position == PAGE_FINAL) {
|
||||
yesButton = (Button)view.findViewById(R.id.welcomeYesButton);
|
||||
yesButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,10 +161,13 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
|||
prefs = getSharedPreferences("fr.free.nrw.commons", MODE_PRIVATE);
|
||||
|
||||
TextWatcher loginEnabler = new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int start, int count, int after) { }
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if(usernameEdit.getText().length() != 0 && passwordEdit.getText().length() != 0) {
|
||||
loginButton.setEnabled(true);
|
||||
|
|
@ -177,6 +180,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
|||
usernameEdit.addTextChangedListener(loginEnabler);
|
||||
passwordEdit.addTextChangedListener(loginEnabler);
|
||||
passwordEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
|
||||
if (loginButton.isEnabled()) {
|
||||
if (actionId == EditorInfo.IME_ACTION_DONE) {
|
||||
|
|
@ -192,6 +196,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
|
|||
});
|
||||
|
||||
loginButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
that.performLogin();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,12 @@ public class CategoriesAdapter extends BaseAdapter {
|
|||
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return items.get(i);
|
||||
}
|
||||
|
|
@ -43,10 +45,12 @@ public class CategoriesAdapter extends BaseAdapter {
|
|||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
CheckedTextView checkedView;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,10 +89,12 @@ public class CategorizationFragment extends Fragment {
|
|||
public boolean selected;
|
||||
|
||||
public static Creator<CategoryItem> CREATOR = new Creator<CategoryItem>() {
|
||||
@Override
|
||||
public CategoryItem createFromParcel(Parcel parcel) {
|
||||
return new CategoryItem(parcel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoryItem[] newArray(int i) {
|
||||
return new CategoryItem[0];
|
||||
}
|
||||
|
|
@ -108,10 +110,12 @@ public class CategorizationFragment extends Fragment {
|
|||
selected = in.readInt() == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel parcel, int flags) {
|
||||
parcel.writeString(name);
|
||||
parcel.writeInt(selected ? 1 : 0);
|
||||
|
|
@ -411,6 +415,7 @@ public class CategorizationFragment extends Fragment {
|
|||
categoriesSkip = (TextView) rootView.findViewById(R.id.categoriesExplanation);
|
||||
|
||||
categoriesSkip.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
getActivity().onBackPressed();
|
||||
getActivity().finish();
|
||||
|
|
@ -430,6 +435,7 @@ public class CategorizationFragment extends Fragment {
|
|||
categoriesList.setAdapter(categoriesAdapter);
|
||||
|
||||
categoriesList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int index, long id) {
|
||||
CheckedTextView checkedView = (CheckedTextView) view;
|
||||
CategoryItem item = (CategoryItem) adapterView.getAdapter().getItem(index);
|
||||
|
|
@ -442,13 +448,16 @@ public class CategorizationFragment extends Fragment {
|
|||
});
|
||||
|
||||
categoriesFilter.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
|
||||
startUpdatingCategoryList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
|
|
@ -500,11 +509,13 @@ public class CategorizationFragment extends Fragment {
|
|||
builder.setMessage("Are you sure you want to go back? The image will not have any categories saved.")
|
||||
.setTitle("Warning");
|
||||
builder.setPositiveButton("No", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
//No need to do anything, user remains on categorization screen
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton("Yes", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
getActivity().finish();
|
||||
}
|
||||
|
|
@ -548,12 +559,14 @@ public class CategorizationFragment extends Fragment {
|
|||
builder.setMessage("Images without categories are rarely usable. Are you sure you want to submit without selecting categories?")
|
||||
.setTitle("No Categories Selected");
|
||||
builder.setPositiveButton("No, go back", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
//Exit menuItem so user can select their categories
|
||||
return;
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton("Yes, submit", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
//Proceed to submission
|
||||
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
|
||||
|
|
|
|||
|
|
@ -21,10 +21,12 @@ import fr.free.nrw.commons.Utils;
|
|||
public class Contribution extends Media {
|
||||
|
||||
public static Creator<Contribution> CREATOR = new Creator<Contribution>() {
|
||||
@Override
|
||||
public Contribution createFromParcel(Parcel parcel) {
|
||||
return new Contribution(parcel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Contribution[] newArray(int i) {
|
||||
return new Contribution[0];
|
||||
}
|
||||
|
|
@ -212,6 +214,7 @@ public class Contribution extends Media {
|
|||
return cv;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,11 +63,13 @@ public class ContributionsActivity
|
|||
}
|
||||
|
||||
private ServiceConnection uploadServiceConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName componentName, IBinder binder) {
|
||||
uploadService = (UploadService) ((HandlerService.HandlerServiceLocalBinder)binder).getService();
|
||||
isUploadServiceConnected = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
// this should never happen
|
||||
throw new RuntimeException("UploadService died but the rest of the process did not!");
|
||||
|
|
@ -191,6 +193,7 @@ public class ContributionsActivity
|
|||
finish(); // If authentication failed, we just exit
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long item) {
|
||||
showDetail(position);
|
||||
}
|
||||
|
|
@ -200,10 +203,12 @@ public class ContributionsActivity
|
|||
return super.onCreateOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Loader onCreateLoader(int i, Bundle bundle) {
|
||||
return new CursorLoader(this, ContributionsContentProvider.BASE_URI, Contribution.Table.ALL_FIELDS, CONTRIBUTION_SELECTION, null, CONTRIBUTION_SORT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFinished(Loader cursorLoader, Object result) {
|
||||
|
||||
Cursor cursor = (Cursor) result;
|
||||
|
|
@ -219,11 +224,13 @@ public class ContributionsActivity
|
|||
notifyAndMigrateDataSetObservers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoaderReset(Loader cursorLoader) {
|
||||
((CursorAdapter) contributionsList.getAdapter()).swapCursor(null);
|
||||
}
|
||||
|
||||
//FIXME: Potential cause of wrong image display bug
|
||||
@Override
|
||||
public Media getMediaAtPosition(int i) {
|
||||
if (contributionsList.getAdapter() == null) {
|
||||
// not yet ready to return data
|
||||
|
|
@ -233,6 +240,7 @@ public class ContributionsActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalMediaCount() {
|
||||
if(contributionsList.getAdapter() == null) {
|
||||
return 0;
|
||||
|
|
@ -240,6 +248,7 @@ public class ContributionsActivity
|
|||
return contributionsList.getAdapter().getCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyDatasetChanged() {
|
||||
// Do nothing for now
|
||||
}
|
||||
|
|
@ -259,6 +268,7 @@ public class ContributionsActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDataSetObserver(DataSetObserver observer) {
|
||||
Adapter adapter = contributionsList.getAdapter();
|
||||
if (adapter == null) {
|
||||
|
|
@ -268,6 +278,7 @@ public class ContributionsActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterDataSetObserver(DataSetObserver observer) {
|
||||
Adapter adapter = contributionsList.getAdapter();
|
||||
if (adapter == null) {
|
||||
|
|
@ -277,6 +288,7 @@ public class ContributionsActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackStackChanged() {
|
||||
if(mediaDetails != null && mediaDetails.isVisible()) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
|
@ -285,6 +297,7 @@ public class ContributionsActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshSource() {
|
||||
getSupportLoaderManager().restartLoader(0, null, this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,18 +35,22 @@ public class MediaListAdapter extends BaseAdapter {
|
|||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mediaList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return mediaList.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
if(view == null) {
|
||||
view = activity.getLayoutInflater().inflate(R.layout.layout_contribution, null, false);
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ public class MediaDetailFragment extends Fragment {
|
|||
// Ask the detail provider to ping us when we're ready
|
||||
Log.d("Commons", "MediaDetailFragment not yet ready to display details; registering observer");
|
||||
dataObserver = new DataSetObserver() {
|
||||
@Override
|
||||
public void onChanged() {
|
||||
Log.d("Commons", "MediaDetailFragment ready to display delayed details!");
|
||||
detailProvider.unregisterDataSetObserver(dataObserver);
|
||||
|
|
@ -147,6 +148,7 @@ public class MediaDetailFragment extends Fragment {
|
|||
|
||||
// Progressively darken the image in the background when we scroll detail pane up
|
||||
scrollListener = new ViewTreeObserver.OnScrollChangedListener() {
|
||||
@Override
|
||||
public void onScrollChanged() {
|
||||
updateTheDarkness();
|
||||
}
|
||||
|
|
@ -158,6 +160,7 @@ public class MediaDetailFragment extends Fragment {
|
|||
layoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
private int currentHeight = -1;
|
||||
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
int viewHeight = view.getHeight();
|
||||
//int textHeight = title.getLineHeight();
|
||||
|
|
@ -245,15 +248,18 @@ public class MediaDetailFragment extends Fragment {
|
|||
//Even if image is loaded from device storage, it will display, albeit with empty desc and cat.
|
||||
Log.d("Volley", "Actual URL does not start with http and is: " + actualUrl);
|
||||
com.nostra13.universalimageloader.core.ImageLoader.getInstance().displayImage(actualUrl, image, displayOptions, new ImageLoadingListener() {
|
||||
@Override
|
||||
public void onLoadingStarted(String s, View view) {
|
||||
loadingProgress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingFailed(String s, View view, FailReason failReason) {
|
||||
loadingProgress.setVisibility(View.GONE);
|
||||
loadingFailed.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingComplete(String s, View view, Bitmap bitmap) {
|
||||
loadingProgress.setVisibility(View.GONE);
|
||||
loadingFailed.setVisibility(View.GONE);
|
||||
|
|
@ -278,6 +284,7 @@ public class MediaDetailFragment extends Fragment {
|
|||
rebuildCatList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadingCancelled(String s, View view) {
|
||||
Log.e("Volley", "Image loading cancelled. But why?");
|
||||
}
|
||||
|
|
@ -333,6 +340,7 @@ public class MediaDetailFragment extends Fragment {
|
|||
textView.setText(cat);
|
||||
if (categoriesLoaded && categoriesPresent) {
|
||||
textView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
String selectedCategoryTitle = "Category:" + catName;
|
||||
Intent viewIntent = new Intent();
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPa
|
|||
if(i == 0) {
|
||||
// See bug https://code.google.com/p/android/issues/detail?id=27526
|
||||
pager.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
getActivity().supportInvalidateOptionsMenu();
|
||||
}
|
||||
|
|
@ -92,6 +93,7 @@ public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPa
|
|||
// Adapter doesn't seem to be loading immediately.
|
||||
// Dear God, please forgive us for our sins
|
||||
view.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
pager.setAdapter(adapter);
|
||||
pager.setCurrentItem(pageNumber, false);
|
||||
|
|
@ -280,13 +282,16 @@ public class MediaDetailPagerFragment extends Fragment implements ViewPager.OnPa
|
|||
pager.setCurrentItem(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int i, float v, int i2) {
|
||||
getActivity().supportInvalidateOptionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int i) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int i) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
|
|||
listview.setAdapter(mAdapter);
|
||||
|
||||
listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
Place place = places.get(position);
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, Boolean> {
|
|||
builder.setMessage(R.string.file_exists)
|
||||
.setTitle(R.string.warning);
|
||||
builder.setPositiveButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
//Go back to ContributionsActivity
|
||||
Intent intent = new Intent(context, ContributionsActivity.class);
|
||||
|
|
@ -90,6 +91,7 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, Boolean> {
|
|||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
//No need to do anything, user remains on upload screen
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,12 @@ public class MultipleShareActivity
|
|||
super(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Media getMediaAtPosition(int i) {
|
||||
return photosList.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalMediaCount() {
|
||||
if(photosList == null) {
|
||||
return 0;
|
||||
|
|
@ -68,24 +70,29 @@ public class MultipleShareActivity
|
|||
return photosList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyDatasetChanged() {
|
||||
if(uploadsList != null) {
|
||||
uploadsList.notifyDatasetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDataSetObserver(DataSetObserver observer) {
|
||||
// fixme implement me if needed
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterDataSetObserver(DataSetObserver observer) {
|
||||
// fixme implement me if needed
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int index, long item) {
|
||||
showDetail(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnMultipleUploadInitiated() {
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
|
|
@ -125,6 +132,7 @@ public class MultipleShareActivity
|
|||
final int uploadCount = i + 1; // Goddamn Java
|
||||
|
||||
uploadController.startUpload(up, new UploadController.ContributionUploadProgress() {
|
||||
@Override
|
||||
public void onUploadStarted(Contribution contribution) {
|
||||
dialog.setProgress(uploadCount);
|
||||
if(uploadCount == photosList.size()) {
|
||||
|
|
@ -154,6 +162,7 @@ public class MultipleShareActivity
|
|||
//See http://stackoverflow.com/questions/7469082/getting-exception-illegalstateexception-can-not-perform-this-action-after-onsa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCategoriesSave(ArrayList<String> categories) {
|
||||
if(categories.size() > 0) {
|
||||
ContentProviderClient client = getContentResolver().acquireContentProviderClient(ModificationsContentProvider.AUTHORITY);
|
||||
|
|
@ -295,6 +304,7 @@ public class MultipleShareActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackStackChanged() {
|
||||
if(mediaDetails != null && mediaDetails.isVisible()) {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
|
|
|||
|
|
@ -62,18 +62,22 @@ public class MultipleUploadListFragment extends Fragment {
|
|||
|
||||
private class PhotoDisplayAdapter extends BaseAdapter {
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return detailProvider.getTotalMediaCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int i) {
|
||||
return detailProvider.getMediaAtPosition(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int i, View view, ViewGroup viewGroup) {
|
||||
UploadHolderView holder;
|
||||
|
||||
|
|
@ -165,10 +169,12 @@ public class MultipleUploadListFragment extends Fragment {
|
|||
photosGrid.setColumnWidth(photoSize.x);
|
||||
|
||||
baseTitle.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i1, int i2, int i3) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i1, int i2, int i3) {
|
||||
for(int i = 0; i < detailProvider.getTotalMediaCount(); i++) {
|
||||
Contribution up = (Contribution) detailProvider.getMediaAtPosition(i);
|
||||
|
|
@ -184,6 +190,7 @@ public class MultipleUploadListFragment extends Fragment {
|
|||
detailProvider.notifyDatasetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ public class ShareActivity
|
|||
/**
|
||||
* Called when user taps the submit button
|
||||
*/
|
||||
@Override
|
||||
public void uploadActionInitiated(String title, String description) {
|
||||
|
||||
this.title = title;
|
||||
|
|
@ -123,6 +124,7 @@ public class ShareActivity
|
|||
}
|
||||
|
||||
uploadController.startUpload(title, mediaUri, description, mimeType, source, decimalCoords, new UploadController.ContributionUploadProgress() {
|
||||
@Override
|
||||
public void onUploadStarted(Contribution contribution) {
|
||||
ShareActivity.this.contribution = contribution;
|
||||
showPostUpload();
|
||||
|
|
@ -139,6 +141,7 @@ public class ShareActivity
|
|||
.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCategoriesSave(ArrayList<String> categories) {
|
||||
if(categories.size() > 0) {
|
||||
ModifierSequence categoriesSequence = new ModifierSequence(contribution.getContentUri());
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
|
||||
titleDescButton.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
//Retrieve last title and desc entered
|
||||
|
|
@ -98,10 +99,13 @@ public class SingleUploadFragment extends Fragment {
|
|||
licenseSummaryView = (TextView)rootView.findViewById(R.id.share_license_summary);
|
||||
|
||||
TextWatcher uploadEnabler = new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { }
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable editable) {
|
||||
if(getActivity() != null) {
|
||||
getActivity().invalidateOptionsMenu();
|
||||
|
|
@ -117,6 +121,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
|
||||
// Open license page on touch
|
||||
licenseSummaryView.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
if (motionEvent.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
Intent intent = new Intent();
|
||||
|
|
|
|||
|
|
@ -41,11 +41,13 @@ public class UploadController {
|
|||
|
||||
private boolean isUploadServiceConnected;
|
||||
private ServiceConnection uploadServiceConnection = new ServiceConnection() {
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName componentName, IBinder binder) {
|
||||
uploadService = (UploadService) ((HandlerService.HandlerServiceLocalBinder)binder).getService();
|
||||
isUploadServiceConnected = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName componentName) {
|
||||
// this should never happen
|
||||
throw new RuntimeException("UploadService died but the rest of the process did not!");
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ public class UploadService extends HandlerService<Contribution> {
|
|||
this.contribution = contribution;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(long transferred, long total) {
|
||||
Log.d("Commons", String.format("Uploaded %d of %d", transferred, total));
|
||||
if(!notificationTitleChanged) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue