修正可能出现的除数为零

This commit is contained in:
seven332 committed 2014-09-02 01:22:49 +08:00
1 parent d25caafc8b
commit dcc45c5d81
42 files changed
+148 -102

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@
<folderInfo id="com.android.toolchain.gcc.1322280913.1369823253" name="/" resourcePath="">
<toolChain id="com.android.toolchain.gcc.803500692" name="Android GCC" superClass="com.android.toolchain.gcc">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1260474165" isAbstract="false" superClass="com.android.targetPlatform"/>
<builder id="com.android.builder.2127875218" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<builder arguments="NDK_DEBUG=0" command="ndk-build" id="com.android.builder.2127875218" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
<outputEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 805 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 B

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 877 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+2 -1
View File
@@ -22,7 +22,8 @@
<com.hippo.ehviewer.widget.PullListView
android:id="@+id/gallery_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
android:layout_height="fill_parent"
android:saveEnabled="false" />
<com.hippo.ehviewer.widget.RefreshTextView
android:id="@+id/refresh_text"
-40
View File
@@ -1,40 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 Hippo Seven
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_favourite"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_action_favorite"
android:title="@string/favourite"/>
<item
android:id="@+id/action_download"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_action_download"
android:title="@string/download"/>
<item
android:id="@+id/action_info"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_action_info"
android:title="@string/info"/>
<item
android:id="@+id/action_reply"
android:showAsAction="ifRoom"
android:icon="@drawable/ic_action_reply"
android:title="@string/reply"/>
</menu>
+8 -2
View File
@@ -172,11 +172,11 @@
<string name="start_position_title">开页位置</string>
<string name="list_display_settings_title">列表</string>
<string name="list_mode_title">列表模式</string>
<string name="list_thumb_columns">列表缩略图列数</string>
<string name="preview_display_settings_title">预览</string>
<string name="preview_columns">预览图列数</string>
<string name="popular_display_settings_title">热门</string>
<string name="show_popular_update_time_title">显示热门更新时间</string>
<string name="eh_settings_title">EH</string>
@@ -191,6 +191,7 @@
<string name="preview_mode_title">预览图模式</string>
<string name="preview_mode_normal">正常预览图</string>
<string name="preview_mode_large">大预览图</string>
<string name="data_settings_title">数据</string>
<string name="download_data_settings_title">下载</string>
<string name="download_path_title">下载路径</string>
@@ -199,6 +200,11 @@
<string name="media_scan_summary_off">大多数图库应用将不会显示下载目录中的图片</string>
<string name="favorite_data_settings_title">收藏</string>
<string name="default_favorite">默认收藏夹</string>
<string name="read_settings_title">阅读</string>
<string name="gallery_show_clock_title">显示时间</string>
<string name="gallery_show_battery_title">显示电量</string>
<string name="about_settings_title">关于</string>
<string name="author_title">作者</string>
<string name="changelog_title">日志</string>
-21
View File
@@ -45,27 +45,6 @@
</PreferenceCategory>
<PreferenceCategory
android:title="@string/read_display_settings_title">
<com.hippo.ehviewer.preference.AutoListPreference
android:key="page_scaling"
android:title="@string/page_scaling_title"
android:entries="@array/page_scaling_entries"
android:entryValues="@array/page_scaling_entry_values"
android:defaultValue="3"
android:summary="%s" />
<com.hippo.ehviewer.preference.AutoListPreference
android:key="start_position"
android:title="@string/start_position_title"
android:entries="@array/start_position_entries"
android:entryValues="@array/start_position_values"
android:defaultValue="1"
android:summary="%s" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/list_display_settings_title">
+46
View File
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Hippo Seven
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
<com.hippo.ehviewer.preference.AutoListPreference
android:key="page_scaling"
android:title="@string/page_scaling_title"
android:entries="@array/page_scaling_entries"
android:entryValues="@array/page_scaling_entry_values"
android:defaultValue="3"
android:summary="%s" />
<com.hippo.ehviewer.preference.AutoListPreference
android:key="start_position"
android:title="@string/start_position_title"
android:entries="@array/start_position_entries"
android:entryValues="@array/start_position_values"
android:defaultValue="1"
android:summary="%s" />
<CheckBoxPreference
android:key="gallery_show_clock"
android:title="@string/gallery_show_clock_title"
android:defaultValue="true" />
<CheckBoxPreference
android:key="gallery_show_battery"
android:title="@string/gallery_show_battery_title"
android:defaultValue="true" />
</PreferenceScreen>
+12 -6
View File
@@ -15,29 +15,35 @@
-->
<preference-headers
xmlns:android="http://schemas.android.com/apk/res/android">
<header
android:id="@+id/display_settings"
android:fragment="com.hippo.ehviewer.ui.SettingsActivity$DisplayFragment"
android:title="@string/display_settings_title"
android:icon="@drawable/ic_setting_display_dark" />
<header
android:id="@+id/eh_settings"
android:fragment="com.hippo.ehviewer.ui.SettingsActivity$EhFragment"
android:title="@string/eh_settings_title"
android:icon="@drawable/ic_action_panda_dark" />
<header
android:id="@+id/data_settings"
android:fragment="com.hippo.ehviewer.ui.SettingsActivity$DataFragment"
android:title="@string/data_settings_title"
android:icon="@drawable/ic_setting_data_dark" />
<header
android:id="@+id/read_settings"
android:fragment="com.hippo.ehviewer.ui.SettingsActivity$ReadFragment"
android:title="@string/read_settings_title"
android:icon="@drawable/ic_setting_read_dark" />
<header
android:id="@+id/about_settings"
android:fragment="com.hippo.ehviewer.ui.SettingsActivity$AboutFragment"
android:title="@string/about_settings_title"
android:icon="@drawable/ic_action_info_dark" />
android:icon="@drawable/ic_setting_about_dark" />
</preference-headers>
@@ -220,6 +220,12 @@ public class GalleryActivity extends AbsActivity
initAnimator();
// Hide or show
if (!Config.getGShowTime())
findViewById(R.id.clock).setVisibility(View.GONE);
if (!Config.getGShowBattery())
findViewById(R.id.battery).setVisibility(View.GONE);
// Set listener
mGalleryView.setGalleryViewListener(this);
mPageSeeker.setOnSeekBarChangeListener(this);
@@ -305,6 +311,10 @@ public class GalleryActivity extends AbsActivity
}
public void updateSeekBubble(int progress, int max, int thumbOffset) {
if (max == 0)
// Avoid divide by zero
return;
thumbOffset = thumbOffset + Ui.dp2pix(12);
int x = (mainView.getWidth() - 2 * thumbOffset) * progress / max + thumbOffset;
mSeekerBubble.setX(x);
@@ -136,6 +136,7 @@ public class SettingsActivity extends AbsPreferenceActivity {
DisplayFragment.class.getName(),
EhFragment.class.getName(),
DataFragment.class.getName(),
ReadFragment.class.getName(),
AboutFragment.class.getName()
};
@@ -143,7 +144,8 @@ public class SettingsActivity extends AbsPreferenceActivity {
R.drawable.ic_setting_display,
R.drawable.ic_action_panda,
R.drawable.ic_setting_data,
R.drawable.ic_action_info
R.drawable.ic_setting_read,
R.drawable.ic_setting_about
};
@Override
@@ -584,6 +586,29 @@ public class SettingsActivity extends AbsPreferenceActivity {
}
}
public static class ReadFragment extends TranslucentPreferenceFragment
implements Preference.OnPreferenceChangeListener,
Preference.OnPreferenceClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.read_settings);
}
@Override
public boolean onPreferenceClick(Preference preference) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
// TODO Auto-generated method stub
return false;
}
}
public static class AboutFragment extends TranslucentPreferenceFragment
implements Preference.OnPreferenceClickListener,
Preference.OnPreferenceChangeListener {
+43 -30
View File
@@ -38,10 +38,6 @@ public class Config {
private static final String KEY_SCREEN_ORIENTATION = "screen_orientation";
private static final String DEFAULT_SCREEN_ORIENTATION = "0";
private static final String KEY_PAGE_SCALING = "page_scaling";
private static final String DEFAULT_PAGE_SCALING = "3";
private static final String KEY_START_POSITION = "start_position";
private static final String DEFAULT_START_POSITION = "1";
private static final String KEY_CACHE_SIZE = "cache_size";
private static final String DEFAULT_CACHE_SIZE = "25";
@@ -174,30 +170,6 @@ public class Config {
}
}
public static int getPageScalingMode() {
int pageScalingMode = 3;
try {
pageScalingMode = Integer.parseInt(mConfigPre.getString(
KEY_PAGE_SCALING, DEFAULT_PAGE_SCALING));
} catch (Exception e) {
mConfigPre.edit().putString(KEY_PAGE_SCALING, DEFAULT_PAGE_SCALING)
.apply();
}
return pageScalingMode;
}
public static int getStartPosition() {
int startPosition = 1;
try {
startPosition = Integer.parseInt(mConfigPre.getString(
KEY_START_POSITION, DEFAULT_START_POSITION));
} catch (Exception e) {
mConfigPre.edit().putString(KEY_START_POSITION, DEFAULT_START_POSITION)
.apply();
}
return startPosition;
}
public static int getScreenOriMode() {
int screenOriMode = 0;
try {
@@ -400,8 +372,6 @@ public class Config {
mConfigPre.edit().putBoolean(KEY_GALLERY_FIRST, galleryFirst).apply();
}
/****** Mode an API Mode ******/
private static final String KEY_MODE = "mode";
@@ -517,4 +487,47 @@ public class Config {
public static int getPreviewPerRow() {
return Integer.parseInt(mConfigPre.getString(KEY_PREVIEW_PER_ROW, DEFAULT_PREVIEW_PER_ROW));
}
/****** Read ******/
private static final String KEY_PAGE_SCALING = "page_scaling";
private static final String DEFAULT_PAGE_SCALING = "3";
private static final String KEY_START_POSITION = "start_position";
private static final String DEFAULT_START_POSITION = "1";
private static final String KEY_GALLERY_SHOW_TIME = "gallery_show_clock";
private static final boolean DEFAULT_GALLERY_SHOW_TIME = true;
private static final String KEY_GALLERY_SHOW_BATTERY = "gallery_show_battery";
private static final boolean DEFAULT_GALLERY_SHOW_BATTERY = true;
public static int getPageScalingMode() {
int pageScalingMode = 3;
try {
pageScalingMode = Integer.parseInt(mConfigPre.getString(
KEY_PAGE_SCALING, DEFAULT_PAGE_SCALING));
} catch (Exception e) {
mConfigPre.edit().putString(KEY_PAGE_SCALING, DEFAULT_PAGE_SCALING)
.apply();
}
return pageScalingMode;
}
public static int getStartPosition() {
int startPosition = 1;
try {
startPosition = Integer.parseInt(mConfigPre.getString(
KEY_START_POSITION, DEFAULT_START_POSITION));
} catch (Exception e) {
mConfigPre.edit().putString(KEY_START_POSITION, DEFAULT_START_POSITION)
.apply();
}
return startPosition;
}
public static boolean getGShowTime() {
return mConfigPre.getBoolean(KEY_GALLERY_SHOW_TIME, DEFAULT_GALLERY_SHOW_TIME);
}
public static boolean getGShowBattery() {
return mConfigPre.getBoolean(KEY_GALLERY_SHOW_BATTERY, DEFAULT_GALLERY_SHOW_BATTERY);
}
}