checkstyle: enable and apply WhitespaceAfter

This commit is contained in:
Daniel Martí 2015-10-08 19:44:31 +02:00
parent 5736c70dc8
commit 793788eadf
33 changed files with 86 additions and 88 deletions

View File

@ -147,7 +147,7 @@ public class IntentIntegrator {
private String buttonYes;
private String buttonNo;
private List<String> targetApplications;
private final Map<String,Object> moreExtras = new HashMap<>(3);
private final Map<String, Object> moreExtras = new HashMap<>(3);
/**
* @param activity {@link Activity} invoking the integration
@ -240,7 +240,7 @@ public class IntentIntegrator {
this.targetApplications = Collections.singletonList(targetApplication);
}
public Map<String,?> getMoreExtras() {
public Map<String, ?> getMoreExtras() {
return moreExtras;
}
@ -481,7 +481,7 @@ public class IntentIntegrator {
}
private void attachMoreExtras(Intent intent) {
for (Map.Entry<String,Object> entry : moreExtras.entrySet()) {
for (Map.Entry<String, Object> entry : moreExtras.entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
// Kind of hacky

View File

@ -64,7 +64,7 @@ public class FDroidServiceInfo extends ServiceInfoImpl implements Parcelable {
int addressCount = in.readInt();
for (int i = 0; i < addressCount; i ++) {
try {
addAddress((Inet4Address)Inet4Address.getByAddress(readBytes(in)));
addAddress((Inet4Address) Inet4Address.getByAddress(readBytes(in)));
} catch (UnknownHostException e) {
e.printStackTrace();
}
@ -73,7 +73,7 @@ public class FDroidServiceInfo extends ServiceInfoImpl implements Parcelable {
addressCount = in.readInt();
for (int i = 0; i < addressCount; i ++) {
try {
addAddress((Inet6Address)Inet6Address.getByAddress(readBytes(in)));
addAddress((Inet6Address) Inet6Address.getByAddress(readBytes(in)));
} catch (UnknownHostException e) {
e.printStackTrace();
}

View File

@ -118,7 +118,7 @@ public class BoundedInputStream extends InputStream {
return -1;
}
long maxRead = max>=0 ? Math.min(len, max-pos) : len;
int bytesRead = in.read(b, off, (int)maxRead);
int bytesRead = in.read(b, off, (int) maxRead);
if (bytesRead==-1) {
return -1;

View File

@ -277,7 +277,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
}
if (Preferences.get().expertMode() && apk.nativecode != null) {
holder.nativecode.setText(apk.nativecode.toString().replaceAll(","," "));
holder.nativecode.setText(apk.nativecode.toString().replaceAll(",", " "));
holder.nativecode.setVisibility(View.VISIBLE);
} else {
holder.nativecode.setVisibility(View.GONE);
@ -392,7 +392,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
installer = Installer.getActivityInstaller(this, mPm, myInstallerCallback);
// Get the preferences we're going to use in this Activity...
ConfigurationChangeHelper previousData = (ConfigurationChangeHelper)getLastCustomNonConfigurationInstance();
ConfigurationChangeHelper previousData = (ConfigurationChangeHelper) getLastCustomNonConfigurationInstance();
if (previousData != null) {
Utils.debugLog(TAG, "Recreating view after configuration change.");
downloadHandler = previousData.downloader;
@ -1082,7 +1082,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
data = (AppDetailsData)activity;
data = (AppDetailsData) activity;
}
protected App getApp() { return data.getApp(); }
@ -1184,7 +1184,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
private final View.OnClickListener expander_description = new View.OnClickListener() {
public void onClick(View v) {
final TextView description = (TextView) ll_view_more_description.findViewById(R.id.description);
final TextView view_more_permissions = (TextView)ll_view_more_description.findViewById(R.id.view_more_description);
final TextView view_more_permissions = (TextView) ll_view_more_description.findViewById(R.id.view_more_description);
if (view_all_description) {
description.setMaxLines(Integer.MAX_VALUE);
view_more_permissions.setText(getString(R.string.less));
@ -1452,7 +1452,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
data = (AppDetailsData)activity;
data = (AppDetailsData) activity;
}
private void setupView(View view) {
@ -1650,8 +1650,8 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
data = (AppDetailsData)activity;
installListener = (AppInstallListener)activity;
data = (AppDetailsData) activity;
installListener = (AppInstallListener) activity;
}
protected void install(final Apk apk) {
@ -1731,7 +1731,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
public void setupSummaryHeader() {
Fragment fragment = getChildFragmentManager().findFragmentByTag(SUMMARY_TAG);
if (fragment != null) {
summaryFragment = (AppDetailsSummaryFragment)fragment;
summaryFragment = (AppDetailsSummaryFragment) fragment;
} else {
summaryFragment = new AppDetailsSummaryFragment();
}

View File

@ -329,7 +329,7 @@ public class FDroid extends ActionBarActivity {
}
private void createViews() {
viewPager = (ViewPager)findViewById(R.id.main_pager);
viewPager = (ViewPager) findViewById(R.id.main_pager);
AppListFragmentPagerAdapter viewPagerAdapter = new AppListFragmentPagerAdapter(this);
viewPager.setAdapter(viewPagerAdapter);
viewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {

View File

@ -130,7 +130,7 @@ public class Hasher {
value = halfbyte - 'A' + 10;
else
throw new IllegalArgumentException("Bad hex digit");
rawdata[i/2] += (byte)(i % 2 == 0 ? value << 4 : value);
rawdata[i/2] += (byte) (i % 2 == 0 ? value << 4 : value);
}
return rawdata;
}

View File

@ -145,7 +145,7 @@ public class RepoUpdater {
JarFile jarFile = new JarFile(downloadedFile, true);
JarEntry indexEntry = (JarEntry) jarFile.getEntry("index.xml");
indexInputStream = new ProgressBufferedInputStream(jarFile.getInputStream(indexEntry),
progressListener, repo, (int)indexEntry.getSize());
progressListener, repo, (int) indexEntry.getSize());
// Process the index...
final SAXParser parser = SAXParserFactory.newInstance().newSAXParser();

View File

@ -632,7 +632,7 @@ public class UpdateService extends IntentService implements ProgressListener {
ArrayList<ContentProviderOperation> o = new ArrayList<>(operations.subList(i, i + count));
sendStatus(STATUS_INFO, getString(
R.string.status_inserting,
(int)((double)(currentCount + i) / totalUpdateCount * 100)));
(int) ((double) (currentCount + i) / totalUpdateCount * 100)));
getContentResolver().applyBatch(providerAuthority, o);
i += 100;
}

View File

@ -24,8 +24,7 @@ class HoneycombClipboard extends ClipboardCompat {
private final ClipboardManager manager;
protected HoneycombClipboard(Context context) {
this.manager =
(ClipboardManager)context.getSystemService(Context.CLIPBOARD_SERVICE);
this.manager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
}
@Override

View File

@ -236,7 +236,7 @@ public class App extends ValueObject implements Comparable<App> {
PackageManager.GET_META_DATA);
installerPackageLabel = installerAppInfo.loadLabel(pm);
} catch (PackageManager.NameNotFoundException e) {
Log.w(TAG, "Could not get app info: " + installerPackageName,e);
Log.w(TAG, "Could not get app info: " + installerPackageName, e);
}
}
if (TextUtils.isEmpty(installerPackageLabel))

View File

@ -154,7 +154,7 @@ public class RepoProvider extends FDroidProvider {
if (values.containsKey(DataColumns.IN_USE)) {
Integer inUse = values.getAsInteger(DataColumns.IN_USE);
if (inUse != null && inUse == 0) {
values.put(DataColumns.LAST_ETAG, (String)null);
values.put(DataColumns.LAST_ETAG, (String) null);
}
}

View File

@ -32,7 +32,7 @@ public class BluetoothPeer implements Peer {
@Override
public boolean equals(Object peer) {
return peer != null && peer instanceof BluetoothPeer && ((BluetoothPeer)peer).device.getAddress().equals(device.getAddress());
return peer != null && peer instanceof BluetoothPeer && ((BluetoothPeer) peer).device.getAddress().equals(device.getAddress());
}
@Override

View File

@ -30,7 +30,7 @@ public class BonjourPeer extends WifiPeer {
@Override
public boolean equals(Object peer) {
if (peer != null && peer instanceof BonjourPeer) {
BonjourPeer that = (BonjourPeer)peer;
BonjourPeer that = (BonjourPeer) peer;
return this.getFingerprint().equals(that.getFingerprint());
}
return false;
@ -60,7 +60,7 @@ public class BonjourPeer extends WifiPeer {
}
protected BonjourPeer(Parcel in) {
this((ServiceInfo)in.readParcelable(FDroidServiceInfo.class.getClassLoader()));
this((ServiceInfo) in.readParcelable(FDroidServiceInfo.class.getClassLoader()));
}
public static final Creator<BonjourPeer> CREATOR = new Creator<BonjourPeer>() {

View File

@ -144,8 +144,7 @@ public final class Request {
int b = input.read();
if (((char)b) == '\n') {
if (((char) b) == '\n') {
if (baos.size() > 0)
line = new String(baos.toByteArray());

View File

@ -95,7 +95,7 @@ public class TabsAdapter extends PagerAdapter
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View)object);
container.removeView((View) object);
}
@Override

View File

@ -80,6 +80,6 @@ public class DownloadManagerReceiver extends BroadcastReceiver {
.build();
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify((int)downloadId, notif);
nm.notify((int) downloadId, notif);
}
}

View File

@ -83,7 +83,7 @@ public abstract class AppListAdapter extends CursorAdapter {
@Override
public void bindView(View view, Context context, Cursor cursor) {
ViewHolder holder = (ViewHolder)view.getTag();
ViewHolder holder = (ViewHolder) view.getTag();
setupView(context, view, cursor, holder);
}
@ -140,12 +140,12 @@ public abstract class AppListAdapter extends CursorAdapter {
}
private void layoutIcon(ImageView icon, boolean compact) {
int size = (int)mContext.getResources().getDimension((compact
int size = (int) mContext.getResources().getDimension((compact
? R.dimen.applist_icon_compact_size
: R.dimen.applist_icon_normal_size));
LinearLayout.LayoutParams params =
(LinearLayout.LayoutParams)icon.getLayoutParams();
(LinearLayout.LayoutParams) icon.getLayoutParams();
params.height = size;
params.width = size;

View File

@ -81,7 +81,7 @@ public class RepoAdapter extends CursorAdapter {
}
});
TextView nameView = (TextView)view.findViewById(R.id.repo_name);
TextView nameView = (TextView) view.findViewById(R.id.repo_name);
nameView.setText(repo.getName());
View unsignedView = view.findViewById(R.id.repo_unsigned);

View File

@ -85,8 +85,8 @@ public abstract class AppListFragment extends ThemeableListFragment implements
String emptyMessage = getEmptyMessage();
if (emptyMessage != null) {
View emptyView = getLayoutInflater(savedInstanceState).inflate(R.layout.empty_app_list, null);
((TextView)emptyView.findViewById(R.id.text)).setText(emptyMessage);
((ViewGroup)getListView().getParent()).addView(emptyView); // Needs to be added to this parent or it doesn't show.
((TextView) emptyView.findViewById(R.id.text)).setText(emptyMessage);
((ViewGroup) getListView().getParent()).addView(emptyView); // Needs to be added to this parent or it doesn't show.
getListView().setEmptyView(emptyView);
}
}
@ -143,7 +143,7 @@ public abstract class AppListFragment extends ThemeableListFragment implements
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// Cursor is null in the swap list when touching the first item.
Cursor cursor = (Cursor)getListView().getItemAtPosition(position);
Cursor cursor = (Cursor) getListView().getItemAtPosition(position);
if (cursor != null) {
final App app = new App(cursor);
Intent intent = getAppDetailsIntent();

View File

@ -180,9 +180,9 @@ public class AvailableAppsFragment extends AppListFragment implements
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.available_app_list, container, false);
setupCategorySpinner((Spinner)view.findViewById(R.id.category_spinner));
setupCategorySpinner((Spinner) view.findViewById(R.id.category_spinner));
((ListView)view.findViewById(android.R.id.list)).setOnItemClickListener(this);
((ListView) view.findViewById(android.R.id.list)).setOnItemClickListener(this);
DEFAULT_CATEGORY = AppProvider.Helper.getCategoryWhatsNew(getActivity());

View File

@ -53,17 +53,17 @@ public class PreferencesFragment extends PreferenceFragment
}
protected void checkSummary(String key, int resId) {
CheckBoxPreference pref = (CheckBoxPreference)findPreference(key);
CheckBoxPreference pref = (CheckBoxPreference) findPreference(key);
pref.setSummary(resId);
}
protected void entrySummary(String key) {
ListPreference pref = (ListPreference)findPreference(key);
ListPreference pref = (ListPreference) findPreference(key);
pref.setSummary(pref.getEntry());
}
protected void textSummary(String key, int resId) {
EditTextPreference pref = (EditTextPreference)findPreference(key);
EditTextPreference pref = (EditTextPreference) findPreference(key);
pref.setSummary(getString(resId, pref.getText()));
}
@ -73,7 +73,7 @@ public class PreferencesFragment extends PreferenceFragment
switch (key) {
case Preferences.PREF_UPD_INTERVAL:
ListPreference listPref = (ListPreference)findPreference(
ListPreference listPref = (ListPreference) findPreference(
Preferences.PREF_UPD_INTERVAL);
int interval = Integer.parseInt(listPref.getValue());
Preference onlyOnWifi = findPreference(
@ -286,7 +286,7 @@ public class PreferencesFragment extends PreferenceFragment
}
private void langSpinner(String key) {
final ListPreference pref = (ListPreference)findPreference(key);
final ListPreference pref = (ListPreference) findPreference(key);
final String[] langValues = getResources().getStringArray(R.array.languageValues);
String[] langNames = new String[langValues.length];
langNames[0] = getString(R.string.pref_language_default);

View File

@ -40,7 +40,7 @@ public abstract class ThemeableListFragment extends ListFragment {
private LayoutInflater getThemedInflater(Context context) {
Context c = (getThemeStyle() == 0) ? context : new ContextThemeWrapper(context, getThemeStyle());
return (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return (LayoutInflater) c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
/**

View File

@ -38,7 +38,7 @@ public class ConfirmReceive extends RelativeLayout implements SwapWorkflowActivi
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
@Override

View File

@ -33,7 +33,7 @@ public class InitialLoadingView extends RelativeLayout implements SwapWorkflowAc
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
@Override

View File

@ -46,7 +46,7 @@ public class JoinWifiView extends RelativeLayout implements SwapWorkflowActivity
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
@Override

View File

@ -38,13 +38,13 @@ public class NfcView extends RelativeLayout implements SwapWorkflowActivity.Inne
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
CheckBox dontShowAgain = (CheckBox)findViewById(R.id.checkbox_dont_show);
CheckBox dontShowAgain = (CheckBox) findViewById(R.id.checkbox_dont_show);
dontShowAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

View File

@ -61,7 +61,7 @@ public class SelectAppsView extends ListView implements
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
private SwapService getState() {
@ -232,7 +232,7 @@ public class SelectAppsView extends ListView implements
private LayoutInflater getInflater(Context context) {
if (inflater == null) {
Context themedContext = new ContextThemeWrapper(context, R.style.SwapTheme_AppList_ListItem);
inflater = (LayoutInflater)themedContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater = (LayoutInflater) themedContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
return inflater;
}
@ -254,9 +254,9 @@ public class SelectAppsView extends ListView implements
@Override
public void bindView(final View view, final Context context, final Cursor cursor) {
TextView packageView = (TextView)view.findViewById(R.id.package_name);
TextView labelView = (TextView)view.findViewById(R.id.application_label);
ImageView iconView = (ImageView)view.findViewById(android.R.id.icon);
TextView packageView = (TextView) view.findViewById(R.id.package_name);
TextView labelView = (TextView) view.findViewById(R.id.application_label);
ImageView iconView = (ImageView) view.findViewById(android.R.id.icon);
String packageName = cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID));
String appLabel = cursor.getString(cursor.getColumnIndex(InstalledAppProvider.DataColumns.APPLICATION_LABEL));
@ -279,7 +279,7 @@ public class SelectAppsView extends ListView implements
// by adding a checkbox which can toggle selected items.
View checkBoxView = view.findViewById(R.id.checkbox);
if (checkBoxView != null) {
CheckBox checkBox = (CheckBox)checkBoxView;
CheckBox checkBox = (CheckBox) checkBoxView;
checkBox.setOnCheckedChangeListener(null);
checkBox.setChecked(listView.isItemChecked(listPosition));
@ -306,7 +306,7 @@ public class SelectAppsView extends ListView implements
}
private void updateCheckedIndicatorView(View view, boolean checked) {
ImageView imageView = (ImageView)view.findViewById(R.id.checked);
ImageView imageView = (ImageView) view.findViewById(R.id.checked);
if (imageView != null) {
int resource;
int colour;

View File

@ -81,8 +81,8 @@ public class StartSwapView extends ScrollView implements SwapWorkflowActivity.In
}
Peer peer = getItem(position);
((TextView)convertView.findViewById(R.id.peer_name)).setText(peer.getName());
((ImageView)convertView.findViewById(R.id.icon)).setImageDrawable(getResources().getDrawable(peer.getIcon()));
((TextView) convertView.findViewById(R.id.peer_name)).setText(peer.getName());
((ImageView) convertView.findViewById(R.id.icon)).setImageDrawable(getResources().getDrawable(peer.getIcon()));
return convertView;
}
@ -90,7 +90,7 @@ public class StartSwapView extends ScrollView implements SwapWorkflowActivity.In
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
private SwapService getManager() {
@ -153,9 +153,9 @@ public class StartSwapView extends ScrollView implements SwapWorkflowActivity.In
*/
private void uiInitPeers() {
peopleNearbyText = (TextView)findViewById(R.id.text_people_nearby);
peopleNearbyList = (ListView)findViewById(R.id.list_people_nearby);
peopleNearbyProgress = (ProgressBar)findViewById(R.id.searching_people_nearby);
peopleNearbyText = (TextView) findViewById(R.id.text_people_nearby);
peopleNearbyList = (ListView) findViewById(R.id.list_people_nearby);
peopleNearbyProgress = (ProgressBar) findViewById(R.id.searching_people_nearby);
final PeopleNearbyAdapter adapter = new PeopleNearbyAdapter(getContext());
peopleNearbyList.setAdapter(adapter);
@ -204,9 +204,9 @@ public class StartSwapView extends ScrollView implements SwapWorkflowActivity.In
private void uiInitBluetooth() {
if (bluetooth != null) {
final TextView textBluetoothVisible = (TextView)findViewById(R.id.bluetooth_visible);
final TextView textBluetoothVisible = (TextView) findViewById(R.id.bluetooth_visible);
viewBluetoothId = (TextView)findViewById(R.id.device_id_bluetooth);
viewBluetoothId = (TextView) findViewById(R.id.device_id_bluetooth);
viewBluetoothId.setText(bluetooth.getName());
viewBluetoothId.setVisibility(bluetooth.isEnabled() ? View.VISIBLE : View.GONE);
@ -269,10 +269,10 @@ public class StartSwapView extends ScrollView implements SwapWorkflowActivity.In
private void uiInitWifi() {
viewWifiId = (TextView)findViewById(R.id.device_id_wifi);
viewWifiNetwork = (TextView)findViewById(R.id.wifi_network);
viewWifiId = (TextView) findViewById(R.id.device_id_wifi);
viewWifiNetwork = (TextView) findViewById(R.id.wifi_network);
final SwitchCompat wifiSwitch = (SwitchCompat)findViewById(R.id.switch_wifi);
final SwitchCompat wifiSwitch = (SwitchCompat) findViewById(R.id.switch_wifi);
wifiSwitch.setChecked(getManager().isBonjourDiscoverable());
wifiSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
@ -290,7 +290,7 @@ public class StartSwapView extends ScrollView implements SwapWorkflowActivity.In
}
});
final TextView textWifiVisible = (TextView)findViewById(R.id.wifi_visible);
final TextView textWifiVisible = (TextView) findViewById(R.id.wifi_visible);
int textResource = getManager().isBonjourDiscoverable() ? R.string.swap_visible_wifi : R.string.swap_not_visible_wifi;
textWifiVisible.setText(textResource);

View File

@ -81,7 +81,7 @@ public class SwapAppsView extends ListView implements
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
private static final int LOADER_SWAPABLE_APPS = 759283741;
@ -124,7 +124,7 @@ public class SwapAppsView extends ListView implements
private void pollForUpdates() {
if (adapter.getCount() > 1 ||
(adapter.getCount() == 1 && !new App((Cursor)adapter.getItem(0)).id.equals("org.fdroid.fdroid"))) {
(adapter.getCount() == 1 && !new App((Cursor) adapter.getItem(0)).id.equals("org.fdroid.fdroid"))) {
Utils.debugLog(TAG, "Not polling for new apps from swap repo, because we already have more than one.");
return;
}
@ -441,7 +441,7 @@ public class SwapAppsView extends ListView implements
@NonNull
private LayoutInflater getInflater(Context context) {
if (inflater == null) {
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
return inflater;
}
@ -459,13 +459,13 @@ public class SwapAppsView extends ListView implements
ViewHolder holder = new ViewHolder();
holder.progressView = (ProgressBar)view.findViewById(R.id.progress);
holder.nameView = (TextView)view.findViewById(R.id.name);
holder.iconView = (ImageView)view.findViewById(android.R.id.icon);
holder.btnInstall = (Button)view.findViewById(R.id.btn_install);
holder.btnAttemptInstall = (TextView)view.findViewById(R.id.btn_attempt_install);
holder.statusInstalled = (TextView)view.findViewById(R.id.status_installed);
holder.statusIncompatible = (TextView)view.findViewById(R.id.status_incompatible);
holder.progressView = (ProgressBar) view.findViewById(R.id.progress);
holder.nameView = (TextView) view.findViewById(R.id.name);
holder.iconView = (ImageView) view.findViewById(android.R.id.icon);
holder.btnInstall = (Button) view.findViewById(R.id.btn_install);
holder.btnAttemptInstall = (TextView) view.findViewById(R.id.btn_attempt_install);
holder.statusInstalled = (TextView) view.findViewById(R.id.status_installed);
holder.statusIncompatible = (TextView) view.findViewById(R.id.status_incompatible);
view.setTag(holder);
bindView(view, context, cursor);
@ -474,7 +474,7 @@ public class SwapAppsView extends ListView implements
@Override
public void bindView(final View view, final Context context, final Cursor cursor) {
ViewHolder holder = (ViewHolder)view.getTag();
ViewHolder holder = (ViewHolder) view.getTag();
final App app = new App(cursor);
holder.setApp(app);
}

View File

@ -46,7 +46,7 @@ public class SwapConnecting extends LinearLayout implements SwapWorkflowActivity
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
@Override

View File

@ -124,7 +124,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
@Override
public void onServiceConnected(ComponentName className, IBinder binder) {
Utils.debugLog(TAG, "Swap service connected. Will hold onto it so we can talk to it regularly.");
service = ((SwapService.Binder)binder).getService();
service = ((SwapService.Binder) binder).getService();
showRelevantView();
}
@ -332,8 +332,8 @@ public class SwapWorkflowActivity extends AppCompatActivity {
private InnerView inflateInnerView(@LayoutRes int viewRes) {
container.removeAllViews();
View view = ((LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(viewRes, container, false);
currentView = (InnerView)view;
View view = ((LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(viewRes, container, false);
currentView = (InnerView) view;
// Don't actually set the step to STEP_INITIAL_LOADING, as we are going to use this view
// purely as a placeholder for _whatever view is meant to be shown_.
@ -381,7 +381,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
}
private void showConfirmSwap(@NonNull NewRepoConfig config) {
((ConfirmReceive)inflateInnerView(R.layout.swap_confirm_receive)).setup(config);
((ConfirmReceive) inflateInnerView(R.layout.swap_confirm_receive)).setup(config);
}
public void startQrWorkflow() {

View File

@ -57,7 +57,7 @@ public class WifiQrView extends ScrollView implements SwapWorkflowActivity.Inner
}
private SwapWorkflowActivity getActivity() {
return (SwapWorkflowActivity)getContext();
return (SwapWorkflowActivity) getContext();
}
@Override
@ -65,12 +65,12 @@ public class WifiQrView extends ScrollView implements SwapWorkflowActivity.Inner
super.onFinishInflate();
setUIFromWifi();
ImageView qrImage = (ImageView)findViewById(R.id.wifi_qr_code);
ImageView qrImage = (ImageView) findViewById(R.id.wifi_qr_code);
// Replace all blacks with the background blue.
qrImage.setColorFilter(new LightingColorFilter(0xffffffff, getResources().getColor(R.color.swap_blue)));
Button openQr = (Button)findViewById(R.id.btn_qr_scanner);
Button openQr = (Button) findViewById(R.id.btn_qr_scanner);
openQr.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -42,7 +42,7 @@
<!--<module name="OperatorWrap" />-->
<module name="ParenPad" />
<module name="TypecastParenPad" />
<!--<module name="WhitespaceAfter" />-->
<module name="WhitespaceAfter" />
<!--<module name="WhitespaceAround" />-->
<module name="ModifierOrder" />