Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

few code cleanups #334

Closed
wants to merge 2 commits into from

3 participants

@krishnakumarp

removed unnecessary casts
replace String.indexOf with String.contains

@krishnakumarp krishnakumarp few code refactoring/cleanup
removed unnecessary casts
replace String.indexOf with String.contains
08e859a
app/src/main/java/com/github/mobile/ui/ViewPager.java
@@ -112,7 +112,7 @@ public void run() {
protected boolean canScroll(final View v, final boolean checkV,
final int dx, final int x, final int y) {
if (SDK_INT < ICE_CREAM_SANDWICH && v instanceof WebView)
- return ((WebView) v).canScrollHorizontally(-dx);
+ return v.canScrollHorizontally(-dx);
@kevinsawicki Owner

canScrollHorizontally was added in API level 14 to View so this cast is still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@krishnakumarp krishnakumarp Reverting removal of a cast
canScrollHorizontally was added in API level 14 to View. Adding the type
cast back into code.
d720b3d
@kevinsawicki
Owner

Thanks, merged into master as commit 836de09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2013
  1. @krishnakumarp

    few code refactoring/cleanup

    krishnakumarp authored
    removed unnecessary casts
    replace String.indexOf with String.contains
Commits on Apr 30, 2013
  1. @krishnakumarp

    Reverting removal of a cast

    krishnakumarp authored
    canScrollHorizontally was added in API level 14 to View. Adding the type
    cast back into code.
This page is out of date. Refresh to see the latest.
View
6 app/src/main/java/com/github/mobile/ui/issue/EditIssuesFilterActivity.java
@@ -137,7 +137,7 @@ public void onClick(View v) {
}
};
- ((TextView) findViewById(id.tv_assignee_label))
+ findViewById(id.tv_assignee_label)
.setOnClickListener(assigneeListener);
assigneeText.setOnClickListener(assigneeListener);
@@ -152,7 +152,7 @@ public void onClick(View v) {
}
};
- ((TextView) findViewById(id.tv_milestone_label))
+ findViewById(id.tv_milestone_label)
.setOnClickListener(milestoneListener);
milestoneText.setOnClickListener(milestoneListener);
@@ -167,7 +167,7 @@ public void onClick(View v) {
}
};
- ((TextView) findViewById(id.tv_labels_label))
+ findViewById(id.tv_labels_label)
.setOnClickListener(labelsListener);
labelsText.setOnClickListener(labelsListener);
View
2  app/src/main/java/com/github/mobile/ui/issue/IssueFragment.java
@@ -270,7 +270,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
labelsArea = (TextView) headerView.findViewById(id.tv_labels);
milestoneArea = headerView.findViewById(id.ll_milestone);
milestoneText = (TextView) headerView.findViewById(id.tv_milestone);
- milestoneProgressArea = (View) headerView.findViewById(id.v_closed);
+ milestoneProgressArea = headerView.findViewById(id.v_closed);
bodyText = (TextView) headerView.findViewById(id.tv_issue_body);
bodyText.setMovementMethod(LinkMovementMethod.getInstance());
View
2  app/src/main/java/com/github/mobile/ui/ref/BranchFileViewActivity.java
@@ -267,7 +267,7 @@ private void loadMarkdown() {
Bundle args = new Bundle();
args.putCharSequence(ARG_TEXT, markdown);
if (repo instanceof Serializable)
- args.putSerializable(ARG_REPO, (Serializable) repo);
+ args.putSerializable(ARG_REPO, repo);
getSupportLoaderManager().restartLoader(0, args, this);
}
View
2  app/src/main/java/com/github/mobile/util/HttpImageGetter.java
@@ -70,7 +70,7 @@ public Drawable getDrawable(String source) {
}
private static boolean containsImages(final String html) {
- return html.indexOf("<img") != -1;
+ return html.contains("<img");
}
private final LoadingImageGetter loading;
Something went wrong with that request. Please try again.