diff options
-rw-r--r-- | .linthub.yml | 3 | ||||
-rw-r--r-- | app/src/main/java/org/connectbot/HostListActivity.java | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/.linthub.yml b/.linthub.yml new file mode 100644 index 0000000..9094748 --- /dev/null +++ b/.linthub.yml @@ -0,0 +1,3 @@ +java: + lint: true + config: config/quality/checkstyle/checkstyle.xml diff --git a/app/src/main/java/org/connectbot/HostListActivity.java b/app/src/main/java/org/connectbot/HostListActivity.java index 7a4c334..c95769c 100644 --- a/app/src/main/java/org/connectbot/HostListActivity.java +++ b/app/src/main/java/org/connectbot/HostListActivity.java @@ -37,7 +37,6 @@ import android.content.Intent.ShortcutIconResource; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; -import android.content.res.ColorStateList; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -505,7 +504,7 @@ public class HostListActivity extends ListActivity implements OnHostStatusChange private final LayoutInflater inflater; private final List<HostBean> hosts; private final TerminalManager manager; - private final ColorStateList red, green, blue; + private final Context context; public final static int STATE_UNKNOWN = 1, STATE_CONNECTED = 2, STATE_DISCONNECTED = 3; @@ -516,13 +515,10 @@ public class HostListActivity extends ListActivity implements OnHostStatusChange } public HostAdapter(Context context, List<HostBean> hosts, TerminalManager manager) { - this.inflater = LayoutInflater.from(context); + this.context = context; this.hosts = hosts; this.manager = manager; - - red = context.getResources().getColorStateList(R.color.red); - green = context.getResources().getColorStateList(R.color.green); - blue = context.getResources().getColorStateList(R.color.blue); + this.inflater = LayoutInflater.from(context); } /** @@ -626,8 +622,8 @@ public class HostListActivity extends ListActivity implements OnHostStatusChange chosenStyleSecondLine = R.style.ListItemSecondLineText; } - holder.nickname.setTextAppearance(chosenStyleFirstLine); - holder.caption.setTextAppearance(chosenStyleSecondLine); + holder.nickname.setTextAppearance(context, chosenStyleFirstLine); + holder.caption.setTextAppearance(context, chosenStyleSecondLine); Context context = convertView.getContext(); CharSequence nice = context.getString(R.string.bind_never); |