Skip to content

Commit

Permalink
relese 1.3.2 for limited area
Browse files Browse the repository at this point in the history
  • Loading branch information
MewX committed Feb 24, 2016
1 parent 1ae177e commit 2a7e97d
Show file tree
Hide file tree
Showing 60 changed files with 136 additions and 395 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Expand Up @@ -23,11 +23,11 @@ local.properties
proguard/

# Proguard files by Gradle
studio-android/LightNovelLibrary/app/unused.txt
studio-android/LightNovelLibrary/app/seeds.txt
studio-android/LightNovelLibrary/app/mapping.txt
studio-android/LightNovelLibrary/app/class_files.txt
studio-android/LightNovelLibrary/app/*.mapping.txt
studio-android/LightNovelLibrary/app/*unused.txt
studio-android/LightNovelLibrary/app/*seeds.txt
studio-android/LightNovelLibrary/app/*mapping.txt
studio-android/LightNovelLibrary/app/*class_files.txt
studio-android/LightNovelLibrary/app/*mapping.txt
studio-android/LightNovelLibrary/app/*-report.txt

# Intellij project files
Expand Down
3 changes: 1 addition & 2 deletions studio-android/LightNovelLibrary/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions studio-android/LightNovelLibrary/app/.gitignore
@@ -1 +1,5 @@
/build
*unused.txt
*seeds.txt
*mapping.txt
*class_files.txt
4 changes: 2 additions & 2 deletions studio-android/LightNovelLibrary/app/build.gradle
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion 15
targetSdkVersion 23
versionCode 32
versionName "1.4"
versionName "1.3.2"
}
buildTypes {
debug {
Expand Down Expand Up @@ -68,7 +68,7 @@ dependencies {
}
compile 'com.getbase:floatingactionbutton:1.9.0'
compile 'com.makeramen:roundedimageview:2.0.1'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.3'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.4.1'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile 'com.jpardogo.googleprogressbar:library:1.2.0'
compile 'org.adw.library:discrete-seekbar:1.0.0'
Expand Down
31 changes: 12 additions & 19 deletions studio-android/LightNovelLibrary/app/src/main/AndroidManifest.xml
Expand Up @@ -42,51 +42,44 @@

<!-- Activity list -->
<activity
android:name="org.mewx.wenku8.activity.WelcomeActivity"
android:name="org.mewx.wenku8.activity.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- Main Activity -->
<activity
android:name="org.mewx.wenku8.activity.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
</activity>

<!-- Search Activity -->
<activity android:name=".activity.SearchActivity"
android:label="@string/action_search"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Search Result Activity -->
<activity android:name=".activity.SearchResultActivity"
android:label="@string/action_search"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Novel Info Activity -->
<activity android:name=".activity.NovelInfoActivity"
android:label="@string/action_novel_info"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Novel Chapter List Activity -->
<activity android:name=".activity.NovelChapterActivity"
android:label="@string/action_chapter_list"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Novel Content Activity (Vertical Old Engine) -->
<activity android:name=".activity.VerticalReaderActivity"
android:label="@string/action_old_vertical_reader"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Novel Content Activity (Horizontal Ver 1) allow multiple instance -->
Expand All @@ -98,31 +91,31 @@
<!-- View Image Detail Activity -->
<activity android:name=".activity.ViewImageDetailActivity"
android:label="@string/action_watch_image"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- User Login Activity -->
<activity android:name=".activity.UserLoginActivity"
android:label="@string/action_user_login"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- User Info Activity -->
<activity android:name=".activity.UserInfoActivity"
android:label="@string/action_user_info"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Menu Background Selector Activity -->
<activity android:name=".activity.MenuBackgroundSelectorActivity"
android:label="@string/action_menu_background_selector"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Menu Background Selector Activity -->
<activity android:name=".activity.AboutActivity"
android:label="@string/action_about"
android:screenOrientation="portrait">
android:screenOrientation="unspecified">
</activity>

<!-- Directory Picker Activity-->
Expand Down
Expand Up @@ -10,6 +10,7 @@
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.Toast;

import com.afollestad.materialdialogs.GravityEnum;
Expand All @@ -26,7 +27,11 @@
import org.mewx.wenku8.R;
import org.mewx.wenku8.fragment.NavigationDrawerFragment;
import org.mewx.wenku8.global.GlobalConfig;
import org.mewx.wenku8.util.LightCache;
import org.mewx.wenku8.util.LightUserSession;

import java.io.File;
import java.util.Locale;
import java.util.Timer;
import java.util.TimerTask;

Expand All @@ -47,14 +52,53 @@ public void setCurrentFragment(FRAGMENT_LIST f) {
status = f;
}

private Toolbar mToolbar;
private NavigationDrawerFragment mNavigationDrawerFragment;
private static Boolean isExit = false; // used for exit by twice

private void initialApp() {
// load language
Locale locale;
switch (GlobalConfig.getCurrentLang()) {
case SC:
locale = Locale.SIMPLIFIED_CHINESE;
break;
case TC:
locale = Locale.TRADITIONAL_CHINESE;
break;
default:
locale = Locale.SIMPLIFIED_CHINESE;
break;
}
android.content.res.Configuration config = new android.content.res.Configuration();
config.locale = locale;
Locale.setDefault(locale);
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());

// tint
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setTintAlpha(0.0f);

// execute background action
LightUserSession.aiui = new LightUserSession.AsyncInitUserInfo();
LightUserSession.aiui.execute();
GlobalConfig.loadAllSetting();

// create save folder
LightCache.saveFile(GlobalConfig.getFirstStoragePath() + "imgs", ".nomedia", "".getBytes(), false);
LightCache.saveFile(GlobalConfig.getSecondStoragePath() + "imgs", ".nomedia", "".getBytes(), false);
LightCache.saveFile(GlobalConfig.getFirstStoragePath() + GlobalConfig.customFolderName, ".nomedia", "".getBytes(), false);
LightCache.saveFile(GlobalConfig.getSecondStoragePath() + GlobalConfig.customFolderName, ".nomedia", "".getBytes(), false);
GlobalConfig.setFirstStoragePathStatus(LightCache.testFileExist(GlobalConfig.getFirstStoragePath() + "imgs" + File.separator + ".nomedia"));
// TODO: set status? tell app where is available
LightCache.saveFile(GlobalConfig.getFirstFullSaveFilePath() + "imgs", ".nomedia", "".getBytes(), false);
LightCache.saveFile(GlobalConfig.getSecondFullSaveFilePath() + "imgs", ".nomedia", "".getBytes(), false);
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_main); // have 3 styles
initialApp();

// UIL setting
if(ImageLoader.getInstance() == null || !ImageLoader.getInstance().isInited()) {
Expand Down Expand Up @@ -115,7 +159,7 @@ public void onNegative(MaterialDialog dialog) {


// set Toolbar
mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
setSupportActionBar(mToolbar);
// getSupportActionBar().setDisplayShowHomeEnabled(true);

Expand Down
Expand Up @@ -891,8 +891,7 @@ protected Wenku8Error.ErrorCode doInBackground(Integer... params) {
byte[] tempXml = LightNetwork.LightHttpPostConnection(Wenku8API.getBaseURL(), cv);
if (tempXml == null) return Wenku8Error.ErrorCode.NETWORK_ERROR; // network error
xml = new String(tempXml, "UTF-8");

// save file (cid.xml), didn't format it future version may format it for better performance
if(xml.trim().length() == 0) return Wenku8Error.ErrorCode.SERVER_RETURN_NOTHING;
GlobalConfig.writeFullFileIntoSaveFolder("novel", tempCi.cid + ".xml", xml);
}

Expand Down Expand Up @@ -967,8 +966,9 @@ protected void onPostExecute(Wenku8Error.ErrorCode result)
onResume();
isLoading = false;
return;
} else if (result == Wenku8Error.ErrorCode.XML_PARSE_FAILED) {
Toast.makeText(NovelInfoActivity.this, "Parse failed!", Toast.LENGTH_LONG).show();
} else if (result == Wenku8Error.ErrorCode.XML_PARSE_FAILED
|| result == Wenku8Error.ErrorCode.SERVER_RETURN_NOTHING) {
Toast.makeText(NovelInfoActivity.this, "Server returned strange data! (copyright reason?)", Toast.LENGTH_LONG).show();
if (pDialog != null)
pDialog.dismiss();
onResume();
Expand Down Expand Up @@ -1110,8 +1110,7 @@ protected Wenku8Error.ErrorCode doInBackground(Integer[]... params) {
byte[] tempXml = LightNetwork.LightHttpPostConnection(Wenku8API.getBaseURL(), cv);
if (tempXml == null) return Wenku8Error.ErrorCode.NETWORK_ERROR; // network error
xml = new String(tempXml, "UTF-8");

// save file (cid.xml), didn't format it future version may format it for better performance
if(xml.trim().length() == 0) return Wenku8Error.ErrorCode.SERVER_RETURN_NOTHING;
GlobalConfig.writeFullFileIntoSaveFolder("novel", tempCi.cid + ".xml", xml);
}

Expand Down Expand Up @@ -1184,8 +1183,9 @@ protected void onPostExecute(Wenku8Error.ErrorCode errorCode) {
onResume();
loading = false;
return;
} else if (errorCode == Wenku8Error.ErrorCode.XML_PARSE_FAILED) {
Toast.makeText(NovelInfoActivity.this, "Parse failed!", Toast.LENGTH_LONG).show();
} else if (errorCode == Wenku8Error.ErrorCode.XML_PARSE_FAILED
|| errorCode == Wenku8Error.ErrorCode.SERVER_RETURN_NOTHING) {
Toast.makeText(NovelInfoActivity.this, "Server returned strange data! (copyright reason?)", Toast.LENGTH_LONG).show();
if (md != null) md.dismiss();
onResume();
loading = false;
Expand Down

This file was deleted.

0 comments on commit 2a7e97d

Please sign in to comment.