This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Checkstyle entire project.

  • Loading branch information...
JakeWharton committed May 18, 2012
1 parent 1f72c1a commit 554d755656754698dc4a609937ad77911a04861f
Showing with 516 additions and 518 deletions.
  1. 0 {library → }/checkstyle.xml
  2. +1 −1 library/pom.xml
  3. +17 −1 sample/pom.xml
  4. +37 −38 sample/src/com/viewpagerindicator/sample/BaseSampleActivity.java
  5. +11 −11 sample/src/com/viewpagerindicator/sample/ListSamples.java
  6. +13 −14 sample/src/com/viewpagerindicator/sample/SampleCirclesDefault.java
  7. +16 −17 sample/src/com/viewpagerindicator/sample/SampleCirclesInitialPage.java
  8. +15 −16 sample/src/com/viewpagerindicator/sample/SampleCirclesSnap.java
  9. +13 −14 sample/src/com/viewpagerindicator/sample/SampleCirclesStyledLayout.java
  10. +21 −22 sample/src/com/viewpagerindicator/sample/SampleCirclesStyledMethods.java
  11. +15 −16 sample/src/com/viewpagerindicator/sample/SampleCirclesStyledTheme.java
  12. +29 −30 sample/src/com/viewpagerindicator/sample/SampleCirclesWithListener.java
  13. +10 −10 sample/src/com/viewpagerindicator/sample/SampleLinesDefault.java
  14. +16 −16 sample/src/com/viewpagerindicator/sample/SampleLinesStyledMethods.java
  15. +11 −11 sample/src/com/viewpagerindicator/sample/SampleLinesStyledTheme.java
  16. +36 −37 sample/src/com/viewpagerindicator/sample/SampleTabsDefault.java
  17. +36 −37 sample/src/com/viewpagerindicator/sample/SampleTabsStyled.java
  18. +15 −16 sample/src/com/viewpagerindicator/sample/SampleTitlesCenterClickListener.java
  19. +13 −14 sample/src/com/viewpagerindicator/sample/SampleTitlesDefault.java
  20. +16 −17 sample/src/com/viewpagerindicator/sample/SampleTitlesInitialPage.java
  21. +13 −14 sample/src/com/viewpagerindicator/sample/SampleTitlesStyledLayout.java
  22. +24 −25 sample/src/com/viewpagerindicator/sample/SampleTitlesStyledMethods.java
  23. +15 −16 sample/src/com/viewpagerindicator/sample/SampleTitlesStyledTheme.java
  24. +14 −15 sample/src/com/viewpagerindicator/sample/SampleTitlesTriangle.java
  25. +29 −30 sample/src/com/viewpagerindicator/sample/SampleTitlesWithListener.java
  26. +10 −10 sample/src/com/viewpagerindicator/sample/SamplelinesStyledLayout.java
  27. +42 −42 sample/src/com/viewpagerindicator/sample/TestFragment.java
  28. +21 −21 sample/src/com/viewpagerindicator/sample/TestFragmentAdapter.java
  29. +7 −7 sample/src/com/viewpagerindicator/sample/TestTitleFragmentAdapter.java
