mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 13:53:54 +01:00
Add missing @Override annotations
This commit is contained in:
parent
f5892ca34b
commit
c1bcd921e3
22 changed files with 98 additions and 0 deletions
|
|
@ -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