add "proper" Java decorators that Android ADT insists on adding
Everytime I save a java file with Android ADT, it adds @Override decorators and throws errors if a method is called that is not supported in API 4. My setup might be more sensitive since its setup with the official Android style plugin for Eclipse. But the decorators are "correct" Java style, so it would be nice to have them in F-Droid.
This commit is contained in:
parent
c0eecabcca
commit
240f03d372
@ -433,14 +433,14 @@ public class AppDetails extends ListActivity {
|
||||
The following is a quick solution to enable both text selection and
|
||||
links. Causes glitches and crashes:
|
||||
java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0
|
||||
|
||||
|
||||
class CustomMovementMethod extends LinkMovementMethod {
|
||||
@Override
|
||||
public boolean canSelectArbitrarily () {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Utils.hasApi(11)) {
|
||||
tv.setTextIsSelectable(true);
|
||||
tv.setMovementMethod(new CustomMovementMethod());
|
||||
@ -598,6 +598,7 @@ public class AppDetails extends ListActivity {
|
||||
ask_alrt.setMessage(getString(R.string.installDowngrade));
|
||||
ask_alrt.setPositiveButton(getString(R.string.yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
install();
|
||||
@ -605,6 +606,7 @@ public class AppDetails extends ListActivity {
|
||||
});
|
||||
ask_alrt.setNegativeButton(getString(R.string.no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
return;
|
||||
@ -807,6 +809,7 @@ public class AppDetails extends ListActivity {
|
||||
ask_alrt.setMessage(getString(R.string.installIncompatible));
|
||||
ask_alrt.setPositiveButton(getString(R.string.yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
downloadHandler = new DownloadHandler(app.curApk,
|
||||
@ -816,6 +819,7 @@ public class AppDetails extends ListActivity {
|
||||
});
|
||||
ask_alrt.setNegativeButton(getString(R.string.no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
return;
|
||||
@ -831,6 +835,7 @@ public class AppDetails extends ListActivity {
|
||||
builder.setMessage(R.string.SignatureMismatch).setPositiveButton(
|
||||
getString(R.string.ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
@ -890,6 +895,7 @@ public class AppDetails extends ListActivity {
|
||||
pd.setCancelable(true);
|
||||
pd.setCanceledOnTouchOutside(false);
|
||||
pd.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
downloadHandler.cancel();
|
||||
}
|
||||
@ -897,6 +903,7 @@ public class AppDetails extends ListActivity {
|
||||
pd.setButton(DialogInterface.BUTTON_NEUTRAL,
|
||||
getString(R.string.cancel),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
pd.cancel();
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.fdroid.fdroid;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@ -350,6 +351,7 @@ public class DB {
|
||||
}
|
||||
|
||||
private static class BasicChecker extends CompatibilityChecker {
|
||||
@Override
|
||||
public boolean isCompatible(Apk apk) {
|
||||
return hasApi(apk.minSdkVersion);
|
||||
}
|
||||
@ -362,6 +364,7 @@ public class DB {
|
||||
private List<String> cpuAbis;
|
||||
private boolean ignoreTouchscreen;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public EclairChecker(Context ctx) {
|
||||
|
||||
SharedPreferences prefs = PreferenceManager
|
||||
@ -397,6 +400,7 @@ public class DB {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompatible(Apk apk) {
|
||||
if (!hasApi(apk.minSdkVersion))
|
||||
return false;
|
||||
@ -1002,10 +1006,12 @@ public class DB {
|
||||
return (instance == null ? null : instance.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<String> iterator() {
|
||||
SimpleStringSplitter splitter = new SimpleStringSplitter(',');
|
||||
splitter.setString(value);
|
||||
|
@ -95,6 +95,7 @@ public class Downloader extends Thread {
|
||||
return curapk;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
InputStream input = null;
|
||||
|
@ -23,6 +23,7 @@ import android.content.*;
|
||||
import android.content.res.Configuration;
|
||||
import android.support.v4.view.MenuItemCompat;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.app.NotificationManager;
|
||||
@ -123,6 +124,7 @@ public class FDroid extends FragmentActivity {
|
||||
manager.repopulateLists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
getTabManager().onConfigurationChanged(newConfig);
|
||||
@ -205,6 +207,7 @@ public class FDroid extends FragmentActivity {
|
||||
alrt.setButton(AlertDialog.BUTTON_NEUTRAL,
|
||||
getString(R.string.about_website),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
Uri uri = Uri.parse("https://f-droid.org");
|
||||
@ -213,6 +216,7 @@ public class FDroid extends FragmentActivity {
|
||||
});
|
||||
alrt.setButton(AlertDialog.BUTTON_NEGATIVE, getString(R.string.ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
}
|
||||
@ -223,6 +227,7 @@ public class FDroid extends FragmentActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@TargetApi(5)
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
@ -237,6 +242,7 @@ public class FDroid extends FragmentActivity {
|
||||
ask_alrt.setMessage(getString(R.string.repo_alrt));
|
||||
ask_alrt.setPositiveButton(getString(R.string.yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
updateRepos();
|
||||
@ -244,6 +250,7 @@ public class FDroid extends FragmentActivity {
|
||||
});
|
||||
ask_alrt.setNegativeButton(getString(R.string.no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
return;
|
||||
@ -264,7 +271,7 @@ public class FDroid extends FragmentActivity {
|
||||
} else if ((resultCode & PreferencesActivity.RESULT_REFILTER) != 0) {
|
||||
((FDroidApp) getApplication()).filterApps();
|
||||
}
|
||||
|
||||
|
||||
if ((resultCode & PreferencesActivity.RESULT_RESTART) != 0) {
|
||||
((FDroidApp) getApplication()).reloadTheme();
|
||||
final Intent intent = getIntent();
|
||||
@ -284,6 +291,7 @@ public class FDroid extends FragmentActivity {
|
||||
viewPageAdapter = new AppListFragmentPageAdapter(this);
|
||||
viewPager.setAdapter(viewPageAdapter);
|
||||
viewPager.setOnPageChangeListener( new ViewPager.SimpleOnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
getTabManager().selectTab(position);
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ public class FDroidApp extends Application {
|
||||
.discCache(new UnlimitedDiscCache(
|
||||
new File(StorageUtils.getCacheDirectory(ctx), "icons"),
|
||||
new FileNameGenerator() {
|
||||
@Override
|
||||
public String generate(String imageUri) {
|
||||
return imageUri.substring(
|
||||
imageUri.lastIndexOf('/') + 1);
|
||||
|
@ -202,6 +202,7 @@ public class ManageRepo extends ListActivity {
|
||||
redraw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
|
||||
super.onCreateOptionsMenu(menu);
|
||||
@ -332,6 +333,7 @@ public class ManageRepo extends ListActivity {
|
||||
builder.setIcon(android.R.drawable.ic_menu_close_clear_cancel);
|
||||
builder.setMultiChoiceItems(b, null,
|
||||
new DialogInterface.OnMultiChoiceClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
@ -343,6 +345,7 @@ public class ManageRepo extends ListActivity {
|
||||
});
|
||||
builder.setPositiveButton(getString(R.string.ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
try {
|
||||
@ -357,6 +360,7 @@ public class ManageRepo extends ListActivity {
|
||||
});
|
||||
builder.setNegativeButton(getString(R.string.cancel),
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int whichButton) {
|
||||
return;
|
||||
|
@ -115,6 +115,7 @@ public class UpdateService extends IntentService implements ProgressListener {
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
|
||||
receiver = intent.getParcelableExtra("receiver");
|
||||
|
@ -38,6 +38,7 @@ public class AppListFragmentPageAdapter extends FragmentPagerAdapter {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPageTitle(int i) {
|
||||
switch(i) {
|
||||
case 0:
|
||||
|
@ -32,6 +32,7 @@ abstract class AppListFragment extends Fragment implements AdapterView.OnItemCli
|
||||
Preferences.get().unregisterCompactLayoutChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
try {
|
||||
|
@ -12,6 +12,7 @@ import org.fdroid.fdroid.views.AppListView;
|
||||
|
||||
public class AvailableAppsFragment extends AppListFragment implements AdapterView.OnItemSelectedListener {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
AppListView view = new AppListView(getActivity());
|
||||
view.setOrientation(LinearLayout.VERTICAL);
|
||||
@ -40,6 +41,7 @@ public class AvailableAppsFragment extends AppListFragment implements AdapterVie
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int pos,
|
||||
long id) {
|
||||
String category = parent.getItemAtPosition(pos).toString();
|
||||
|
@ -9,6 +9,7 @@ import org.fdroid.fdroid.views.AppListAdapter;
|
||||
|
||||
public class CanUpdateAppsFragment extends AppListFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return createPlainAppList();
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import org.fdroid.fdroid.views.AppListAdapter;
|
||||
|
||||
public class InstalledAppsFragment extends AppListFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
return createPlainAppList();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user