File renamed without changes.
View
@@ -43,7 +43,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
- <configLocation>${project.basedir}/checkstyle.xml</configLocation>
+ <configLocation>../checkstyle.xml</configLocation>
</configuration>
<executions>
<execution>
View
@@ -26,7 +26,7 @@
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
</dependency>
-
+
<dependency>
<groupId>com.viewpagerindicator</groupId>
<artifactId>library</artifactId>
@@ -50,6 +50,22 @@
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <configLocation>../checkstyle.xml</configLocation>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <goals>
+ <goal>checkstyle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
@@ -3,7 +3,6 @@
import java.util.Random;
import com.viewpagerindicator.PageIndicator;
-import com.viewpagerindicator.sample.R;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
@@ -12,41 +11,41 @@
import android.widget.Toast;
public abstract class BaseSampleActivity extends FragmentActivity {
- private static final Random RANDOM = new Random();
-
- TestFragmentAdapter mAdapter;
- ViewPager mPager;
- PageIndicator mIndicator;
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.menu, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.random:
- final int page = RANDOM.nextInt(mAdapter.getCount());
- Toast.makeText(this, "Changing to page " + page, Toast.LENGTH_SHORT);
- mPager.setCurrentItem(page);
- return true;
-
- case R.id.add_page:
- if (mAdapter.getCount() < 10) {
- mAdapter.setCount(mAdapter.getCount() + 1);
- mIndicator.notifyDataSetChanged();
- }
- return true;
-
- case R.id.remove_page:
- if (mAdapter.getCount() > 1) {
- mAdapter.setCount(mAdapter.getCount() - 1);
- mIndicator.notifyDataSetChanged();
- }
- return true;
- }
- return super.onOptionsItemSelected(item);
- }
+ private static final Random RANDOM = new Random();
+
+ TestFragmentAdapter mAdapter;
+ ViewPager mPager;
+ PageIndicator mIndicator;
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.random:
+ final int page = RANDOM.nextInt(mAdapter.getCount());
+ Toast.makeText(this, "Changing to page " + page, Toast.LENGTH_SHORT);
+ mPager.setCurrentItem(page);
+ return true;
+
+ case R.id.add_page:
+ if (mAdapter.getCount() < 10) {
+ mAdapter.setCount(mAdapter.getCount() + 1);
+ mIndicator.notifyDataSetChanged();
+ }
+ return true;
+
+ case R.id.remove_page:
+ if (mAdapter.getCount() > 1) {
+ mAdapter.setCount(mAdapter.getCount() - 1);
+ mIndicator.notifyDataSetChanged();
+ }
+ return true;
+ }
+ return super.onOptionsItemSelected(item);
+ }
}
@@ -21,10 +21,10 @@
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
+
Intent intent = getIntent();
String path = intent.getStringExtra("com.jakewharton.android.viewpagerindicator.sample.Path");
-
+
if (path == null) {
path = "";
}
@@ -49,16 +49,16 @@ public void onCreate(Bundle savedInstanceState) {
String[] prefixPath;
String prefixWithSlash = prefix;
-
+
if (prefix.equals("")) {
prefixPath = null;
} else {
prefixPath = prefix.split("/");
prefixWithSlash = prefix + "/";
}
-
+
int len = list.size();
-
+
Map<String, Boolean> entries = new HashMap<String, Boolean>();
for (int i = 0; i < len; i++) {
@@ -67,9 +67,9 @@ public void onCreate(Bundle savedInstanceState) {
String label = labelSeq != null
? labelSeq.toString()
: info.activityInfo.name;
-
+
if (prefixWithSlash.length() == 0 || label.startsWith(prefixWithSlash)) {
-
+
String[] labelPath = label.split("/");
String nextLabel = prefixPath == null ? labelPath[0] : labelPath[prefixPath.length];
@@ -87,12 +87,12 @@ public void onCreate(Bundle savedInstanceState) {
}
}
- Collections.sort(myData, sDisplayNameComparator);
-
+ Collections.sort(myData, NAME_COMPARATOR);
+
return myData;
}
- private final static Comparator<Map<String, Object>> sDisplayNameComparator =
+ private final static Comparator<Map<String, Object>> NAME_COMPARATOR =
new Comparator<Map<String, Object>>() {
private final Collator collator = Collator.getInstance();
@@ -106,7 +106,7 @@ protected Intent activityIntent(String pkg, String componentName) {
result.setClassName(pkg, componentName);
return result;
}
-
+
protected Intent browseIntent(String path) {
Intent result = new Intent();
result.setClass(this, ListSamples.class);
@@ -3,20 +3,19 @@
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.CirclePageIndicator;
-import com.viewpagerindicator.sample.R;
public class SampleCirclesDefault extends BaseSampleActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.simple_circles);
-
- mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
-
- mPager = (ViewPager)findViewById(R.id.pager);
- mPager.setAdapter(mAdapter);
-
- mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
- mIndicator.setViewPager(mPager);
- }
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.simple_circles);
+
+ mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
+
+ mPager = (ViewPager)findViewById(R.id.pager);
+ mPager.setAdapter(mAdapter);
+
+ mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
+ mIndicator.setViewPager(mPager);
+ }
}
@@ -3,23 +3,22 @@
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.CirclePageIndicator;
-import com.viewpagerindicator.sample.R;
public class SampleCirclesInitialPage extends BaseSampleActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.simple_circles);
-
- mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
-
- mPager = (ViewPager)findViewById(R.id.pager);
- mPager.setAdapter(mAdapter);
-
- mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
- mIndicator.setViewPager(mPager);
- mIndicator.setCurrentItem(mAdapter.getCount() - 1);
-
- //You can also do: indicator.setViewPager(pager, initialPage);
- }
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.simple_circles);
+
+ mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
+
+ mPager = (ViewPager)findViewById(R.id.pager);
+ mPager.setAdapter(mAdapter);
+
+ mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
+ mIndicator.setViewPager(mPager);
+ mIndicator.setCurrentItem(mAdapter.getCount() - 1);
+
+ //You can also do: indicator.setViewPager(pager, initialPage);
+ }
}
@@ -3,22 +3,21 @@
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.CirclePageIndicator;
-import com.viewpagerindicator.sample.R;
public class SampleCirclesSnap extends BaseSampleActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.simple_circles);
-
- mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
-
- mPager = (ViewPager)findViewById(R.id.pager);
- mPager.setAdapter(mAdapter);
-
- CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
- mIndicator = indicator;
- indicator.setViewPager(mPager);
- indicator.setSnap(true);
- }
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.simple_circles);
+
+ mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
+
+ mPager = (ViewPager)findViewById(R.id.pager);
+ mPager.setAdapter(mAdapter);
+
+ CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
+ mIndicator = indicator;
+ indicator.setViewPager(mPager);
+ indicator.setSnap(true);
+ }
}
@@ -3,20 +3,19 @@
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.CirclePageIndicator;
-import com.viewpagerindicator.sample.R;
public class SampleCirclesStyledLayout extends BaseSampleActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.themed_circles);
-
- mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
-
- mPager = (ViewPager)findViewById(R.id.pager);
- mPager.setAdapter(mAdapter);
-
- mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
- mIndicator.setViewPager(mPager);
- }
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.themed_circles);
+
+ mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
+
+ mPager = (ViewPager)findViewById(R.id.pager);
+ mPager.setAdapter(mAdapter);
+
+ mIndicator = (CirclePageIndicator)findViewById(R.id.indicator);
+ mIndicator.setViewPager(mPager);
+ }
}
@@ -3,29 +3,28 @@
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.CirclePageIndicator;
-import com.viewpagerindicator.sample.R;
public class SampleCirclesStyledMethods extends BaseSampleActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.simple_circles);
-
- mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
-
- mPager = (ViewPager)findViewById(R.id.pager);
- mPager.setAdapter(mAdapter);
-
- CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
- mIndicator = indicator;
- indicator.setViewPager(mPager);
-
- final float density = getResources().getDisplayMetrics().density;
- indicator.setBackgroundColor(0xFFCCCCCC);
- indicator.setRadius(10 * density);
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.simple_circles);
+
+ mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
+
+ mPager = (ViewPager)findViewById(R.id.pager);
+ mPager.setAdapter(mAdapter);
+
+ CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
+ mIndicator = indicator;
+ indicator.setViewPager(mPager);
+
+ final float density = getResources().getDisplayMetrics().density;
+ indicator.setBackgroundColor(0xFFCCCCCC);
+ indicator.setRadius(10 * density);
indicator.setPageColor(0x880000FF);
- indicator.setFillColor(0xFF888888);
- indicator.setStrokeColor(0xFF000000);
- indicator.setStrokeWidth(2 * density);
- }
+ indicator.setFillColor(0xFF888888);
+ indicator.setStrokeColor(0xFF000000);
+ indicator.setStrokeWidth(2 * density);
+ }
}
Oops, something went wrong.

0 comments on commit 554d755

Please sign in to comment.