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