Skip to content

Commit

Permalink
format files
Browse files Browse the repository at this point in the history
  • Loading branch information
bbtfr committed Jan 23, 2015
1 parent 68c465b commit 9f486b9
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Motion::Project::App.setup do |app|

app.api_version = '14'
app.target_api_version = '14'
app.permissions += %w(ACCESS_NETWORK_STATE

app.permissions += %w(ACCESS_NETWORK_STATE
READ_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE).map do |perm|
"android.permission.#{perm}"
end
Expand Down
10 changes: 5 additions & 5 deletions app/ElementView.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void initView() {
mElementViewTopPadding = getContext().getResources()
.getDimension(R.dimen.element_view_top_padding);
}

private PointF getPoint(float centerX, float centerY, float r, int i) {
double th = (Math.PI * 2) / 360;
PointF point = new PointF((float) (centerX + r * Math.cos((-i * 72 + 90) * th)),
Expand Down Expand Up @@ -87,7 +87,7 @@ protected void onSizeChanged(int w, int h, int oldw, int oldh) {
for (int i = 1; i < 5; i++)
mBoundPath.lineTo(mBoundPoints[i].x, mBoundPoints[i].y);
mBoundPath.close();

mHalfBoundPath.reset();
PointF tmpPoint = getPoint(centerX, centerY, r / 2.0f, 0);
mHalfBoundPath.moveTo(tmpPoint.x, tmpPoint.y);
Expand All @@ -106,7 +106,7 @@ protected void onDraw(Canvas canvas) {
mPaint.setStyle(Style.FILL);
mPaint.setColor(0x11000000);
canvas.drawPath(mHalfBoundPath, mPaint);

//Element
mPaint.setStyle(Style.FILL);
int index = (mMode > 0 && mMode < 6) ? mMode - 1 : 0;
Expand All @@ -128,12 +128,12 @@ protected void onDraw(Canvas canvas) {
mElementBoundPath.lineTo(tmpPoint.x, tmpPoint.y);
mElementBoundPath.close();
canvas.drawPath(mElementBoundPath, mPaint);

//Circle
mPaint.setStyle(Style.FILL);
for (int i = 0; i < 5; i++) {
mPaint.setColor(COLORS[i]);
canvas.drawCircle(mBoundPoints[i].x, mBoundPoints[i].y,
canvas.drawCircle(mBoundPoints[i].x, mBoundPoints[i].y,
mElementBoundPointRadio, mPaint);
}
}
Expand Down
16 changes: 8 additions & 8 deletions app/UnitItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class UnitItem {
public float wind;
public float light;
public float dark;

// =====
// 同伴
public String title;
Expand All @@ -24,7 +24,7 @@ public class UnitItem {
public int tenacity;
public float aspd;
public String country;

public int weapon; // 1斩击 2突击 3打击 4弓箭 5魔法 6铳弹 7回复
public int aarea;
public int anum;
Expand Down Expand Up @@ -69,13 +69,13 @@ public UnitItem(JSONObject json) {
this.skill = json.optString("skill", "");
this.obtain = json.optString("obtain", "");
}

public String getRareString() {
String[] elements = { "", "★", "★★", "★★★", "★★★★", "★★★★★" };
int index = rare >= 0 && rare < 6 ? rare : 0;
return elements[index];
}

public String getElementString() {
String[] elements = { "", "火", "水", "风", "光", "暗" };
int index = element >= 0 && element < 6 ? element : 0;
Expand Down Expand Up @@ -103,7 +103,7 @@ private int calcMaxLv(int value) {
private int calcMaxLvAndGrow(int value) {
float f = calcF();
int levelPart = (int) (value * f);
int growPart = ((int) (value * (f - 1) / (19 + 10 * rare))) *
int growPart = ((int) (value * (f - 1) / (19 + 10 * rare))) *
5 * (rare == 1 ? 5 : 15);
return levelPart + growPart;
}
Expand All @@ -119,7 +119,7 @@ private int calcByLevel(int mode, int value) {
return value;
}
}

public int getAtk(int mode) {
return (int) calcByLevel(mode, atk);
}
Expand All @@ -135,7 +135,7 @@ public float calcDPS(int mode) {
public int getDPS(int mode) {
return (int) calcDPS(mode);
}

public int getMultDPS(int mode) {
return (int) calcDPS(mode) * anum;
}
Expand All @@ -149,4 +149,4 @@ public String getSkinString() {
return skins[index];
}
// =====
}
}
2 changes: 1 addition & 1 deletion app/UnitListFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
if (textViewNum > 2) {
addUnitTextView(textLayout, String.format(
"技能SP: %d\n技能CD: %d\nDPS: %d\n总DPS: %d",
item.sklsp, item.sklcd,
item.sklsp, item.sklcd,
item.getDPS(mLevelMode), item.getMultDPS(mLevelMode)));
}

Expand Down
2 changes: 1 addition & 1 deletion app/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class Utils {
public final static long EXPIRATION = 14400000L;
private final static String BASEURL =
private final static String BASEURL =
"http://bbtfr.github.io/MerusutoChristina/data/";

static public void ensureParentDirectoryExists(File file) {
Expand Down
2 changes: 1 addition & 1 deletion resources/drawable/dialog_text_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
<corners android:radius="@dimen/dialog_large_margin" />
</shape>
</item>
</layer-list>
</layer-list>
2 changes: 1 addition & 1 deletion resources/drawable/ic_logo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
android:drawable="@drawable/ic_launcher"
android:right="25dp"
android:left="35dp" />
</layer-list>
</layer-list>
4 changes: 2 additions & 2 deletions resources/layout/text_view_companion_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
android:layout_weight="1" >

<TextView
android:id="@+id/text_view"
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="@dimen/text_view_line_spacing_extra" />

</FrameLayout>
</FrameLayout>
4 changes: 2 additions & 2 deletions resources/menu/options_companion.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@
android:icon="@drawable/ic_action_search"
android:showAsAction="collapseActionView|always"
android:actionViewClass="android.widget.SearchView" />
<item
<item
android:id="@+id/menu_close_search"
android:visible="false"
android:title="取消"
android:showAsAction="always" />
</menu>
</menu>
6 changes: 3 additions & 3 deletions resources/menu/options_familiar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@
android:title="重置" />
</menu>
</item>
<item
<item
android:id="@+id/menu_search"
android:title="搜索"
android:icon="@drawable/ic_action_search"
android:showAsAction="collapseActionView|always"
android:actionViewClass="android.widget.SearchView" />
<item
<item
android:id="@+id/menu_close_search"
android:visible="false"
android:title="取消"
android:showAsAction="always" />
</menu>
</menu>
4 changes: 2 additions & 2 deletions resources/values-w480dp/integers.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<integer name="text_view_num">4</integer>

</resources>
</resources>
4 changes: 2 additions & 2 deletions resources/values-w820dp/integers.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<integer name="text_view_num">5</integer>

</resources>
</resources>
2 changes: 1 addition & 1 deletion resources/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>

<dimen name="cell_height">100dp</dimen>
<dimen name="fragment_small_margin">3dp</dimen>
<dimen name="fragment_medium_margin">6dp</dimen>
Expand Down
4 changes: 2 additions & 2 deletions resources/values/integers.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<integer name="text_view_num">2</integer>

</resources>
</resources>
2 changes: 1 addition & 1 deletion resources/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<item name="android:background">@android:color/transparent</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:backgroundDimAmount">0.5</item>
</style>
</style>

<style name="OverlayText">
<item name="android:textColor">#eeeeee</item>
Expand Down

0 comments on commit 9f486b9

Please sign in to comment.